Skip to content

Releases: dry-rb/dry-files

v1.1.0

18 Oct 11:32
v1.1.0
f4b63c9
Compare
Choose a tag to compare

Added

  • Add Dry::Files#chmod(path, mode) to modify file permissions. Provide the mode as an integer
    to match UNIX octal permissions, such as 0o755. (@timriley in #18)

Compare v1.0.2...v1.1.0

v1.0.2

03 Oct 10:20
v1.0.2
27ae546
Compare
Choose a tag to compare

Fixed

  • Ensure Dry::Files#inject_line_at_block_bottom to not match false positive closing blocks (@jodosha in #17)

Compare v1.0.1...v1.0.2

v1.0.1

21 Nov 10:21
v1.0.1
9241825
Compare
Choose a tag to compare

Fixed

  • Do not introduce multiple newlines in Dry::Files#append (@timriley in #14)

Compare v1.0.0...v1.0.1

v1.0.0

04 Nov 13:15
v1.0.0
Compare
Choose a tag to compare

Changed

  • Bumped version to 1.0.0 (@solnic)

Compare v0.3.0...v1.0.0

v0.3.0

19 Sep 17:18
v0.3.0
Compare
Choose a tag to compare

Added

  • Support for inject_line_at_class_bottom (via #13) (@jodosha)

Compare v0.2.0...v0.3.0

v0.2.0

10 Jul 09:39
v0.2.0
82d44ca
Compare
Choose a tag to compare

Added

  • Dry::Files#append to create intermediate directory and touch destination file (via #8) (@jodosha)

Compare v0.1.0...v0.2.0

v0.1.0

04 May 09:36
v0.1.0
1f3a253
Compare
Choose a tag to compare

Initial release

Added

  • Introduced Dry::Files
  • Introduced Dry::Files#initialize which accepts an optional memory: 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)