Sha256: 89ce5611f717a61a715d3f6f70e8f303ba539599b79df8f1c11d4e1df056ac45

Contents?: true

Size: 1.24 KB

Versions: 9

Compression:

Stored size: 1.24 KB

Contents

require 'compass/generated_version'
module Compass
  module Version
    def scope(file) # :nodoc:
      File.join(File.dirname(__FILE__), '..', '..', file)
    end

    def parse_version(version, name)
      nil_or_int = lambda{|i| i.nil? ? nil : i.to_i}
      segments = version.split(".")
      {
        :string => version,
        :name => name,
        :major => nil_or_int.call(segments.shift),
        :minor => nil_or_int.call(segments.shift),
        :patch => nil_or_int.call(segments.shift),
        :state => segments.shift,
        :iteration => nil_or_int.call(segments.shift)
      }
    end

    # Returns a hash representing the version.
    # The :major, :minor, and :teeny keys have their respective numbers.
    # The :string key contains a human-readable string representation of the version.
    # The :rev key will have the current revision hash.
    #
    # This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum
    def version
      Compass::VERSION_DETAILS
    end
  end

  extend Compass::Version

  unless defined?(::Compass::VERSION)
    VERSION = File.read(scope("VERSION")).strip 
    VERSION_NAME = File.read(scope("VERSION_NAME")).strip
  end

  VERSION_DETAILS = parse_version(VERSION, VERSION_NAME)

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/compass-1.0.3/lib/compass/version.rb
compass-1.0.3 lib/compass/version.rb
compass-1.1.0.alpha.3 lib/compass/version.rb
compass-1.1.0.alpha.2 lib/compass/version.rb
compass-1.1.0.alpha.1 lib/compass/version.rb
compass-1.1.0.alpha.0 lib/compass/version.rb
compass-1.0.1 lib/compass/version.rb
compass-1.0.0 lib/compass/version.rb
compass-1.0.0.rc.1 lib/compass/version.rb