Class: Kia::Commands::Build
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Kia::Commands::Build
- Defined in:
- lib/kia/commands/build.rb
Instance Attribute Summary collapse
-
#templates ⇒ Object
Returns the value of attribute templates.
Instance Method Summary collapse
Instance Attribute Details
#templates ⇒ Object
Returns the value of attribute templates.
8 9 10 |
# File 'lib/kia/commands/build.rb', line 8 def templates @templates end |
Instance Method Details
#compile ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/kia/commands/build.rb', line 10 def compile @templates = [] files = Dir.glob(["**/source/*.erb"]) files.each do |file| @templates << Tilt.new(file) end end |
#output ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/kia/commands/build.rb', line 20 def output @templates.each do |template| template.file.gsub!("source", "public").gsub!(".erb", "") File.open(template.file, "w") do |file| file.write(template.render) end end end |