Sha256: a870380e18bee96e1a7d6b665a30cc9854991164835f0d23ac8290bbe9425563

Contents?: true

Size: 837 Bytes

Versions: 1

Compression:

Stored size: 837 Bytes

Contents

module Haml
  module Version
    # Returns a hash representing the version of Haml.
    # The :major, :minor, and :teeny keys have their respective numbers.
    # The :string key contains a human-readable string representation of the version.
    # If Haml is checked out from Git,
    # the :rev key will have the revision hash.
    def version
      return @@version if defined?(@@version)

      dir = File.dirname(__FILE__)
      @@version = YAML.load(File.read("#{dir}/../../VERSION.yml"))
      @@version.each do |key, value|
        @@version[key.to_sym] = value
      end
      @@version[:teeny] = @@version.delete(:patch)
      @@version
    end

    # Returns the path of file relative to the Haml root.
    def scope(file) # :nodoc:
      File.expand_path File.join(File.dirname(__FILE__), '..', '..', file)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
honkster-haml-2.1.0 lib/haml/version.rb