Class: Makimono::Generator::SimpleFile
- Inherits:
-
Object
- Object
- Makimono::Generator::SimpleFile
- Defined in:
- lib/makimono/generator/simple_file.rb
Instance Method Summary collapse
- #generate(resources) ⇒ Object
-
#initialize(config) ⇒ SimpleFile
constructor
A new instance of SimpleFile.
Constructor Details
#initialize(config) ⇒ SimpleFile
Returns a new instance of SimpleFile.
6 7 8 |
# File 'lib/makimono/generator/simple_file.rb', line 6 def initialize(config) @config = config end |
Instance Method Details
#generate(resources) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/makimono/generator/simple_file.rb', line 10 def generate(resources) FileUtils.mkdir_p(@config[:output]) unless Dir.exist?(@config[:output]) resources.each do |resource| output_path = File.(resource.path, @config[:output]) File.write(output_path, resource.content) end end |