Parent

Class Index [+]

Quicksearch

RSpec::Core::DrbOptions

@private

Constants

CONDITIONAL_FILTERS

Public Class Methods

new(submitted_options, filter_manager) click to toggle source
   # File lib/rspec/core/drb_options.rb, line 6
6:     def initialize(submitted_options, filter_manager)
7:       @submitted_options = submitted_options
8:       @filter_manager = filter_manager
9:     end

Public Instance Methods

add_failure_exit_code(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 33
33:     def add_failure_exit_code(argv)
34:       if @submitted_options[:failure_exit_code]
35:         argv << "--failure-exit-code" << @submitted_options[:failure_exit_code].to_s
36:       end
37:     end
add_filter(argv, name, hash) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 57
57:     def add_filter(argv, name, hash)
58:       hash.each_pair do |k, v|
59:         next if CONDITIONAL_FILTERS.include?(k)
60:         tag = name == :inclusion ? k.to_s : "~#{k}"
61:         tag << ":#{v}" if v.is_a?(String)
62:         argv << "--tag" << tag
63:       end unless hash.empty?
64:     end
add_formatters(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 66
66:     def add_formatters(argv)
67:       @submitted_options[:formatters].each do |pair|
68:         argv << "--format" << pair[0]
69:         argv << "--out" << pair[1] if pair[1]
70:       end if @submitted_options[:formatters]
71:     end
add_full_description(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 39
39:     def add_full_description(argv)
40:       if @submitted_options[:full_description]
41:         # The argument to --example is regexp-escaped before being stuffed
42:         # into a regexp when received for the first time (see OptionParser).
43:         # Hence, merely grabbing the source of this regexp will retain the
44:         # backslashes, so we must remove them.
45:         argv << "--example" << @submitted_options[:full_description].source.delete('\')
46:       end
47:     end
add_libs(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 73
73:     def add_libs(argv)
74:       @submitted_options[:libs].each do |path|
75:         argv << "-I" << path
76:       end if @submitted_options[:libs]
77:     end
add_line_numbers(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 49
49:     def add_line_numbers(argv)
50:       if @submitted_options[:line_numbers]
51:         argv.push(*@submitted_options[:line_numbers].inject([]){|a,l| a << "--line_number" << l})
52:       end
53:     end
add_requires(argv) click to toggle source
    # File lib/rspec/core/drb_options.rb, line 79
79:     def add_requires(argv)
80:       @submitted_options[:requires].each do |path|
81:         argv << "--require" << path
82:       end if @submitted_options[:requires]
83:     end
options() click to toggle source
    # File lib/rspec/core/drb_options.rb, line 11
11:     def options
12:       argv = []
13:       argv << "--color"        if @submitted_options[:color]
14:       argv << "--profile"      if @submitted_options[:profile_examples]
15:       argv << "--backtrace"    if @submitted_options[:full_backtrace]
16:       argv << "--tty"          if @submitted_options[:tty]
17:       argv << "--fail-fast"    if @submitted_options[:fail_fast]
18:       argv << "--options"      << @submitted_options[:custom_options_file] if @submitted_options[:custom_options_file]
19:       argv << "--order"        << @submitted_options[:order]               if @submitted_options[:order]
20: 
21:       add_failure_exit_code(argv)
22:       add_full_description(argv)
23:       add_line_numbers(argv)
24:       add_filter(argv, :inclusion, @filter_manager.inclusions)
25:       add_filter(argv, :exclusion, @filter_manager.exclusions)
26:       add_formatters(argv)
27:       add_libs(argv)
28:       add_requires(argv)
29: 
30:       argv + @submitted_options[:files_or_directories_to_run]
31:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.