diff options
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/framework.rake | 15 | ||||
-rw-r--r-- | railties/lib/tasks/gems.rake | 16 |
2 files changed, 25 insertions, 6 deletions
diff --git a/railties/lib/tasks/framework.rake b/railties/lib/tasks/framework.rake index 7955ded898..71aea09867 100644 --- a/railties/lib/tasks/framework.rake +++ b/railties/lib/tasks/framework.rake @@ -38,14 +38,17 @@ namespace :rails do end end - desc 'Lock to latest Edge Rails' + desc 'Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0' task :edge do require 'open-uri' + version = ENV["RELEASE"] || "edge" + target = "rails_#{version}.zip" + url = "http://dev.rubyonrails.org/archives/#{target}" chdir 'vendor' do - puts 'Downloading Rails' - File.open('rails_edge.zip', 'wb') do |dst| - open 'http://dev.rubyonrails.org/archives/rails_edge.zip' do |src| + puts "Downloading Rails from #{url}" + File.open('rails.zip', 'wb') do |dst| + open url do |src| while chunk = src.read(4096) dst << chunk end @@ -54,8 +57,8 @@ namespace :rails do puts 'Unpacking Rails' rm_rf 'rails' - `unzip rails_edge.zip` - %w(rails_edge.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner| + `unzip rails.zip` + %w(rails.zip rails/Rakefile rails/cleanlogs.sh rails/pushgems.rb rails/release.rb).each do |goner| rm_f goner end end diff --git a/railties/lib/tasks/gems.rake b/railties/lib/tasks/gems.rake index c8d5167be6..c18fea2d60 100644 --- a/railties/lib/tasks/gems.rake +++ b/railties/lib/tasks/gems.rake @@ -39,4 +39,20 @@ namespace :gems do gem.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems')) if gem.loaded? end end + + namespace :unpack do + desc "Unpacks the specified gems and its dependencies into vendor/gems" + task :dependencies => :unpack do + require 'rubygems' + require 'rubygems/gem_runner' + 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')) + end + end + end + end end
\ No newline at end of file |