public this repo is viewable by everyone
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Don't require rails/gem_builder during rails initialization, it's only 
needed for the gems:build task. [rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9240 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
technoweenie (author)
about 1 month ago
commit  0bea3f8391e985157f3aecdf50a5d61de7aa7f0c
tree    30ebd0004167b45b1713c720b2d0174cf6c7a83d
parent  7e94cf7f4d4c865a84cf835349bdb51c5e71a842
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Don't require rails/gem_builder during rails initialization, it's only needed for the gems:build task. [rick]
0
+
0
 * script/performance/profiler compatibility with the ruby-prof >= 0.5.0. Closes #9176. [Catfish]
0
 
0
 * Flesh out rake gems:unpack to unpack all gems, and add rake gems:build for native extensions. #11513 [ddollar]
...
7
8
9
10
11
12
13
...
7
8
9
 
10
11
12
0
@@ -7,7 +7,6 @@ require 'railties_path'
0
 require 'rails/version'
0
 require 'rails/plugin/locator'
0
 require 'rails/plugin/loader'
0
-require 'rails/gem_builder'
0
 require 'rails/gem_dependency'
0
 
0
 
...
 
1
2
3
...
1
2
3
4
0
@@ -1,3 +1,4 @@
0
+require 'rubygems'
0
 require 'rubygems/installer'
0
 
0
 module Rails
...
14
15
16
17
18
 
19
20
21
...
28
29
30
 
31
32
33
...
47
48
49
 
 
 
 
50
51
52
...
14
15
16
 
 
17
18
19
20
...
27
28
29
30
31
32
33
...
47
48
49
50
51
52
53
54
55
56
0
@@ -14,8 +14,7 @@ module Rails
0
       end
0
       @lib = options[:lib]
0
       @source = options[:source]
0
- @loaded = false
0
- @load_paths_added = false
0
+ @loaded = @frozen = @load_paths_added = false
0
       @unpack_directory = nil
0
     end
0
 
0
@@ -28,6 +27,7 @@ module Rails
0
         gem *args
0
       else
0
         $LOAD_PATH << File.join(unpacked_paths.first, 'lib')
0
+ @frozen = true
0
       end
0
       @load_paths_added = true
0
     rescue Gem::LoadError
0
@@ -47,6 +47,10 @@ module Rails
0
       $!.backtrace.each { |b| puts b }
0
     end
0
 
0
+ def frozen?
0
+ @frozen
0
+ end
0
+
0
     def loaded?
0
       @loaded
0
     end
...
1
2
3
4
 
 
5
 
 
 
6
7
8
9
10
 
11
12
13
...
26
27
28
29
30
 
31
32
33
34
 
35
36
37
...
1
2
3
 
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
31
32
33
 
 
34
35
36
37
 
38
39
40
41
0
@@ -1,13 +1,18 @@
0
 desc "List the gems that this rails application depends on"
0
 task :gems => :environment do
0
   Rails.configuration.gems.each do |gem|
0
- puts "[#{gem.loaded? ? '*' : ' '}] #{gem.name} #{gem.requirement.to_s}"
0
+ code = gem.loaded? ? (gem.frozen? ? "F" : "I") : " "
0
+ puts "[#{code}] #{gem.name} #{gem.requirement.to_s}"
0
   end
0
+ puts
0
+ puts "I = Installed"
0
+ puts "F = Frozen"
0
 end
0
 
0
 namespace :gems do
0
   desc "Build any native extensions for unpacked gems"
0
   task :build do
0
+ require 'rails/gem_builder'
0
     Dir[File.join(RAILS_ROOT, 'vendor', 'gems', '*')].each do |gem_dir|
0
       spec_file = File.join(gem_dir, '.specification')
0
       next unless File.exists?(spec_file)
0
@@ -26,12 +31,11 @@ namespace :gems do
0
   end
0
 
0
   desc "Unpacks the specified gem into vendor/gems."
0
- task :unpack do
0
- Rake::Task["environment"].invoke
0
+ task :unpack => :environment do
0
     require 'rubygems'
0
     require 'rubygems/gem_runner'
0
     Rails.configuration.gems.each do |gem|
0
- next unless ENV['GEM'].blank? || ENV['GEM'] == gem.name
0
+ next unless !gem.frozen? && (ENV['GEM'].blank? || ENV['GEM'] == gem.name)
0
       gem.unpack_to(File.join(RAILS_ROOT, 'vendor', 'gems')) if gem.loaded?
0
     end
0
   end

Comments

    No one has commented yet.