Class: Combustion::Generator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


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

def self.source_root
  File.expand_path File.join(File.dirname(__FILE__), "..", "..")
end

Instance Method Details

#create_directoriesObject


13
14
15
16
17
18
19
# File 'lib/combustion/generator.rb', line 13

def create_directories
  empty_directory "spec/internal"
  empty_directory "spec/internal/config"
  empty_directory "spec/internal/db"
  empty_directory "spec/internal/log"
  empty_directory "spec/internal/public"
end

#create_filesObject


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

def create_files
  template "templates/routes.rb",    "spec/internal/config/routes.rb"
  template "templates/database.yml", "spec/internal/config/database.yml"
  template "templates/schema.rb",    "spec/internal/db/schema.rb"
  template "templates/config.ru",    "config.ru"
  template "templates/storage.yml", "spec/internal/config/storage.yml"

  create_file "spec/internal/app/assets/config/manifest.js"
  create_file "spec/internal/public/favicon.ico"
  create_file "spec/internal/log/.gitignore" do
    "*.log"
  end
end