Sha256: 754128142b1fe9860c242efe295b279d602b1df6d2c3e1026df18861183ea9d1

Contents?: true

Size: 440 Bytes

Versions: 79

Compression:

Stored size: 440 Bytes

Contents

require 'cucumber/step_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
            start = match.offset(n)[0]
            StepArgument.new(val, start)
          end
        else
          nil
        end
      end
    end
  end
end

Version data entries

79 entries across 79 versions & 11 rubygems

Version Path
aslakhellesoy-cucumber-0.3.102.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
aslakhellesoy-cucumber-0.3.103 lib/cucumber/rb_support/regexp_argument_matcher.rb
aslakhellesoy-cucumber-0.3.104 lib/cucumber/rb_support/regexp_argument_matcher.rb
kosmas58-cucumber-0.3.103 lib/cucumber/rb_support/regexp_argument_matcher.rb
casecumber-1.0.2.1 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.1.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.1.1 lib/cucumber/rb_support/regexp_argument_matcher.rb
js-log-cucumber-1.0.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.1.0 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.6 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.5 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.4 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.3 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.2 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.1 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-1.0.0 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-0.8.7 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-0.8.6 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-0.10.7 lib/cucumber/rb_support/regexp_argument_matcher.rb
cucumber-0.10.6 lib/cucumber/rb_support/regexp_argument_matcher.rb