Class: Stealth::Generators::Builder

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/stealth/generators/builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



13
14
15
# File 'lib/stealth/generators/builder.rb', line 13

def self.source_root
  File.dirname(__FILE__) + "/builder"
end

Instance Method Details

#change_directory_bundleObject



35
36
37
# File 'lib/stealth/generators/builder.rb', line 35

def change_directory_bundle
  puts run("cd #{name} && bundle install")
end

#create_bot_directoryObject



17
18
19
# File 'lib/stealth/generators/builder.rb', line 17

def create_bot_directory
  empty_directory(name)
end

#create_bot_structureObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/stealth/generators/builder.rb', line 21

def create_bot_structure
  directory('bot', "#{name}/bot")
  directory('config', "#{name}/config")
  directory('db', "#{name}/db")

  # Miscellaneous Files
  copy_file "config.ru", "#{name}/config.ru"
  copy_file "Rakefile", "#{name}/Rakefile"
  copy_file "Gemfile", "#{name}/Gemfile"
  copy_file "README.md", "#{name}/README.md"
  copy_file "Procfile.dev", "#{name}/Procfile.dev"
  copy_file ".gitignore", "#{name}/.gitignore"
end