diff options
author | David Dollar <ddollar@gmail.com> | 2009-04-29 01:22:54 -0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-04-28 23:16:47 -0700 |
commit | 599f2cfb4a0e0ec4135265bf5c56b83f1450beea (patch) | |
tree | 6fc10537aff67cb2b38f431e027a5ddc02fefef2 /railties/lib/tasks/gems.rake | |
parent | acd5db300b755d5abae2748f239441fb865c6b62 (diff) | |
download | rails-599f2cfb4a0e0ec4135265bf5c56b83f1450beea.tar.gz rails-599f2cfb4a0e0ec4135265bf5c56b83f1450beea.tar.bz2 rails-599f2cfb4a0e0ec4135265bf5c56b83f1450beea.zip |
Attempt to deal with more cases of gems with native components.
This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort
the application load if there are any gems that have native components that
have not yet been built.
The rake task gems:build has now only builds 'unbuilt' gems as a result.
The rake task gems:build:force has been added to deal with cases of incomplete
builds, or any case where you need to force the build of all of your gems.
Changes the gems:build task to get its gem list by parsing directory entries
in vendor/gems, which sidesteps the chicken/egg issues involved with having a
gem unpacked into vendor/gems without before its native bits are compiled.
[#2266 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'railties/lib/tasks/gems.rake')
-rw-r--r-- | railties/lib/tasks/gems.rake | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/railties/lib/tasks/gems.rake b/railties/lib/tasks/gems.rake index ed07bf2016..efadb1da3b 100644 --- a/railties/lib/tasks/gems.rake +++ b/railties/lib/tasks/gems.rake @@ -20,8 +20,16 @@ namespace :gems do desc "Build any native extensions for unpacked gems" task :build do $gems_build_rake_task = true - Rake::Task['gems:unpack'].invoke - current_gems.each &:build + frozen_gems.each &:build + end + + namespace :build do + desc "Force the build of all gems" + task :force do + $gems_build_rake_task = true + Rake::Task['gems:unpack'].invoke + current_gems.each { |gem| gem.build(:force => true) } + end end desc "Installs all required gems." @@ -53,6 +61,12 @@ def current_gems gems end +def frozen_gems + Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*-*')].map do |gem_dir| + Rails::GemDependency.from_directory_name(gem_dir) + end +end + def print_gem_status(gem, indent=1) code = case when gem.framework_gem? then 'R' |