Sha256: 3e6e27ab6f2967561e256272fc01d408d4c76ccc934b73d6e1743ffdbdbf767b

Contents?: true

Size: 829 Bytes

Versions: 85

Compression:

Stored size: 829 Bytes

Contents

# coding: UTF-8

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

85 entries across 85 versions & 1 rubygems

Version Path
daddy-0.3.30 lib/tasks/cucumber_steps.rake
daddy-0.3.29 lib/tasks/cucumber_steps.rake
daddy-0.3.28 lib/tasks/cucumber_steps.rake
daddy-0.3.27 lib/tasks/cucumber_steps.rake
daddy-0.3.26 lib/tasks/cucumber_steps.rake
daddy-0.3.25 lib/tasks/cucumber_steps.rake
daddy-0.3.24 lib/tasks/cucumber_steps.rake
daddy-0.3.23 lib/tasks/cucumber_steps.rake
daddy-0.3.22 lib/tasks/cucumber_steps.rake
daddy-0.3.21 lib/tasks/cucumber_steps.rake
daddy-0.3.20 lib/tasks/cucumber_steps.rake
daddy-0.3.19 lib/tasks/cucumber_steps.rake
daddy-0.3.18 lib/tasks/cucumber_steps.rake
daddy-0.3.17 lib/tasks/cucumber_steps.rake
daddy-0.3.16 lib/tasks/cucumber_steps.rake
daddy-0.3.15 lib/tasks/cucumber_steps.rake
daddy-0.3.14 lib/tasks/cucumber_steps.rake
daddy-0.3.13 lib/tasks/cucumber_steps.rake
daddy-0.3.12 lib/tasks/cucumber_steps.rake
daddy-0.3.11 lib/tasks/cucumber_steps.rake