Class: Forematter::Commands::Cleanup
- Inherits:
-
Forematter::CommandRunner
- Object
- Cri::CommandRunner
- Forematter::CommandRunner
- Forematter::Commands::Cleanup
- Defined in:
- lib/forematter/commands/cleanup.rb
Instance Method Summary collapse
Methods inherited from Forematter::CommandRunner
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/forematter/commands/cleanup.rb', line 22 def run require 'stringex_lite' require 'titleize' files_with(field).each do |file| old = file[field].to_ruby begin val = cleanup(old) rescue Forematter::UnexpectedValue => e log_skip(file, e.) && next end unless val == old file[field] = val file.write end end end |