Class: StartProject::Options
- Inherits:
-
Object
- Object
- StartProject::Options
- Defined in:
- lib/start_project/options.rb
Overview
Read the arguments from the command line and parse them out
Instance Attribute Summary collapse
-
#frameworks ⇒ Object
readonly
frameworks stores the framework details loaded from the config.yaml.
-
#project_name ⇒ Object
readonly
project_name stores the name of the folder that the final project will live in.
-
#project_uri ⇒ Object
readonly
project_uri stores the url of the framework.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Options
constructor
Initializes the options object, loads the config.yaml that stores all the frameworks available and sets a default framework: html5 boilerplate.
Constructor Details
#initialize(argv) ⇒ Options
Initializes the options object, loads the config.yaml that stores all the frameworks available and sets a default framework: html5 boilerplate. Finally, it calls the parse method.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/start_project/options.rb', line 25 def initialize(argv) @frameworks = begin YAML.load_file(File.join(File.dirname(__FILE__),'config.yaml')) rescue ArgumentError => e puts "Could not parse YAML #{e.}" end @project_uri = @frameworks[:html5] parse(argv) end |
Instance Attribute Details
#frameworks ⇒ Object (readonly)
frameworks stores the framework details loaded from the config.yaml
19 20 21 |
# File 'lib/start_project/options.rb', line 19 def frameworks @frameworks end |
#project_name ⇒ Object (readonly)
project_name stores the name of the folder that the final project will live in
16 17 18 |
# File 'lib/start_project/options.rb', line 16 def project_name @project_name end |
#project_uri ⇒ Object (readonly)
project_uri stores the url of the framework
13 14 15 |
# File 'lib/start_project/options.rb', line 13 def project_uri @project_uri end |