Class: Rna::Filesystem
Instance Attribute Summary
Attributes inherited from Outputer
Instance Method Summary collapse
Methods inherited from Outputer
Constructor Details
This class inherits a constructor from Rna::Outputer
Instance Method Details
#run(jsons) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/rna/outputers.rb', line 10 def run(jsons) output_path = [:output_path] || "output" FileUtils.rm_rf(output_path) if [:clean] FileUtils.mkdir(output_path) unless File.exist?(output_path) jsons.each do |role,json| puts " #{role}.json" if [:verbose] File.open("#{output_path}/#{role}.json", 'w') {|f| f.write(json) } end end |