forked from activeadmin/activeadmin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a rake task "bundle:use[3.0.6]" to easily switch rails versions
- Loading branch information
Showing
3 changed files
with
47 additions
and
10 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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Detects the current version of Rails that is being used | ||
# | ||
# You can pass it in as an ENV variable or it will use | ||
# the current Gemfile.lock to find it | ||
def detect_rails_version | ||
return ENV['RAILS'] if ENV['RAILS'] | ||
return nil unless File.exists?("Gemfile.lock") | ||
|
||
File.read("Gemfile.lock").match(/^\W*rails \(([a-z\d.]*)\)/) | ||
return $1 | ||
end |