Skip to content

Commit

Permalink
config.gem: Fix typo in unpack, skip dependencies on unloaded gems, a…
Browse files Browse the repository at this point in the history
…nd silence spec warnings on refresh. [#1128]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
al2o3cr authored and lifo committed Oct 20, 2008
1 parent fcb45e5 commit 326030a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion railties/lib/rails/gem_dependency.rb
Expand Up @@ -151,7 +151,7 @@ def unpack_to(directory)
end

# Gem.activate changes the spec - get the original
real_spec = Gem::Specification.load(spec.loaded_from)
real_spec = Gem::Specification.load(specification.loaded_from)
write_spec(directory, real_spec)

end
Expand Down
3 changes: 2 additions & 1 deletion railties/lib/tasks/gems.rake
Expand Up @@ -11,7 +11,7 @@ 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)}
gem.dependencies.each { |g| print_gem_status(g, indent+1)} if gem.loaded?
end

namespace :gems do
Expand Down Expand Up @@ -70,6 +70,7 @@ namespace :gems do
task :refresh_specs => :base do
require 'rubygems'
require 'rubygems/gem_runner'
Rails::VendorGemSourceIndex.silence_spec_warnings = true
Rails.configuration.gems.each do |gem|
next unless gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name)
gem.refresh_spec(Rails::GemDependency.unpacked_path) if gem.loaded?
Expand Down

0 comments on commit 326030a

Please sign in to comment.