Class: Lucid::Generators::GameGenerator

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lucid/generators/game/game_generator.rb

Overview

This generates the game application directory structure.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject


11
12
13
# File 'lib/lucid/generators/game/game_generator.rb', line 11

def self.source_root
  "#{File.dirname(__FILE__)}/templates"
end

Instance Method Details

#bundlerObject


26
27
28
29
30
31
# File 'lib/lucid/generators/game/game_generator.rb', line 26

def bundler
  say_status :bundler, 'bundle install'
  Bundler.with_clean_env do
    run 'bundle install'
  end
end

#create_game_directoryObject


33
34
35
# File 'lib/lucid/generators/game/game_generator.rb', line 33

def create_game_directory
  create_file 'game/.keep'
end

#game_directoryObject


15
16
17
18
19
20
# File 'lib/lucid/generators/game/game_generator.rb', line 15

def game_directory
  empty_directory game_path, verbose: false
  say "Generating Lucid Mud #{Lucid::VERSION} instance in '#{game_path}'"
  self.destination_root = game_path
  empty_directory 'game'
end

#gemfileObject


22
23
24
# File 'lib/lucid/generators/game/game_generator.rb', line 22

def gemfile
  template 'Gemfile', 'Gemfile'
end

#install_coreObject


37
38
39
40
# File 'lib/lucid/generators/game/game_generator.rb', line 37

def install_core
  require 'lucid/generators/core/install/install_generator'
  Lucid::Generators::Core::InstallGenerator.start(["--name=#{game_path}"])
end

#install_portalObject


42
43
44
45
# File 'lib/lucid/generators/game/game_generator.rb', line 42

def install_portal
  require 'lucid/generators/portal/install/install_generator'
  Lucid::Generators::Portal::InstallGenerator.start(["--name=#{game_path}"])
end

#install_worldObject


47
48
49
50
# File 'lib/lucid/generators/game/game_generator.rb', line 47

def install_world
  require 'lucid/generators/world/install/install_generator'
  Lucid::Generators::World::InstallGenerator.start(["--name=#{game_path}"])
end