Sha256: 516ea5b9e9ecaccd66b784c8abeb9da1d9d3f530ad9d299f43bc3c0d00019dad
Contents?: true
Size: 807 Bytes
Versions: 28
Compression:
Stored size: 807 Bytes
Contents
#!/usr/bin/env ruby require File.expand_path('../../support/documentation_generator', __FILE__) ORDERED_KINDS = %w[Given When Then] heading = 'All Spreewald steps' search_string = ARGV.shift # collect steps_glob = File.expand_path('../../lib/spreewald/*_steps.rb', __FILE__) step_names = `cat #{steps_glob}`.split($/).select { |line| line =~ /^(Given|When|Then)/ } # format step_names.map! do |step| DocumentationGenerator::StepDefinition.try_and_parse(step).format_definition end # sort step_names = step_names.sort_by do |step| step =~ /^(\w+)(.*)/ [ORDERED_KINDS.index($1), $2] end # filter if search_string heading << " containing '#{search_string}'" step_names = step_names.grep Regexp.new(search_string) end # Output puts "\e[4;34m\n# #{heading}\e[0m" # blue underline puts step_names
Version data entries
28 entries across 28 versions & 1 rubygems