Sha256: 228730c2df5dc5b894b32b822774c7295d93dc4f0fa5753a0f694c559fda8179

Contents?: true

Size: 867 Bytes

Versions: 1

Compression:

Stored size: 867 Bytes

Contents

INTERPOLATION = {}

INTERPOLATION['one_variable_interpolated_only'] =
  %q(puts "#{bing}"
)

INTERPOLATION['mixed_content_and_expression'] =
  %q(puts "hello: #{bing}"
)

INTERPOLATION['no_string'] =
  %q(puts bing
)

INTERPOLATION['two_variables'] =
  %q(puts "#{bing}#{bar}"
)

INTERPOLATION['two_strings_with_unnecessary_interpolation'] =
  %q(puts "#{foo}" + "#{bar}"
)

INTERPOLATION['multiline_string_with_unnecessary_interpolation'] =
  %q(puts "#{foo +
bar -
baz}"
)

INTERPOLATION['multiline_word_list'] =
  %q(%w{
  foo
  bar
  baz
})

INTERPOLATION['nested_interpolation'] =
  %q(def friendly_time(time)
  if hours < 24
    "#{(hours > 0) ? "#{hours} hour" : '' }#{(hours > 1) ? 's' : ''}" +
      " #{(mins > 0) ? "#{mins} minute" : '' }#{(mins > 1) ? 's' : ''}" +
      " #{seconds} second#{(seconds > 1) ? 's' : ''} ago"
  else
    time.to_s
  end
end)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tailor-1.4.1 spec/support/string_interpolation_cases.rb