Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49c87d5
commit deffa66
Showing
4 changed files
with
15 additions
and
46 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 |
---|---|---|
@@ -1,43 +1,18 @@ | ||
class Rails < Thor | ||
VERSIONS = { | ||
:rails => { | ||
"master" => "master", | ||
"3.0.0" => "v3.0.0", | ||
"3.0.1" => "v3.0.1", | ||
"3-0-stable" => "origin/3-0-stable" | ||
}, | ||
:arel => { | ||
"master" => "master", | ||
"3.0.0" => "v1.0.0", | ||
"3.0.1" => "v1.0.0", | ||
"3-0-stable" => "master" | ||
} | ||
} | ||
|
||
desc "checkout VERSION", "checks it out (and arel)" | ||
desc "checkout VERSION", "checks it out" | ||
def checkout(version) | ||
unless VERSIONS[:rails].has_key?(version) | ||
raise "\n#{"*"*50}\nvalid versions are: #{VERSIONS[:rails].keys.join(", ")}\n#{"*"*50}\n" | ||
end | ||
|
||
puts "***** checking out rails at #{VERSIONS[:rails][version]} ..." | ||
puts "***** checking out rails at #{version} ..." | ||
Dir.chdir("vendor/rails") do | ||
`git checkout #{VERSIONS[:rails][version]}` | ||
end | ||
|
||
puts "***** checking out arel at #{VERSIONS[:arel][version]} ..." | ||
Dir.chdir("vendor/arel") do | ||
`git checkout #{VERSIONS[:arel][version]}` | ||
`git checkout #{version}` | ||
`rm Gemfile.lock` if File.exist?('Gemfile.lock') | ||
puts `bundle show` | ||
end | ||
end | ||
|
||
desc "fetch", "update vendor/rails and vendor/arel" | ||
desc "fetch", "update vendor/rails" | ||
def fetch | ||
Dir.chdir("vendor/rails") do | ||
`git fetch` | ||
end | ||
Dir.chdir("vendor/arel") do | ||
`git fetch` | ||
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