Class: Butterfly::Base
- Inherits:
-
RubiGen::Base
- Object
- RubiGen::Base
- Butterfly::Base
- Defined in:
- lib/base.rb
Overview
extend Base class wwith base functionality for all butterfly generators
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#gitinit ⇒ Object
readonly
Returns the value of attribute gitinit.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#after_generate ⇒ Object
do some final things after generation.
-
#initialize(runtime_args, runtime_options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(runtime_args, runtime_options = {}) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 14 15 16 |
# File 'lib/base.rb', line 9 def initialize(runtime_args, = {}) super @destination_root = File.(args.shift) @name = base_name @author = ENV['USER'] @gitinit = [:gitinit] @date = Time.now.strftime("%Y-%m-%d") end |
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
7 8 9 |
# File 'lib/base.rb', line 7 def @author end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
7 8 9 |
# File 'lib/base.rb', line 7 def date @date end |
#gitinit ⇒ Object (readonly)
Returns the value of attribute gitinit.
7 8 9 |
# File 'lib/base.rb', line 7 def gitinit @gitinit end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/base.rb', line 7 def name @name end |
Instance Method Details
#after_generate ⇒ Object
do some final things after generation
19 20 21 22 |
# File 'lib/base.rb', line 19 def after_generate git_init if @gitinit end |