Object
# File lib/gherkin/tag_expression.rb, line 29
29: def add(tags_with_negation_and_limits)
30: negatives, positives = tags_with_negation_and_limits.partition{|tag| tag =~ /^~/}
31: @ands << (store_and_extract_limits(negatives, true) + store_and_extract_limits(positives, false))
32: end
# File lib/gherkin/tag_expression.rb, line 50
50: def ruby_expression
51: "(" + @ands.map do |ors|
52: ors.map do |tag|
53: if tag =~ /^~(.*)/
54: "!vars['#{$1}']"
55: else
56: "vars['#{tag}']"
57: end
58: end.join("||")
59: end.join(")&&(") + ")"
60: end
# File lib/gherkin/tag_expression.rb, line 34
34: def store_and_extract_limits(tags_with_negation_and_limits, negated)
35: tags_with_negation = []
36: tags_with_negation_and_limits.each do |tag_with_negation_and_limit|
37: tag_with_negation, limit = tag_with_negation_and_limit.split(':')
38: tags_with_negation << tag_with_negation
39: if limit
40: tag_without_negation = negated ? tag_with_negation[1..1] : tag_with_negation
41: if @limits[tag_without_negation] && @limits[tag_without_negation] != limit.to_i
42: raise "Inconsistent tag limits for #{tag_without_negation}: #{@limits[tag_without_negation]} and #{limit.to_i}"
43: end
44: @limits[tag_without_negation] = limit.to_i
45: end
46: end
47: tags_with_negation
48: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.