lib/ruby_ext/declarative_cache.rb in ruby-ext-0.2.0 vs lib/ruby_ext/declarative_cache.rb in ruby-ext-0.2.1

- old
+ new

@@ -30,15 +30,15 @@ methods.each do |m| als = (m.to_s =~ /^[_a-zA-Z0-9]+$/) ? m : DeclarativeCache.alias_counter.to_sym klass.class_eval{alias_method :"cached_#{als}", :"#{m}"} unless vnames.is_a? Array - script = single_version_without_args.substitute binding + script = single_version_without_args.interpolate binding @versions[vnames] = 0 unless @versions.include? vnames else vnames_str = vnames.collect{|vname| "'#{vname}' => nil"}.join(', ') - script = multiple_version_without_args.substitute binding + script = multiple_version_without_args.interpolate binding vnames.each{|vname| @versions[vname] = 0 unless @versions.include? vname} end klass.class_eval script, __FILE__, __LINE__ end end @@ -50,14 +50,14 @@ methods.each do |m| als = (m.to_s =~ /^[_a-zA-Z0-9]+$/) ? m : DeclarativeCache.alias_counter klass.class_eval{alias_method :"cached_#{als}", :"#{m}"} unless vnames.is_a? Array - script = single_version_with_args.substitute binding + script = single_version_with_args.interpolate binding @versions[vnames] = 0 unless @versions.include? vnames else vnames_str = vnames.collect{|vname| "'#{vname}' => nil"}.join(', ') - script = multiple_version_with_args.substitute binding + script = multiple_version_with_args.interpolate binding vnames.each{|vname| @versions[vname] = 0 unless @versions.include? vname} end klass.class_eval script, __FILE__, __LINE__ end end \ No newline at end of file