Class: Cukedep::Application
- Inherits:
-
Object
- Object
- Cukedep::Application
- Defined in:
- lib/cukedep/application.rb
Overview
Runner for the Cukedep application.
Instance Attribute Summary collapse
-
#proj_dir ⇒ Object
readonly
Returns the value of attribute proj_dir.
Instance Method Summary collapse
-
#run!(theCmdLineArgs) ⇒ Object
Entry point for the application object.
Instance Attribute Details
#proj_dir ⇒ Object (readonly)
Returns the value of attribute proj_dir.
13 14 15 |
# File 'lib/cukedep/application.rb', line 13 def proj_dir @proj_dir end |
Instance Method Details
#run!(theCmdLineArgs) ⇒ Object
Entry point for the application object.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cukedep/application.rb', line 18 def run!(theCmdLineArgs) = (theCmdLineArgs) create_default_cfg if [:setup] config = Config.load_cfg(Cukedep::YMLFilename) # Complain if no project dir is specified if config.proj_dir.nil? || config.proj_dir.empty? if [:project] @proj_dir = [:project] else msg_p1 = "No project dir specified in '#{Cukedep::YMLFilename}'" msg_p2 = ' nor via --project option.' fail(StandardError, msg_p1 + msg_p2) end else @proj_dir = config.proj_dir end feature_files = parse_features(config.feature_encoding) model = FeatureModel.new(feature_files) generate_files(model, config) return if [:dryrun] rake_cmd = 'rake -f cukedep.rake' system(rake_cmd) end |