Class: Belts::Engine

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



8
9
10
# File 'lib/belts/engine.rb', line 8

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#create_appObject



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/belts/engine.rb', line 28

def create_app
  app_files = [
    "components/spinner.rb",
    "prefabs/spinning_cube.rb",
    "prefabs/camera_3d.rb",
    "scenes/main_scene.rb",
    "systems/spinner_system.rb"
  ]

  app_files.each do |file|
    template("templates/app/#{file}.tt", "#{name}/app/#{file}")
  end
end

#create_configObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/belts/engine.rb', line 17

def create_config
  config_files = [
    "application.rb",
    "game.rb"
  ]

  config_files.each do |file|
    template("templates/config/#{file}.tt", "#{name}/config/#{file}")
  end
end

#create_gemfileObject



12
13
14
15
# File 'lib/belts/engine.rb', line 12

def create_gemfile
  template("templates/.ruby-version.tt", "#{name}/.ruby-version")
  template("templates/Gemfile.tt", "#{name}/Gemfile")
end