Class: Mines::Generator::Application
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Mines::Generator::Application
- Includes:
- Thor::Actions
- Defined in:
- lib/generators/application.rb
Overview
Application Generator creates the default file structure. Accepts as an argument the name of the new application. A new directory with this name will be created
Class Method Summary collapse
-
.source_root ⇒ Object
This is needed by thor.
Instance Method Summary collapse
-
#create_directory_structure ⇒ Object
Create the default directory structure - Directories: miners, lib, log, config - Files: TODO also prints appropriate messages.
Class Method Details
.source_root ⇒ Object
This is needed by thor. Returns the source root directory.
23 24 25 |
# File 'lib/generators/application.rb', line 23 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#create_directory_structure ⇒ Object
Create the default directory structure
-
Directories: miners, lib, log, config
-
Files: TODO
also prints appropriate messages
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/generators/application.rb', line 31 def create_directory_structure #@log.info "Creating directory structure in dir: " + name empty_directory name empty_directory name + "/miners" empty_directory name + "/lib" empty_directory name + "/log" empty_directory name + "/config" template "templates/application_config.erb", "#{name}/config/application.rb" template "templates/Gemfile.erb", "#{name}/Gemfile" puts "Application created successfully! ".green print "Type " print "'cd #{name}' ".yellow print "to go to the applications root directory, and then " print "'mines help' ".yellow puts "to see all available commands and options." end |