Sha256: a30d42a6c61ea8d5d1fee48f0f08e575e3b4ceb599dc32ce1a9957a974aa7f13

Contents?: true

Size: 434 Bytes

Versions: 11

Compression:

Stored size: 434 Bytes

Contents

include ERBh

ERBh.define_method(:i) do |obj|
  if obj.nil? || (obj.respond_to?(:empty?) && obj.empty?)
    @_erbout.sub!(/,\s*\z/, '')
    ''
  elsif obj.is_a?(Hash)
    obj.modern_inspect_without_brace
  else
    obj
  end
end

ERBh.define_method(:cond) do |conds, m, e = nil|
  if condition(*Array(conds))
    m
  else
    e || (begin
            m.class.new
          rescue StandardError
            nil
          end)
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ridgepole-0.8.0.rc1 spec/erb_helper.rb
ridgepole-0.7.7 spec/erb_helper.rb
ridgepole-0.7.6 spec/erb_helper.rb
ridgepole-0.7.5 spec/erb_helper.rb
ridgepole-0.7.5.beta3 spec/erb_helper.rb
ridgepole-0.7.5.beta2 spec/erb_helper.rb
ridgepole-0.7.5.beta spec/erb_helper.rb
ridgepole-0.7.4 spec/erb_helper.rb
ridgepole-0.7.3 spec/erb_helper.rb
ridgepole-0.7.3.beta3 spec/erb_helper.rb
ridgepole-0.7.3.beta2 spec/erb_helper.rb