Class: Hanamimastery::CLI::Transformations::Touch
- Inherits:
-
Object
- Object
- Hanamimastery::CLI::Transformations::Touch
- Defined in:
- lib/hanamimastery/cli/transformations/touch.rb
Constant Summary collapse
- PATTERN =
/^modifiedAt\:[[:space:]]"\d{4}-\d{2}-\d{2}"$/
Instance Method Summary collapse
-
#call(content, timestamp: nil) ⇒ Object
Updates the modifiedAt with the passed date.
Instance Method Details
#call(content, timestamp: nil) ⇒ Object
Updates the modifiedAt with the passed date
11 12 13 14 15 16 17 |
# File 'lib/hanamimastery/cli/transformations/touch.rb', line 11 def call(content, timestamp: nil) ||= Time.now content.gsub( PATTERN, %(modifiedAt: "#{.strftime("%Y-%M-%d")}") ) end |