- Add
Dry::Files#chmod(path, mode)
to modify file permissions. Provide the mode as an integer to match UNIX octal permissions, such as0o755
. (@timriley in #18)
- Ensure
Dry::Files#inject_line_at_block_bottom
to not match false positive closing blocks (@jodosha in #17)
- Do not introduce multiple newlines in
Dry::Files#append
(@timriley in #14)
- Bumped version to 1.0.0 (@solnic)
- Support for
inject_line_at_class_bottom
(via #13) (@jodosha)
- Dry::Files#append to create intermediate directory and touch destination file (via #8) (@jodosha)
Initial release
- Introduced
Dry::Files
- Introduced
Dry::Files#initialize
which accepts an optionalmemory: true/false
argument to use the in-memory adapter (@jodosha) - Introduced
Dry::Files#read
to read the file all at once (@jodosha) - Introduced
Dry::Files#touch
to touch a file and create all the intermediate directories, if needed (@jodosha) - Introduced
Dry::Files#write
to write/replace a file and create all the intermediate directories, if needed (@jodosha) - Introduced
Dry::Files#join
to join the given path tokens (@jodosha) - Introduced
Dry::Files#expand_path
to make the relative path absolute, starting from the current directory of from a custom one (@jodosha) - Introduced
Dry::Files#pwd
to return the current directory (@jodosha) - Introduced
Dry::Files#chdir
to temporary change the current directory (@jodosha) - Introduced
Dry::Files#mkdir
to create intermediate directories for the given directory name (@jodosha) - Introduced
Dry::Files#mkdir_p
to create intermediate directories for the given file name (@jodosha) - Introduced
Dry::Files#cp
to copy source file into destination and create intermediate destination directories, if needed (@jodosha) - Introduced
Dry::Files#delete
to delete a file (@jodosha) - Introduced
Dry::Files#delete_directory
to delete a directory (@jodosha) - Introduced
Dry::Files#exist?
to check if a path exists (@jodosha) - Introduced
Dry::Files#directory?
to check if a path is a directory (@jodosha) - Introduced
Dry::Files#executable?
to check if a path is an executable (@jodosha) - Introduced
Dry::Files#unshift
to add a new line at the top of the file (@jodosha) - Introduced
Dry::Files#append
to add a new line at the bottom of the file (@jodosha) - Introduced
Dry::Files#replace_first_line
to replace first line that match target (@jodosha) - Introduced
Dry::Files#replace_last_line
to replace last line that match target (@jodosha) - Introduced
Dry::Files#inject_line_before
to inject content before the first match of target (@jodosha) - Introduced
Dry::Files#inject_line_before_last
to inject content before the last match of target (@jodosha) - Introduced
Dry::Files#inject_line_after
to inject content after the first match of target (@jodosha) - Introduced
Dry::Files#inject_line_after_last
to inject content after the last match of target (@jodosha) - Introduced
Dry::Files#inject_line_at_block_top
to inject content as the first line of the matching code block (@jodosha) - Introduced
Dry::Files#inject_line_at_block_bottom
to inject content as the last line of the matching code block (@jodosha) - Introduced
Dry::Files#remove_line
to remove the first matching line (@jodosha) - Introduced
Dry::Files#remove_block
remove the first matching block (@jodosha)