Class: Generator
- Inherits:
-
Object
- Object
- Generator
- Defined in:
- lib/bottlerocket/generator.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
Instance Method Summary collapse
- #copy_template ⇒ Object
- #create_directory ⇒ Object
- #dir_setup ⇒ Object
-
#initialize(dir) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(dir) ⇒ Generator
Returns a new instance of Generator.
5 6 7 |
# File 'lib/bottlerocket/generator.rb', line 5 def initialize(dir) self.dir = dir end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
4 5 6 |
# File 'lib/bottlerocket/generator.rb', line 4 def dir @dir end |
Instance Method Details
#copy_template ⇒ Object
13 14 15 |
# File 'lib/bottlerocket/generator.rb', line 13 def copy_template FileUtils.cp_r(File.dirname(__FILE__) + '/../../template', dir) end |
#create_directory ⇒ Object
9 10 11 |
# File 'lib/bottlerocket/generator.rb', line 9 def create_directory FileUtils.mkdir_p dir end |
#dir_setup ⇒ Object
17 18 19 |
# File 'lib/bottlerocket/generator.rb', line 17 def dir_setup FileUtils.mkdir_p [dir + "/public/css", dir + "/public/javascripts", dir + "/public/images", dir + "/views/stylesheets"] end |