@private
# File lib/rspec/core/configuration_options.rb, line 14 14: def configure(config) 15: formatters = options.delete(:formatters) 16: 17: config.filter_manager = filter_manager 18: 19: order(options.keys, :libs, :requires, :default_path, :pattern).each do |key| 20: force?(key) ? config.force(key => options[key]) : config.send("#{key}=", options[key]) 21: end 22: 23: formatters.each {|pair| config.add_formatter(*pair) } if formatters 24: end
# File lib/rspec/core/configuration_options.rb, line 32 32: def drb_argv 33: DrbOptions.new(options, filter_manager).options 34: end
# File lib/rspec/core/configuration_options.rb, line 65 65: def all_configs 66: @all_configs ||= file_options << command_line_options << env_options 67: end
# File lib/rspec/core/configuration_options.rb, line 97 97: def args_from_options_file(path) 98: return [] unless path && File.exist?(path) 99: config_string = options_file_as_erb_string(path) 100: config_string.split(/\n+/).map {|l| l.shellsplit}.flatten 101: end
# File lib/rspec/core/configuration_options.rb, line 77 77: def command_line_options 78: @command_line_options ||= Parser.parse!(@args).merge :files_or_directories_to_run => @args 79: end
# File lib/rspec/core/configuration_options.rb, line 81 81: def custom_options 82: options_from(custom_options_file) 83: end
# File lib/rspec/core/configuration_options.rb, line 107 107: def custom_options_file 108: command_line_options[:custom_options_file] 109: end
# File lib/rspec/core/configuration_options.rb, line 73 73: def env_options 74: ENV["SPEC_OPTS"] ? Parser.parse!(Shellwords.split(ENV["SPEC_OPTS"])) : {} 75: end
# File lib/rspec/core/configuration_options.rb, line 58 58: def extract_filters_from(*configs) 59: configs.compact.each do |config| 60: filter_manager.include config.delete(:inclusion_filter) if config.has_key?(:inclusion_filter) 61: filter_manager.exclude config.delete(:exclusion_filter) if config.has_key?(:exclusion_filter) 62: end 63: end
# File lib/rspec/core/configuration_options.rb, line 69 69: def file_options 70: custom_options_file ? [custom_options] : [global_options, local_options] 71: end
# File lib/rspec/core/configuration_options.rb, line 47 47: def force?(key) 48: !NON_FORCED_OPTIONS.include?(key) 49: end
# File lib/rspec/core/configuration_options.rb, line 89 89: def global_options 90: @global_options ||= options_from(global_options_file) 91: end
# File lib/rspec/core/configuration_options.rb, line 115 115: def global_options_file 116: begin 117: File.join(File.expand_path("~"), ".rspec") 118: rescue ArgumentError 119: warn "Unable to find ~/.rspec because the HOME environment variable is not set" 120: nil 121: end 122: end
# File lib/rspec/core/configuration_options.rb, line 85 85: def local_options 86: @local_options ||= options_from(local_options_file) 87: end
# File lib/rspec/core/configuration_options.rb, line 111 111: def local_options_file 112: ".rspec" 113: end
# File lib/rspec/core/configuration_options.rb, line 103 103: def options_file_as_erb_string(path) 104: ERB.new(File.read(path)).result(binding) 105: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.