diff options
author | Prem Sichanugrist <s@sikac.hu> | 2014-02-18 16:13:23 -0500 |
---|---|---|
committer | Prem Sichanugrist <s@sikac.hu> | 2014-03-05 12:37:38 -0500 |
commit | 2dd2fcf89673afbcf95240ecebaf34826a195164 (patch) | |
tree | 238825fa3198c023afb6545693bfbedff6d917d8 /railties/test/application/initializers/i18n_test.rb | |
parent | 058d3c6183ef6e0e878bea37f4fe3f8f0d6758e2 (diff) | |
download | rails-2dd2fcf89673afbcf95240ecebaf34826a195164.tar.gz rails-2dd2fcf89673afbcf95240ecebaf34826a195164.tar.bz2 rails-2dd2fcf89673afbcf95240ecebaf34826a195164.zip |
Introduce `Rails.gem_version`
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`.
Diffstat (limited to 'railties/test/application/initializers/i18n_test.rb')
0 files changed, 0 insertions, 0 deletions