Sha256: c40bfacd42e0c391ee9cb055bc9963d6985b9cb70ec5743744554c3f31b6efad

Contents?: true

Size: 367 Bytes

Versions: 3

Compression:

Stored size: 367 Bytes

Contents

include ERBh

ERBh.define_method(:i) do |obj|
  if obj.nil? or (obj.respond_to?(:empty?) and 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 || (m.class.new rescue nil)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ridgepole-0.7.3.beta spec/erb_helper.rb
ridgepole-0.7.2 spec/erb_helper.rb
ridgepole-0.7.2.beta spec/erb_helper.rb