Class: Butterfly::Base

Inherits:
RubiGen::Base
  • Object
show all
Defined in:
lib/base.rb

Overview

extend Base class wwith base functionality for all butterfly generators

Instance Attribute Summary collapse

Instance Method Summary collapse

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, runtime_options = {})
  super
  @destination_root = File.expand_path(args.shift)
  @name = base_name
  @author = ENV['USER']
  @gitinit = runtime_options[:gitinit]
  @date = Time.now.strftime("%Y-%m-%d")
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



7
8
9
# File 'lib/base.rb', line 7

def author
  @author
end

#dateObject (readonly)

Returns the value of attribute date.



7
8
9
# File 'lib/base.rb', line 7

def date
  @date
end

#gitinitObject (readonly)

Returns the value of attribute gitinit.



7
8
9
# File 'lib/base.rb', line 7

def gitinit
  @gitinit
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/base.rb', line 7

def name
  @name
end

Instance Method Details

#after_generateObject

do some final things after generation



19
20
21
22
# File 'lib/base.rb', line 19

def after_generate
  git_init if @gitinit
  info_message
end