Class: Rupi::Generator

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/rupi/generator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/rupi/generator.rb', line 8

def name
  @name
end

Class Method Details

.source_rootObject



18
19
20
# File 'lib/rupi/generator.rb', line 18

def self.source_root
  Pathname.new(__FILE__) + '../../../templates'
end

Instance Method Details

#new(name) ⇒ Object



11
12
13
14
15
16
# File 'lib/rupi/generator.rb', line 11

def new(name)
  @name = name
  copy_file 'Gemfile',     "#{name}/Gemfile"
  template  'Capfile.erb', "#{name}/Capfile"
  copy_file 'app.rb',      "#{name}/app.rb"
end