Sha256: cc0e800d3d476420f76c084b19d5cb8bd9ebd7a5c37ec640744e559ff198cc21

Contents?: true

Size: 502 Bytes

Versions: 16

Compression:

Stored size: 502 Bytes

Contents

module Haml
  module Util
    class << self; include Haml::Util; end

    RUBY_VERSION = ::RUBY_VERSION.split(".").map {|s| s.to_i}

    def ruby1_8?
      Haml::Util::RUBY_VERSION[0] == 1 && Haml::Util::RUBY_VERSION[1] < 9
    end

    def has?(attr, klass, method)
      klass.send("#{attr}s").include?(ruby1_8? ? method.to_s : method.to_sym)
    end

    def each_char(str, &block)
      if ruby1_8?
        str.each_byte(&block)
      else
        str.each_char(&block)
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
radiantcms-couchrest_model-0.2.4 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.2.2 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.2.1 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.2 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.1.9 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.1.8 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.1.7 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.1.6 vendor/plugins/haml/lib/haml/util.rb
radiantcms-couchrest_model-0.1.5 vendor/plugins/haml/lib/haml/util.rb
radiant-0.8.2 vendor/plugins/haml/lib/haml/util.rb
radiant-rc-0.9.0 vendor/plugins/haml/lib/haml/util.rb
radiant-0.8.1 vendor/plugins/haml/lib/haml/util.rb
haml-2.0.10 lib/haml/util.rb
haml-2.0.8 lib/haml/util.rb
haml-2.0.9 lib/haml/util.rb
radiant-0.8.0 vendor/plugins/haml/lib/haml/util.rb