Module: Compass::Version

Included in:
Compass
Defined in:
lib/compass/version.rb

Instance Method Summary collapse

Instance Method Details

#parse_version(version, name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/compass/version.rb', line 8

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

#scope(file) ⇒ Object

:nodoc:



4
5
6
# File 'lib/compass/version.rb', line 4

def scope(file) # :nodoc:
  File.join(File.dirname(__FILE__), '..', '..', file)
end

#versionObject

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



28
29
30
# File 'lib/compass/version.rb', line 28

def version
  Compass::VERSION_DETAILS
end