Browse files

Convert VERSION constant to Version class

  • Loading branch information...
1 parent db6b852 commit ba2de8dba7ea90941abfdc25949242caee388ac1 @sferik committed Jun 30, 2012
Showing with 17 additions and 2 deletions.
  1. +16 −1 lib/rails_admin/version.rb
  2. +1 −1 rails_admin.gemspec
View
17 lib/rails_admin/version.rb
@@ -1,3 +1,18 @@
module RailsAdmin
- VERSION = "0.0.4"
+ class Version
+ MAJOR = 0 unless defined? MAJOR
+ MINOR = 0 unless defined? MINOR
+ PATCH = 4 unless defined? PATCH
+ PRE = nil unless defined? PRE
+
+ class << self
+
+ # @return [String]
+ def to_s
+ [MAJOR, MINOR, PATCH, PRE].compact.join('.')
+ end
+
+ end
+
+ end
end
View
2 rails_admin.gemspec
@@ -38,5 +38,5 @@ Gem::Specification.new do |gem|
gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
gem.summary = %q{Admin for Rails}
gem.test_files = Dir['spec/**/*']
- gem.version = RailsAdmin::VERSION
+ gem.version = RailsAdmin::Version
end

0 comments on commit ba2de8d

Please sign in to comment.