Sha256: 237cff79bc53d424e706a35c80a041073fd46ea04bf3bc563c7ca81ee4daf32f

Contents?: true

Size: 812 Bytes

Versions: 83

Compression:

Stored size: 812 Bytes

Contents

require 'rake'

namespace :dad do
  namespace :cucumber do

    task :steps do
      word = ENV['WORD']
      keywords = %w{ 前提 もし ならば かつ しかし 但し ただし }

      steps = []    
      Dir::glob("features/step_definitions/**/*.rb").each do |file|
        File.readlines(file).each_with_index do |line, i|
          keywords.each do |keyword|
            if line.start_with?(keyword)
              steps << {:keyword => keyword, :line_no => i + 1, :line => line.strip, :file => file}
            end
          end
        end
      end
      
      steps.sort{|a, b| a[:line] <=> b[:line]}.each do |step|
        next if word and not step[:line].index(word)

        puts
        puts "#{step[:file]}:#{step[:line_no]}"
        puts step[:line]
      end
      puts
    end

  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
daddy-0.9.9 lib/tasks/cucumber_steps.rake
daddy-0.9.8 lib/tasks/cucumber_steps.rake
daddy-0.9.7 lib/tasks/cucumber_steps.rake
daddy-0.9.6 lib/tasks/cucumber_steps.rake
daddy-0.9.5 lib/tasks/cucumber_steps.rake
daddy-0.9.4 lib/tasks/cucumber_steps.rake
daddy-0.9.3 lib/tasks/cucumber_steps.rake
daddy-0.9.2 lib/tasks/cucumber_steps.rake
daddy-0.9.1 lib/tasks/cucumber_steps.rake
daddy-0.9.0 lib/tasks/cucumber_steps.rake
daddy-0.8.1 lib/tasks/cucumber_steps.rake
daddy-0.8.0 lib/tasks/cucumber_steps.rake
daddy-0.7.9 lib/tasks/cucumber_steps.rake
daddy-0.7.8 lib/tasks/cucumber_steps.rake
daddy-0.7.7 lib/tasks/cucumber_steps.rake
daddy-0.7.6 lib/tasks/cucumber_steps.rake
daddy-0.7.5 lib/tasks/cucumber_steps.rake
daddy-0.7.4 lib/tasks/cucumber_steps.rake
daddy-0.7.3 lib/tasks/cucumber_steps.rake
daddy-0.7.2 lib/tasks/cucumber_steps.rake