Fixed a bug that caused the current revision to not be set from the REVISION file.
This commit is contained in:
parent
be5c0ff673
commit
9f46524bde
@ -3,8 +3,7 @@ module Compass
|
|||||||
# Returns a hash representing the version.
|
# Returns a hash representing the version.
|
||||||
# The :major, :minor, and :teeny keys have their respective numbers.
|
# The :major, :minor, and :teeny keys have their respective numbers.
|
||||||
# The :string key contains a human-readable string representation of the version.
|
# The :string key contains a human-readable string representation of the version.
|
||||||
# If checked out from Git,
|
# The :rev key will have the current revision hash.
|
||||||
# the :rev key will have the revision hash.
|
|
||||||
#
|
#
|
||||||
# This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum
|
# This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum
|
||||||
attr_writer :version
|
attr_writer :version
|
||||||
@ -41,7 +40,7 @@ module Compass
|
|||||||
def revision_from_file
|
def revision_from_file
|
||||||
if File.exists?(scope('REVISION'))
|
if File.exists?(scope('REVISION'))
|
||||||
rev = File.read(scope('REVISION')).strip
|
rev = File.read(scope('REVISION')).strip
|
||||||
rev = nil if rev !~ /[a-f0-9]+/
|
rev if rev =~ /[a-f0-9]+/
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user