all_files_to_load()
click to toggle source
def all_files_to_load
requires = @options[:require].empty? ? require_dirs : @options[:require]
files = requires.map do |path|
path = path.gsub(%r\\/, '/')
path = path.gsub(%r\/$/, '')
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 =~ %r^http/}
files.sort
end
build_tree_walker(step_mother)
click to toggle source
def build_tree_walker(step_mother)
Ast::TreeWalker.new(step_mother, formatters(step_mother), self)
end
dotcucumber()
click to toggle source
def dotcucumber
@options[:dotcucumber]
end
drb?()
click to toggle source
def drb?
@options[:drb]
end
drb_port()
click to toggle source
def drb_port
@options[:drb_port].to_i if @options[:drb_port]
end
dry_run?()
click to toggle source
def dry_run?
@options[:dry_run]
end
expand?()
click to toggle source
def expand?
@options[:expand]
end
feature_dirs()
click to toggle source
def feature_dirs
paths.map { |f| File.directory?(f) ? f : File.dirname(f) }.uniq
end
feature_files()
click to toggle source
def feature_files
potential_feature_files = paths.map do |path|
path = path.gsub(%r\\/, '/')
path = path.chomp('/')
if File.directory?(path)
Dir["#{path}/**/*.feature"].sort
elsif path[0..0] == '@' and
File.file?(path[1..-1])
IO.read(path[1..-1]).split
else
path
end
end.flatten.uniq
remove_excluded_files_from(potential_feature_files)
potential_feature_files
end
filters()
click to toggle source
def filters
@options.filters
end
guess?()
click to toggle source
def guess?
@options[:guess]
end
log()
click to toggle source
def log
logger = Logger.new(@out_stream)
logger.formatter = LogFormatter.new
logger.level = Logger::INFO
logger.level = Logger::DEBUG if self.verbose?
logger
end
options()
click to toggle source
def options
warn("Deprecated: Configuration#options will be removed from the next release of Cucumber. Please use the configuration object directly instead.")
@options
end
parse!(args)
click to toggle source
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::TagExpression.new(@options[:tag_expressions])
return @args.replace(@options.expanded_args_without_drb) if drb?
set_environment_variables
end
paths()
click to toggle source
def paths
@options[:paths].empty? ? ['features'] : @options[:paths]
end
step_defs_to_load()
click to toggle source
def step_defs_to_load
all_files_to_load.reject {|f| f =~ %r{/support/} }
end
strict?()
click to toggle source
def strict?
@options[:strict]
end
support_to_load()
click to toggle source
def support_to_load
support_files = all_files_to_load.select {|f| f =~ %r{/support/} }
env_files = support_files.select {|f| f =~ %r{/support/env\..*} }
other_files = support_files - env_files
@options[:dry_run] ? other_files : env_files + other_files
end
tag_expression()
click to toggle source
def tag_expression
Gherkin::TagExpression.new(@options[:tag_expressions])
end
verbose?()
click to toggle source
def verbose?
@options[:verbose]
end
wip?()
click to toggle source
def wip?
@options[:wip]
end