Class: Moonwalkair::Generator
- Inherits:
-
Object
- Object
- Moonwalkair::Generator
- Defined in:
- lib/moonwalkair/generator.rb,
lib/moonwalkair/generator/options.rb,
lib/moonwalkair/generator/application.rb
Overview
Generator for creating a moonwalkair-enabled project
Defined Under Namespace
Classes: Application, Options
Constant Summary collapse
- APP_DIR =
Folder and template files
"app"
- BIN_DIR =
"bin"
- SCRIPT_DIR =
"script"
- CONFIG_DIR =
"config"
- APP_ASSETS_DIR =
File.join(APP_DIR, "assets")
- APP_LIB_DIR =
File.join(APP_DIR, "lib")
- APP_SCRIPTS_DIR =
File.join(APP_DIR, "scripts")
- APP_VIEWS_DIR =
File.join(APP_DIR, "views")
Instance Attribute Summary collapse
-
#air_sdk ⇒ Object
Returns the value of attribute air_sdk.
-
#description ⇒ Object
Returns the value of attribute description.
-
#options ⇒ Object
Returns the value of attribute options.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#target_dir ⇒ Object
Returns the value of attribute target_dir.
-
#user_email ⇒ Object
Returns the value of attribute user_email.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Generator
constructor
A new instance of Generator.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Generator
Returns a new instance of Generator.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/moonwalkair/generator.rb', line 25 def initialize( = {}) self. = self.project_name = [:project_name] if self.project_name.nil? || self.project_name.squeeze.strip == "" raise "Need a project name" end self.air_sdk = [:air_sdk] || "air2.0beta" self.target_dir = [:directory] || self.project_name self.user_name = [:user_name] self.user_email = [:user_email] end |
Instance Attribute Details
#air_sdk ⇒ Object
Returns the value of attribute air_sdk.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def air_sdk @air_sdk end |
#description ⇒ Object
Returns the value of attribute description.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def description @description end |
#options ⇒ Object
Returns the value of attribute options.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def @options end |
#project_name ⇒ Object
Returns the value of attribute project_name.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def project_name @project_name end |
#target_dir ⇒ Object
Returns the value of attribute target_dir.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def target_dir @target_dir end |
#user_email ⇒ Object
Returns the value of attribute user_email.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def user_email @user_email end |
#user_name ⇒ Object
Returns the value of attribute user_name.
22 23 24 |
# File 'lib/moonwalkair/generator.rb', line 22 def user_name @user_name end |
Instance Method Details
#run ⇒ Object
40 41 42 43 44 |
# File 'lib/moonwalkair/generator.rb', line 40 def run create_files $stdout.puts "" $stdout.puts "*** Place your AIR SDK path in #{target_dir}/config/config.yml *** \t" end |