lib/regexp-examples/groups.rb in regexp-examples-1.3.1 vs lib/regexp-examples/groups.rb in regexp-examples-1.3.2

- old
+ new

@@ -129,11 +129,11 @@ RegexpExamples.permutations_of_strings(strings).map do |result| GroupResult.new(result, group_id) end end - alias_method :random_result, :result + alias random_result result end # A boolean "or" group. # The implementation is to pass in 2 set of (repeaters of) groups. # The simplest example is: /a|b/ @@ -160,11 +160,11 @@ def result_by_method(method) max_results_limiter = MaxResultsLimiterBySum.new repeaters_list .map { |repeaters| RegexpExamples.generic_map_result(repeaters, method) } - .map { |result| max_results_limiter.limit_results(result)} + .map { |result| max_results_limiter.limit_results(result) } .inject(:concat) .map { |result| GroupResult.new(result) } .uniq end @@ -182,10 +182,10 @@ # replaced by the appropriate value. (See BackReferenceReplacer) # The simplest example is /(a) \1/ - So, we temporarily treat the "result" # of /\1/ as being "__1__". It later gets updated. class BackReferenceGroup include RandomResultBySample - PLACEHOLDER_FORMAT = '__%s__' + PLACEHOLDER_FORMAT = '__%s__'.freeze attr_reader :id def initialize(id) @id = id end