# File lib/pickle/parser/matchers.rb, line 82 def capture_key_and_value_in_field "(?:(\\w+): #{capture_value})" end
# File lib/pickle/parser/matchers.rb, line 78 def capture_name_in_label "(?::? \"(#{match_quoted})\")" end
special capture methods
# File lib/pickle/parser/matchers.rb, line 74 def capture_number_in_ordinal '(?:(\d+)(?:st|nd|rd|th))' end
# File lib/pickle/parser/matchers.rb, line 40 def match_factory "(?:#{config.factories.keys.map{|n| n.gsub('_','[_ ]')}.join('|')})" end
# File lib/pickle/parser/matchers.rb, line 28 def match_field "(?:\\w+: #{match_value})" end
# File lib/pickle/parser/matchers.rb, line 32 def match_fields "(?:#{match_field}, )*#{match_field}" end
# File lib/pickle/parser/matchers.rb, line 8 def match_index "(?:first|last|#{match_ordinal})" end
# File lib/pickle/parser/matchers.rb, line 48 def match_indexed_model "(?:(?:#{match_index} )?#{match_factory})" end
# File lib/pickle/parser/matchers.rb, line 20 def match_label "(?::? \"#{match_quoted}\")" end
# File lib/pickle/parser/matchers.rb, line 52 def match_labeled_model "(?:#{match_factory}#{match_label})" end
# File lib/pickle/parser/matchers.rb, line 36 def match_mapping "(?:#{config.mappings.map(&:search).join('|')})" end
# File lib/pickle/parser/matchers.rb, line 56 def match_model "(?:#{match_mapping}|#{match_prefix}?(?:#{match_indexed_model}|#{match_labeled_model}))" end
# File lib/pickle/parser/matchers.rb, line 4 def match_ordinal '(?:\d+(?:st|nd|rd|th))' end
# File lib/pickle/parser/matchers.rb, line 44 def match_plural_factory "(?:#{config.factories.keys.map{|n| n.pluralize.gsub('_','[_ ]')}.join('|')})" end
# File lib/pickle/parser/matchers.rb, line 60 def match_predicate "(?:#{config.predicates.map{|m| m.to_s.sub(/^has_/,'').sub(/\?$/,'').gsub('_','[_ ]')}.join('|')})" end
# File lib/pickle/parser/matchers.rb, line 12 def match_prefix '(?:(?:a|an|another|the|that) )' end
# File lib/pickle/parser/matchers.rb, line 16 def match_quoted '(?:\\"|[^\"]|\.)*' end
# File lib/pickle/parser/matchers.rb, line 24 def match_value "(?:\"#{match_quoted}\"|nil|true|false|[+-]?[0-9_]+(?:\\.\\d+)?)" end