Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14103 from sikachu/4-1-stable-fix-versioning-task
Introduce `Rails.gem_version`
- Loading branch information
Showing
19 changed files
with
167 additions
and
54 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActionMailer | |||
# Returns the version of the currently loaded ActionMailer as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActionMailer | module ActionMailer | ||
# Returns the version of the currently loaded ActionMailer as a Gem::Version | # Returns the version of the currently loaded ActionMailer as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActionMailer.version.segments | |||
STRING = ActionMailer.version.to_s | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActionPack | |||
# Returns the version of the currently loaded ActionPack as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActionPack | module ActionPack | ||
# Returns the version of the currently loaded ActionPack as a Gem::Version | # Returns the version of the currently loaded ActionPack as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActionPack.version.segments | |||
STRING = ActionPack.version.to_s | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActionView | |||
# Returns the version of the currently loaded ActionView as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActionView | module ActionView | ||
# Returns the version of the currently loaded ActionView as a Gem::Version | # Returns the version of the currently loaded ActionView as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActionView.version.segments | |||
STRING = ActionView.version.to_s | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActiveModel | |||
# Returns the version of the currently loaded ActiveModel as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActiveModel | module ActiveModel | ||
# Returns the version of the currently loaded ActiveModel as a Gem::Version | # Returns the version of the currently loaded ActiveModel as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActiveModel.version.segments | |||
STRING = ActiveModel.version.to_s | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActiveRecord | |||
# Returns the version of the currently loaded ActiveRecord as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActiveRecord | module ActiveRecord | ||
# Returns the version of the currently loaded ActiveRecord as a Gem::Version | # Returns the version of the currently loaded ActiveRecord as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActiveRecord.version.segments | |||
STRING = ActiveRecord.version.to_s | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module ActiveSupport | |||
# Returns the version of the currently loaded ActiveSupport as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,8 @@ | |||
require_relative 'gem_version' | |||
|
|||
module ActiveSupport | module ActiveSupport | ||
# Returns the version of the currently loaded ActiveSupport as a Gem::Version | # Returns the version of the currently loaded ActiveSupport as a <tt>Gem::Version</tt> | ||
def self.version | def self.version | ||
Gem::Version.new "4.1.0.rc1" | gem_version | ||
end | |||
|
|||
module VERSION #:nodoc: | |||
MAJOR, MINOR, TINY, PRE = ActiveSupport.version.segments | |||
STRING = ActiveSupport.version.to_s | |||
end | end | ||
end | end |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
module Rails | |||
# Returns the version of the currently loaded Rails as a <tt>Gem::Version</tt> | |||
def self.gem_version | |||
Gem::Version.new VERSION::STRING | |||
end | |||
|
|||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | |||
end | |||
end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,10 +1,8 @@ | |||
module Rails | require_relative 'gem_version' | ||
module VERSION | |||
MAJOR = 4 | |||
MINOR = 1 | |||
TINY = 0 | |||
PRE = "rc1" | |||
|
|
||
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") | module Rails | ||
# Returns the version of the currently loaded Rails as a string. | |||
def self.version | |||
VERSION::STRING | |||
end | end | ||
end | end |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
require 'abstract_unit' | |||
|
|||
class VersionTest < ActiveSupport::TestCase | |||
def test_rails_version_returns_a_string | |||
assert Rails.version.is_a? String | |||
end | |||
|
|||
def test_rails_gem_version_returns_a_correct_gem_version_object | |||
assert Rails.gem_version.is_a? Gem::Version | |||
assert_equal Rails.version, Rails.gem_version.to_s | |||
end | |||
end |
This file contains 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