From deffa66381fc979e8182c9f89b9d661ae260106b Mon Sep 17 00:00:00 2001 From: David Chelimsky Date: Sun, 31 Oct 2010 10:49:43 -0200 Subject: [PATCH] dependencies, deschmendencies --- Gemfile | 5 ++--- Rakefile | 7 +++---- Thorfile | 37 ++++++------------------------------- templates/Gemfile | 12 ++++-------- 4 files changed, 15 insertions(+), 46 deletions(-) diff --git a/Gemfile b/Gemfile index 6fccfc4077..5f4c91a6a1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,7 @@ source "http://rubygems.org" -%w[arel rails].each do |lib| - gem lib, :path => File.expand_path("../vendor/#{lib}", __FILE__) -end +gem 'rails', :path => File.expand_path("../vendor/rails", __FILE__) +gem "rack", :git => "git://github.com/rack/rack.git" %w[rspec-rails rspec rspec-core rspec-expectations rspec-mocks].each do |lib| gem lib, :path => File.expand_path("../../#{lib}", __FILE__) diff --git a/Rakefile b/Rakefile index 65539b7457..3e0aa383ee 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,8 @@ -unless File.directory?("vendor/rails") && File.directory?("vendor/arel") +unless File.directory?("vendor/rails") raise <<-MESSAGE -You need to clone the rails and arel git repositories into ./vendor -before you can use any of the rake tasks. +You need to clone the rails git repository into ./vendor before you can use any +of the rake tasks. - git clone git://github.com/rails/arel.git vendor/arel git clone git://github.com/rails/rails.git vendor/rails MESSAGE diff --git a/Thorfile b/Thorfile index 8a805ec1c7..b742f4e705 100644 --- a/Thorfile +++ b/Thorfile @@ -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 diff --git a/templates/Gemfile b/templates/Gemfile index 13283b6103..06360c33c4 100644 --- a/templates/Gemfile +++ b/templates/Gemfile @@ -1,16 +1,12 @@ source 'http://rubygems.org' -gem 'arel', :path => "../../vendor/arel" -gem 'rails', :path => "../../vendor/rails" - +gem 'rails', :path => File.expand_path("../../../vendor/rails", __FILE__) gem 'sqlite3-ruby', :require => 'sqlite3' group :development, :test do - gem "rspec-rails", :path => "../../../rspec-rails" - gem "rspec", :path => "../../../rspec" - gem "rspec-core", :path => "../../../rspec-core" - gem "rspec-expectations", :path => "../../../rspec-expectations" - gem "rspec-mocks", :path => "../../../rspec-mocks" + %w[rspec rspec-core rspec-expectations rspec-mocks rspec-rails].each do |lib| + gem lib, :path => File.expand_path("../../../../#{lib}", __FILE__) + end gem "rcov" gem "webrat" gem "autotest"