Class: Rpub::Commands::Generate
- Inherits:
-
Rpub::Command
- Object
- Rpub::Command
- Rpub::Commands::Generate
- Defined in:
- lib/rpub/commands/generate.rb
Instance Attribute Summary
Attributes inherited from Rpub::Command
Instance Method Summary collapse
Methods inherited from Rpub::Command
Constructor Details
This class inherits a constructor from Rpub::Command
Instance Method Details
#run ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rpub/commands/generate.rb', line 4 def run all = [.styles, .layout, .config].all? do |b| b.nil? || b == false end if (.styles.nil? && all) || (!.styles.nil? && .styles) source.write 'styles.css', source.read(Rpub.support_file('styles.css')) end if (.layout.nil? && all) || (!.layout.nil? && .layout) source.write 'layout.html', source.read(Rpub.support_file('layout.html')) end if (.config.nil? && all) || (!.config.nil? && .config) source.write 'config.yml', source.read(Rpub.support_file('config.yml')) end end |