Sha256: 12d1877f21ea6fb7daca3978f43b8ce7e67e8432457337b70fb196bb1d17ba75

Contents?: true

Size: 462 Bytes

Versions: 14

Compression:

Stored size: 462 Bytes

Contents

require 'gherkin/formatter/argument'

module Lucid
  module InterfaceRb
    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

14 entries across 14 versions & 1 rubygems

Version Path
lucid-0.5.1 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.4.1 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.4.0 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.3.3 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.3.0 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.2.1 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.2.0 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.1.1 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.1.0 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.0.9 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.0.8 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.0.7 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.0.6 lib/lucid/interface_rb/regexp_argument_matcher.rb
lucid-0.0.5 lib/lucid/interface_rb/regexp_argument_matcher.rb