RU
Size: a a a
RU
ВА
`RU
`ВА
RU
ML
module Blank
PLACEHOLDER = '_______'
def const_missing(*); self; end
def method_missing(*); self; end
def to_s; PLACEHOLDER; end
end
# => :to_s
class Template
include Blank
extend Blank
def get_binding
binding
end
end
# => :get_binding
erb = '<h1>Договор об оказании услуг</h1>\n\n<p class=\"agreement-date\"><%= I18n.with_locale(:ru) { I18n.l((signed_at || Time.now).to_date, format: :long) } %><br>'
# => "<h1>Договор об оказании услуг</h1>\\n\\n<p class=\\\"agreement-date\\\"><%= I18n.with_locale(:ru) { I18n.l((signed_at || Time.now).to_date, format: :long) } %><br>"
require 'erb'
# => true
ERB.new(erb).result(Template.new.get_binding)
# => "<h1>Договор об оказании услуг</h1>\\n\\n<p class=\\\"agreement-date\\\">_______<br>"
ML
ML
IN
t
e
s
t
RU
а вот если в одну строку, то все ок
IN
IN
IN
проверка, три кавычки в одной строке
IN
IN
RU
МВ
module Blank
PLACEHOLDER = '_______'
def const_missing(*); self; end
def method_missing(*); self; end
def to_s; PLACEHOLDER; end
end
# => :to_s
class Template
include Blank
extend Blank
def get_binding
binding
end
end
# => :get_binding
erb = '<h1>Договор об оказании услуг</h1>\n\n<p class=\"agreement-date\"><%= I18n.with_locale(:ru) { I18n.l((signed_at || Time.now).to_date, format: :long) } %><br>'
# => "<h1>Договор об оказании услуг</h1>\\n\\n<p class=\\\"agreement-date\\\"><%= I18n.with_locale(:ru) { I18n.l((signed_at || Time.now).to_date, format: :long) } %><br>"
require 'erb'
# => true
ERB.new(erb).result(Template.new.get_binding)
# => "<h1>Договор об оказании услуг</h1>\\n\\n<p class=\\\"agreement-date\\\">_______<br>"