# File lib/cucumber/cli/configuration.rb, line 17 def initialize(out_stream = STDOUT, error_stream = STDERR) @out_stream = out_stream @error_stream = error_stream @options = Options.new(@out_stream, @error_stream, :default_profile => 'default') end
# File lib/cucumber/cli/configuration.rb, line 75 def all_files_to_load requires = @options[:require].empty? ? require_dirs : @options[:require] files = requires.map do |path| path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes. path = path.gsub(/\/$/, '') # Strip trailing slash. File.directory?(path) ? Dir["#{path}/**/*"] : path end.flatten.uniq remove_excluded_files_from(files) files.reject! {|f| !File.file?(f)} files.reject! {|f| File.extname(f) == '.feature' } files.reject! {|f| f =~ /^http/} files.sort end
# File lib/cucumber/cli/configuration.rb, line 63 def build_runner(step_mother, io) Ast::TreeWalker.new(step_mother, formatters(step_mother), @options, io) end
# File lib/cucumber/cli/configuration.rb, line 51 def diff_enabled? @options[:diff_enabled] end
# File lib/cucumber/cli/configuration.rb, line 55 def drb? @options[:drb] end
# File lib/cucumber/cli/configuration.rb, line 59 def drb_port @options[:drb_port].to_i if @options[:drb_port] end
# File lib/cucumber/cli/configuration.rb, line 117 def feature_dirs paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq end
# File lib/cucumber/cli/configuration.rb, line 100 def feature_files potential_feature_files = paths.map do |path| path = path.gsub(/\\/, '/') # In case we're on windows. Globs don't work with backslashes. path = path.chomp('/') if File.directory?(path) Dir["#{path}/**/*.feature"] elsif path[0..0] == '@' and # @listfile.txt File.file?(path[1..-1]) # listfile.txt is a file IO.read(path[1..-1]).split else path end end.flatten.uniq remove_excluded_files_from(potential_feature_files) potential_feature_files.sort end
# File lib/cucumber/cli/configuration.rb, line 67 def formatter_class(format) if(builtin = Options::BUILTIN_FORMATS[format]) constantize(builtin[0]) else constantize(format) end end
# File lib/cucumber/cli/configuration.rb, line 47 def guess? @options[:guess] end
# File lib/cucumber/cli/configuration.rb, line 121 def log logger = Logger.new(@out_stream) logger.formatter = LogFormatter.new logger.level = Logger::INFO logger.level = Logger::DEBUG if self.verbose? logger end
# File lib/cucumber/cli/configuration.rb, line 23 def parse!(args) @args = args @options.parse!(args) arrange_formats raise("You can't use both --strict and --wip") if strict? && wip? @options[:tag_expression] = Gherkin::Parser::TagExpression.new(@options[:tag_expressions]) return @args.replace(@options.expanded_args_without_drb) if drb? set_environment_variables end
# File lib/cucumber/cli/configuration.rb, line 89 def step_defs_to_load all_files_to_load.reject {|f| f =~ %{/support/} } end
# File lib/cucumber/cli/configuration.rb, line 39 def strict? @options[:strict] end
# File lib/cucumber/cli/configuration.rb, line 93 def support_to_load support_files = all_files_to_load.select {|f| f =~ %{/support/} } env_files = support_files.select {|f| f =~ %{/support/env\..*} } other_files = support_files - env_files @options[:dry_run] ? other_files : env_files + other_files end
Generated with the Darkfish Rdoc Generator 2.