diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-10-05 19:46:48 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-10-05 19:46:48 +0100 |
commit | 6090513cfb8acb5554a6653a6f2cb87648585d41 (patch) | |
tree | 99bfd589a48153e33f19ae72baa6e98f5708a9b8 /railties/lib/tasks | |
parent | 01159a6431bbc2dc7d7d95ce294c8567c954f39e (diff) | |
parent | 4df45d86097efbeabceecfe53d8ea2da9ccbb107 (diff) | |
download | rails-6090513cfb8acb5554a6653a6f2cb87648585d41.tar.gz rails-6090513cfb8acb5554a6653a6f2cb87648585d41.tar.bz2 rails-6090513cfb8acb5554a6653a6f2cb87648585d41.zip |
Merge commit 'mainstream/master'
Conflicts:
activerecord/lib/active_record/association_preload.rb
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/databases.rake | 2 | ||||
-rw-r--r-- | railties/lib/tasks/gems.rake | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 1431aa6944..5cb27f1f10 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -341,7 +341,7 @@ namespace :db do case abcs["test"]["adapter"] when "mysql" ActiveRecord::Base.establish_connection(:test) - ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"]) + ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"], abcs["test"]) when "postgresql" ActiveRecord::Base.clear_active_connections! drop_database(abcs['test']) diff --git a/railties/lib/tasks/gems.rake b/railties/lib/tasks/gems.rake index 0321e60e0f..9abdfc56b6 100644 --- a/railties/lib/tasks/gems.rake +++ b/railties/lib/tasks/gems.rake @@ -1,14 +1,19 @@ desc "List the gems that this rails application depends on" task :gems => 'gems:base' do Rails.configuration.gems.each do |gem| - code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " " - puts "[#{code}] #{gem.name} #{gem.requirement.to_s}" + print_gem_status(gem) end puts puts "I = Installed" puts "F = Frozen" end +def print_gem_status(gem, indent=1) + code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " " + puts " "*(indent-1)+" - [#{code}] #{gem.name} #{gem.requirement.to_s}" + gem.dependencies.each { |g| print_gem_status(g, indent+1)} +end + namespace :gems do task :base do $rails_gem_installer = true @@ -19,7 +24,7 @@ namespace :gems do task :build do $rails_gem_installer = true require 'rails/gem_builder' - Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*')].each do |gem_dir| + Dir[File.join(Rails::GemDependency.unpacked_path, '*')].each do |gem_dir| spec_file = File.join(gem_dir, '.specification') next unless File.exists?(spec_file) specification = YAML::load_file(spec_file) @@ -28,7 +33,7 @@ namespace :gems do puts "Built gem: '#{gem_dir}'" end end - + desc "Installs all required gems for this application." task :install => :base do require 'rubygems' @@ -42,10 +47,10 @@ namespace :gems do require 'rubygems/gem_runner' Rails.configuration.gems.each do |gem| next unless !gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name) - gem.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems')) if gem.loaded? + gem.unpack_to(Rails::GemDependency.unpacked_path) if gem.loaded? end end - + namespace :unpack do desc "Unpacks the specified gems and its dependencies into vendor/gems" task :dependencies => :unpack do @@ -54,9 +59,8 @@ namespace :gems do Rails.configuration.gems.each do |gem| next unless ENV['GEM'].blank? || ENV['GEM'] == gem.name gem.dependencies.each do |dependency| - dependency.add_load_paths # double check that we have not already unpacked next if dependency.frozen? - dependency.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems')) + dependency.unpack_to(Rails::GemDependency.unpacked_path) end end end |