Q:

String interpolation without #{}

Please observe the following:
"abcd#fg"  # => "abcd#fg"
"abcd#$fg" # => "abcd"    characters #$ and after them are skipped
"abcd#@fg" # => "abcd"    characters #@ and after them are skipped

It could be string interpolation just with # instead of #{}.
$fg = 8
"abcd#$fg" # => "abcd8" 
@fg = 6
"abcd#@fg" # => "abcd6" 

It works like interpolation. Is it a bug or a feature?

A:

You can actually interpolate global, instance, and class variables omitting the braces:
$world = 'world'
puts "hello, #$world"
# hello, world

In your example both $fg and @fg are uninitialized and thus evaluated to nil, that's why they are intorpolated as empty strings. When you write "abcd#fg" nothing is interpolated because the # is not followed by one of {, @, $.
You can find the feature documented in the RubySpec (thanks to @DavidMiani).
If you ask me, don't rely on this behaviour and always interpolate variables using braces, both for readability and to avoid problems such:
@variable = 'foo'
puts "#@variable_bar"

This will output an empty string instead of the, probably, expected string "foo_bar", because it is trying to interpolate the undefined instance variable @variable_bar.

