Sha256: 70e6ae1bfb49888ea451a50909fa1f4162c2aff203b5f133cb915749b0b9ff38

Contents?: true

Size: 463 Bytes

Versions: 40

Compression:

Stored size: 463 Bytes

Contents

require 'gherkin/formatter/argument'

module Cucumber
  module RbSupport
    class RegexpArgumentMatcher
      def self.arguments_from(regexp, step_name)
        match = regexp.match(step_name)
        if match
          n = 0
          match.captures.map do |val|
            n += 1
            offset = match.offset(n)[0]
            Gherkin::Formatter::Argument.new(offset, val)
          end
        else
          nil
        end
      end
    end
  end
end

Version data entries

40 entries across 38 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/rb_support/regexp_argument_matcher.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/rb_support/regexp_argument_matcher.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.1 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.3.20 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.rc.5 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.3.19 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.rc.4 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.rc.3 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.rc.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.rc.1 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.3.18 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.beta.5 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.beta.4 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.beta.3 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.3.17 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.beta.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-2.0.0.beta.1 lib/cucumber/rb_support/regexp_argument_matcher.rb