Class: RBehave::Runner::Options
- Inherits:
-
Object
- Object
- RBehave::Runner::Options
- Defined in:
- lib/rbehave/runner/options.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
readonly
Returns the value of attribute debug.
-
#dry_run ⇒ Object
readonly
Returns the value of attribute dry_run.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Instance Method Summary collapse
Instance Attribute Details
#debug ⇒ Object (readonly)
Returns the value of attribute debug.
6 7 8 |
# File 'lib/rbehave/runner/options.rb', line 6 def debug @debug end |
#dry_run ⇒ Object (readonly)
Returns the value of attribute dry_run.
6 7 8 |
# File 'lib/rbehave/runner/options.rb', line 6 def dry_run @dry_run end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
6 7 8 |
# File 'lib/rbehave/runner/options.rb', line 6 def format @format end |
Instance Method Details
#parse(args) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rbehave/runner/options.rb', line 8 def parse(args) parser = OptionParser.new do |p| p. = "Usage: ruby your_stories.rb [options]" p.separator "" p.separator "Options:" p.on "-n", "--dry-run", "dry run - no execution" do @dry_run = true end formats = [:simple, :rdoc, :html, :xml] p.on "-f", "--format ", formats, "format (#{formats.join(',')})" do |fmt| @format = fmt.to_sym end p.on '--debug' do @debug = true end end parser.parse(args) self end |