lib/rubocop/cop/style/special_global_vars.rb in rubocop-0.30.1 vs lib/rubocop/cop/style/special_global_vars.rb in rubocop-0.31.0
- old
+ new
@@ -69,10 +69,10 @@
fail 'Bug in SpecialGlobalVars - global var w/o preferred vars!'
end
end
def autocorrect(node)
- @corrections << lambda do |corrector|
+ lambda do |corrector|
global_var, = *node
parent_type = node.parent ? node.parent.type : nil
if [:dstr, :xstr, :regexp].include?(parent_type)
corrector.replace(node.loc.expression,
"{#{PREFERRED_VARS[global_var].first}}")