Class: Cukehead::App
- Inherits:
-
Object
- Object
- Cukehead::App
- Defined in:
- lib/cukehead/app.rb
Overview
The Cukehead::App class is responsible for responding to command line arguments and providing the main functionality of the cukehead application.
Instance Attribute Summary collapse
-
#do_overwrite ⇒ Object
Returns the value of attribute do_overwrite.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#feature_reader ⇒ Object
readonly
Returns the value of attribute feature_reader.
-
#features_path ⇒ Object
Returns the value of attribute features_path.
-
#mindmap_filename ⇒ Object
Returns the value of attribute mindmap_filename.
-
#mindmap_template_filename ⇒ Object
Returns the value of attribute mindmap_template_filename.
Instance Method Summary collapse
-
#initialize ⇒ App
constructor
A new instance of App.
-
#run ⇒ Object
Main entry point for executing the cukehead application.
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cukehead/app.rb', line 22 def initialize @command = '' @features_path = File.join(Dir.getwd, 'features') @mindmap_filename = File.join(Dir.getwd, 'mm', 'cukehead-output.mm') @mindmap_template_filename = '' @feature_reader = nil @mindmap_reader = nil @do_overwrite = false @errors = [] end |
Instance Attribute Details
#do_overwrite ⇒ Object
Returns the value of attribute do_overwrite.
18 19 20 |
# File 'lib/cukehead/app.rb', line 18 def do_overwrite @do_overwrite end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
19 20 21 |
# File 'lib/cukehead/app.rb', line 19 def errors @errors end |
#feature_reader ⇒ Object (readonly)
Returns the value of attribute feature_reader.
20 21 22 |
# File 'lib/cukehead/app.rb', line 20 def feature_reader @feature_reader end |
#features_path ⇒ Object
Returns the value of attribute features_path.
15 16 17 |
# File 'lib/cukehead/app.rb', line 15 def features_path @features_path end |
#mindmap_filename ⇒ Object
Returns the value of attribute mindmap_filename.
16 17 18 |
# File 'lib/cukehead/app.rb', line 16 def mindmap_filename @mindmap_filename end |
#mindmap_template_filename ⇒ Object
Returns the value of attribute mindmap_template_filename.
17 18 19 |
# File 'lib/cukehead/app.rb', line 17 def mindmap_template_filename @mindmap_template_filename end |
Instance Method Details
#run ⇒ Object
Main entry point for executing the cukehead application. Responsible for responding to the command line arguments.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/cukehead/app.rb', line 37 def run if @errors.empty? if @command == 'map' read_features write_mindmap show_errors elsif @command == 'cuke' read_mindmap write_features show_errors else show_help end else show_errors end end |