lib/yard/code_objects/step_definition.rb in cucumber-in-the-yard-1.5.2 vs lib/yard/code_objects/step_definition.rb in cucumber-in-the-yard-1.5.3
- old
+ new
@@ -10,21 +10,23 @@
def value=(value)
@value = format_source(value)
@constants = {}
@steps = []
+ @compare_value = nil
end
def compare_value
- base_value = value.gsub(/^\/|\/$/,'')
- @constants.each do |name,value|
- base_value.gsub!(/\#\{\s*#{name.to_s}\s*\}/,value.gsub(/^\/|\/$/,''))
+ unless @compare_value
+ @compare_value = value.gsub(/^\/|\/$/,'')
+ @constants.each do |name,value|
+ @compare_value.gsub!(/\#\{\s*#{name.to_s}\s*\}/,value.gsub(/^\/|\/$/,''))
+ end
end
- base_value
+ @compare_value
end
def _value_constants(data=@value)
- #Hash[*data.scan(/\#\{([^\}]+)\}/).flatten.collect {|value| [value.strip,nil]}.flatten]
data.scan(/\#\{([^\}]+)\}/).flatten.collect { |value| value.strip }
end
def constants=(value)
value.each do |val|
\ No newline at end of file