Sha256: 06fd0bf5102c5bdb99f907dd97c468acca6e70b01ca4195c4a584af7ac9e1f14
Contents?: true
Size: 475 Bytes
Versions: 7
Compression:
Stored size: 475 Bytes
Contents
# frozen_string_literal: true module Hanamimastery module CLI module Transformations class Touch PATTERN = /^modifiedAt\:[[:space:]]"\d{4}-\d{2}-\d{2}"$/ # Updates the modifiedAt with the passed date # def call(content, timestamp: nil) timestamp ||= Time.now content.gsub( PATTERN, %(modifiedAt: "#{timestamp.strftime("%Y-%M-%d")}") ) end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems