Releases: jdee/pattern_patch
Release 1.0.0
Added Methods#patch_config to simplify configuration when including the Methods module.
include PatternPatch::Methods
patch_config do |c|
c.patch_dir = File.expand_path '../assets/patches', __dir__
c.trim_mode = '<>'
end
patch(:my_patch).apply '/path/to/target/file'
or
include PatternPatch::Methods
patch_config.patch_dir = File.expand_path '../assets/patches', __dir__
patch_config.trim_mode = '<>'
patch(:my_patch).apply '/path/to/target/file'
Some dependency updates.
Release 0.5.5
Improved support for Ruby 2.0 & 2.1.
- Added an explicit Ruby version requirement to the gemspec.
- Pinned rubocop to 0.50.0 (the last version to support Ruby 2.0) and set TargetRubyVersion to 2.0 in .rubocop.yml.
- Limited activesupport to
~> 4.2
, since 5.x requires Ruby 2.2.
This is not an issue when using the Bundler, but with previous versions, gem install pattern_patch
could fail unless you first gem install activesupport -v '~> 4.2'
. Now this will be automatic.
..
Release 0.5.4
Added support for passing safe level and trim mode to ERb via options to Patch#apply and #revert, methods in the Methods module and attributes on the PatternPatch module.
Release 0.5.3
You can now easily load patches by name from a specific folder:
PatternPatch.patch_dir = "/path/to/patches"
# Use /path/to/patches/patch_name.yml
PatternPatch.patch(:patch_name).apply file_path
Release 0.5.2
Added RDoc comments for better documentation.
Release 0.5.1
Removes debugging output left in from the last release.
Release 0.5.0
Added support for regular expressions with modifiers in YAML.
Release 0.4.0
Added support for ERB in the text
attribute or the contents of a text_file
.
Release 0.3.0
Added a text_file
attribute that is especially useful when inserting formatted multiline text from YAML.
Release 0.2.0
This introduces a better API for the gem, via the PatternPatch::Patch
class. This supports direct file patching and loading patches from YAML files.