Created
April 4, 2014 14:10
-
-
Save futhr/9975468 to your computer and use it in GitHub Desktop.
Nice style for Gem version - pick from a rails/rails pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module YourGem | |
# Returns the version of the currently loaded YourGem as a <tt>Gem::Version</tt> | |
def self.version | |
Gem::Version.new VERSION::STRING | |
end | |
module VERSION | |
MAJOR = 1 | |
MINOR = 1 | |
TINY = 0 | |
PRE = 'alpha' | |
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment