Sha256: dd65918e135c867e65e2269a0843fbb9e2cae532acb61aad111ef2d6290a25bd
Contents?: true
Size: 1.85 KB
Versions: 75
Compression:
Stored size: 1.85 KB
Contents
#!/usr/bin/env ruby require File.expand_path('../../support/step_manager', __FILE__) require File.expand_path('../../support/paths_manager', __FILE__) def announce(text) puts "\e[4;34m\n# #{text}\e[0m" # blue underline end case (option = ARGV.shift) when '--selectors', '-s' search = ARGV.join(' ') manager = PathsManager.new('features/support/selectors.rb') heading = 'All selectors from features/support/selectors.rb' heading << " containing '#{search}'" if search announce heading puts manager.paths(search) when '--paths', '-p' search = ARGV.join(' ') manager = PathsManager.new('features/support/paths.rb') heading = 'All paths from features/support/paths.rb' heading << " containing '#{search}'" if search announce heading puts manager.paths(search) when '--help', '-h' puts <<-HELP USAGE: spreewald [SEARCH] List all Spreewald steps + all steps from the current project (run from project root). Optionally filtered by SEARCH. spreewald --paths [SEARCH] List all paths from features/support/paths.rb, optionally filtered by SEARCH Alias -p spreewald --selectors [SEARCH] List all paths from features/support/paths.rb, optionally filtered by SEARCH Alias -s spreewald --version Print Spreewald's version and exit Alias -v spreewald --help Print this help and exit Alias -h HELP when '--version', '-v' require File.expand_path('../../lib/spreewald_support/version', __FILE__) puts "Spreewald #{ Spreewald::VERSION }" else search = [option].concat(ARGV).join(' ') spreewald_steps = File.expand_path('../../lib/spreewald', __FILE__) project_steps = 'features/step_definitions' manager = StepManager.new(spreewald_steps, project_steps) heading = 'All Spreewald steps' heading << " containing '#{search}'" if search announce heading puts manager.steps(search).map(&:to_s) end
Version data entries
75 entries across 75 versions & 1 rubygems