Skip to content

Releases: sugarcrm/sugar_utils

[0.6.0] - 2019-05-31

31 May 16:22
Compare
Choose a tag to compare

Added

  • SugarUtils::File.append, which is explicitly for appending to a file. It will
    also create a new file if it does not yet exist
  • SugarUtils::scrub_encoding, which is used for cleaning badly encoded
    characters out of a string
  • SugarUtils::File.change_access, a wrapper for changing ownership and
    permissions of a file
  • SugarUtils::File.atomic_write, to atomically write a file

Removed

  • append support in SugarUtils::File.write (could have been specified by { mode: 'a })

Changed

  • :mode and :perm are now aliases for setting permissions on files in all the
    related methods (i.e., .write, .write_json, .touch, .append)
  • convert SugarUtils::File.write_json to use .atomic_write

[0.5.0] - 2018-05-01

31 May 16:23
Compare
Choose a tag to compare

Changed

  • bring back :perm as option to set the permissions in SugarUtils::File.write and SugarUtils::File.touch methods
  • :mode option in SugarUtils::File.write is now to be used for setting the file mode (e.g. read/write, append, etc). It can still be used for setting the permissions if it is an integer value for backwards compatibility purposes, but this usage has been deprecated.

[0.4.4] - 2018-01-31

31 May 16:25
Compare
Choose a tag to compare

Changed

  • fixed a bug in SugarUtils::File.read_json which it would raise an exception
    instead of returning an empty Hash, when :raise_on_missing was disabled and
    there was an error reading the file

[0.4.3] - 2017-08-25

31 May 16:25
Compare
Choose a tag to compare

Added

  • option to scrub character encoding in SugarUtils::File.read
  • option to set mtime in SugarUtils::File.touch

[0.4.2] - 2017-08-01

31 May 16:26
Compare
Choose a tag to compare

Changed

  • default file creation permissions from 666 to 644.

[0.4.1] - 2017-05-17

31 May 16:26
Compare
Choose a tag to compare

Added

  • options :owner, :group, :mode to SugarUtils::File.write and .touch

Changed

  • marked the :perm option as deprecated by :mode

[0.4.0] - 2017-05-17

31 May 16:28
Compare
Choose a tag to compare

Added

  • SugarUtils::File.touch, which will ensure the directory before touching the
    specified file

[0.3.0] - 2017-03-29

31 May 16:28
Compare
Choose a tag to compare

Added

  • SugarUtils::File.read, with locking and error handling when reading a plain
    text file
  • SugarUtils::File.write, with locking and error handling when writing a plain
    text file

Changed

  • explicitly specify the Ruby v2.0.0 support limit
  • divide SugarUtils::File.flock into .flock_shared and .flock_exclusive

[0.2.0] - 2016-07-21

31 May 16:29
Compare
Choose a tag to compare

Added

  • SugarUtils::File.flock, for file locking with a timeout
  • SugarUtils::File.read_json, with locking and error handling
  • SugarUtils::File.write_json, with locking and error handling
  • this CHANGELOG.md, following the http://keepachangelog.com/ guidelines

[0.1.0] - 2016-07-09

31 May 16:30
Compare
Choose a tag to compare

Added

  • SugarUtils.ensure_boolean
  • SugarUtils.ensure_integer