Module: Mry::Runner
- Defined in:
- lib/mry/runner.rb
Constant Summary collapse
- Rewriters =
{ Gem::Version.new('0.47.0') => Rewriter_0_47_0, Gem::Version.new('0.46.0') => Rewriter_0_46_0, Gem::Version.new('0') => Rewriter_0, }.freeze
Class Method Summary collapse
Class Method Details
.run(files, target) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/mry/runner.rb', line 10 def run(files, target) rewriters = Rewriters .select{|key, _value| target >= key} .values.reverse files.each do |file| yaml = File.read(file) rewriters.each do |r| yaml = r.new(yaml).rewrite end File.write(file, yaml) end end |