mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
2dd2fcf896
This method return `Gem::Version.new(Rails.version)`, suggesting a more reliable way to perform version comparison. Example: Rails.version #=> "4.1.2" Rails.gem_version #=> #<Gem::Version "4.1.2"> Rails.version > "4.1.10" #=> false Rails.gem_version > Gem::Version.new("4.1.10") #=> true Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true This was originally introduced as `.version` by @charliesome in #8501 but got reverted in #10002 since it was not backward compatible. Also, updating template for `rake update_versions`.
8 lines
187 B
Ruby
8 lines
187 B
Ruby
require_relative 'gem_version'
|
|
|
|
module ActiveSupport
|
|
# Returns the version of the currently loaded ActiveSupport as a <tt>Gem::Version</tt>
|
|
def self.version
|
|
gem_version
|
|
end
|
|
end
|