Class: Rpub::Commands::Generate

Inherits:
Base
  • Object
show all
Defined in:
lib/rpub/commands/generate.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#help

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

#invokeObject



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