Skip to content

Commit

Permalink
avoid namespace collision on replace by renaming mapping#replace -> m…
Browse files Browse the repository at this point in the history
…apping#replacement
  • Loading branch information
Nicholas Rutherford committed Aug 28, 2009
1 parent e852fc5 commit a2c5ab1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pickle/config.rb
Expand Up @@ -41,7 +41,7 @@ def map(*args)
options = args.extract_options!
raise ArgumentError, "Usage: map 'search' [, 'search2', ...] :to => 'replace'" unless args.any? && options[:to].is_a?(String)
args.each do |search|
self.mappings << OpenStruct.new(:search => search, :replace => options[:to])
self.mappings << OpenStruct.new(:search => search, :replacement => options[:to])
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/pickle/parser.rb
Expand Up @@ -58,7 +58,7 @@ def parse_index(index)
private
def apply_mappings!(string)
config.mappings.each do |mapping|
string.sub! /^#{mapping.search}$/, mapping.replace
string.sub! /^#{mapping.search}$/, mapping.replacement
end
end
end
Expand Down

0 comments on commit a2c5ab1

Please sign in to comment.