Class: Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/bottlerocket/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dirObject

Returns the value of attribute dir.



4
5
6
# File 'lib/bottlerocket/generator.rb', line 4

def dir
  @dir
end

Instance Method Details

#copy_templateObject



13
14
15
# File 'lib/bottlerocket/generator.rb', line 13

def copy_template
  FileUtils.cp_r(File.dirname(__FILE__) + '/../../template', dir)
end

#create_directoryObject



9
10
11
# File 'lib/bottlerocket/generator.rb', line 9

def create_directory
  FileUtils.mkdir_p dir
end

#dir_setupObject



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