Class: Rpub::Commands::Generate
- Defined in:
- lib/rpub/commands/generate.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(*args) ⇒ Generate
constructor
A new instance of Generate.
- #invoke ⇒ Object
Methods inherited from Base
Methods included from SubclassTracker
#each, #identifier, #inherited, #matching
Constructor Details
#initialize(*args) ⇒ Generate
Returns a new instance of Generate.
6 7 8 9 |
# File 'lib/rpub/commands/generate.rb', line 6 def initialize(*args) super @all = true end |
Instance Method Details
#invoke ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rpub/commands/generate.rb', line 11 def invoke super if (@styles.nil? && @all) || (!@styles.nil? && @styles) write_file Rpub.support_file('styles.css') end if (@layout.nil? && @all) || (!@layout.nil? && @layout) write_file Rpub.support_file('layout.html') end if (@config.nil? && @all) || (!@config.nil? && @config) write_file Rpub.support_file('config.yml') end end |