Permalink
Browse files

add some thor tasks to help with development

  • Loading branch information...
1 parent 2c657da commit 5aba0cd9b36ab59bc24363fe7ab2378d4f485449 @dchelimsky dchelimsky committed Oct 5, 2010
Showing with 41 additions and 0 deletions.
  1. +41 −0 Thorfile
View
41 Thorfile
@@ -0,0 +1,41 @@
+class Rails < Thor
+ VERSIONS = {
+ :rails => {
+ "3.0.0" => "v3.0.0",
+ "master" => "master",
+ "3-0-stable" => "origin/3-0-stable"
+ },
+ :arel => {
+ "3.0.0" => "v1.0.0",
+ "master" => "master",
+ "3-0-stable" => "master"
+ }
+ }
+
+ desc "checkout VERSION", "checks it out (and arel)"
+ 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]} ..."
+ 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]}`
+ end
+ end
+
+ desc "fetch", "update vendor/rails and vendor/arel"
+ def fetch
+ Dir.chdir("vendor/rails") do
+ `git fetch`
+ end
+ Dir.chdir("vendor/arel") do
+ `git fetch`
+ end
+ end
+end

0 comments on commit 5aba0cd

Please sign in to comment.