BeautifyRuby
BeautifyRuby copied to clipboard
Special variable like $` causes mess
class A
def foo
"abc" =~ /\w+/
puts $`
end
def bar
end
end
After BeautifyRuby runs, it turns out to be:
class A
def foo
"abc" =~ /\w+/
puts $`
end
def bar
end #### <---- wrong!
end
A temporary workaround is:
class A
def foo
"abc" =~ /\w+/
puts $` #` <------ workaround!
end
def bar
end
end
Some other special ruby variables, such as $', $, $+, etc, would cause more serious problem than $`. They are not easy to workaround. So we need special treatment for these special variables.