All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- update the required ruby version from v2.2 to v2.6
- Sugar::Utils.ensure_boolean to consider
0
to be false - Sugar::Utils.ensure_boolean to ignore whitespace around strings before checking if they are 'false'
- 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
- append support in SugarUtils::File.write (could have been specified by { mode: 'a })
- :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
- 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.
- 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
- option to scrub character encoding in SugarUtils::File.read
- option to set mtime in SugarUtils::File.touch
- default file creation permissions from 666 to 644.
- options :owner, :group, :mode to SugarUtils::File.write and .touch
- marked the :perm option as deprecated by :mode
- SugarUtils::File.touch, which will ensure the directory before touching the specified file
- 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
- explicitly specify the Ruby v2.0.0 support limit
- divide SugarUtils::File.flock into .flock_shared and .flock_exclusive
- 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
- SugarUtils.ensure_boolean
- SugarUtils.ensure_integer