rubygems-update 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a527f730a84236ed8285db2158a9d417cf8470
4
- data.tar.gz: 0934b7ef36edb25fcbf7221f514a52ffd6da8ce4
3
+ metadata.gz: 5e3ed90822286092f8c037656b97f1b4ed222380
4
+ data.tar.gz: c4d5567bdb949f2a8faa021ddaef8e39b25238c5
5
5
  SHA512:
6
- metadata.gz: f402bb9f16d92df351fa90f007d5342fd66d3005af8fd2649e58425f7ed78276ec09961e155a7228885b934bbf08755ba37ef99531a18d315afc0222aeda0318
7
- data.tar.gz: ab7e72b833638746273219032aa3f088f0d6c203faf8448a5613a5ec6b5ccb7954e8bb6b5854fb2b3c4f9f1bc49bfc46480453a6d3033434be77936b3cde3757
6
+ metadata.gz: 46210a272d8b29be4bd5110d8ba01bf6fbf6d22ef90e66e6aa672d13fbfe465ec65b8a2b03d66a86808f0900e76372a9a84190d26f1b387b15ce54e478b6c9c7
7
+ data.tar.gz: 65ca08d935214dd203915cf73a5893a67ecdc3e00c18d1621942f57ca68202b294f42648e6c72dc588752e907fe94712c4f8bf30c7082f3fe5a659918c5b1e12
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,16 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 2.1.2 / 2013-09-11
4
+
5
+ Bug fixes:
6
+
7
+ * Restore concurrent requires following the fix for ruby bug #8374. Pull
8
+ request #637 and issue #640 by Charles Nutter.
9
+ * Gems with extensions are now installed correctly when the --install-dir
10
+ option is used. Issue #642 by Lin Jen-Shin.
11
+ * Gem fetch now fetches the newest (not oldest) gem when --version is given.
12
+ Issue #643 by Brian Shirai.
13
+
3
14
  === 2.1.1 / 2013-09-10
4
15
 
5
16
  Bug fixes:
data/Rakefile CHANGED
@@ -106,7 +106,7 @@ task :test => :clean_env
106
106
 
107
107
  task :prerelease => [:clobber, :check_manifest, :test]
108
108
 
109
- task :postrelease => %w[upload publish_docs]
109
+ task :postrelease => %w[upload guides:publish blog:publish publish_docs]
110
110
 
111
111
  pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
112
112
  task :package do
@@ -126,6 +126,182 @@ end
126
126
  desc "Upload release to rubyforge and gemcutter"
127
127
  task :upload => %w[upload_to_gemcutter]
128
128
 
129
+ directory '../guides.rubygems.org' do
130
+ sh 'git', 'clone',
131
+ 'git@github.com:rubygems/guides.git',
132
+ '../guides.rubygems.org'
133
+ end
134
+
135
+ namespace 'guides' do
136
+ task 'pull' => %w[../guides.rubygems.org] do
137
+ chdir '../guides.rubygems.org' do
138
+ sh 'git', 'pull'
139
+ end
140
+ end
141
+
142
+ task 'update' => %w[../guides.rubygems.org] do
143
+ lib_dir = File.join Dir.pwd, 'lib'
144
+
145
+ chdir '../guides.rubygems.org' do
146
+ ruby '-I', lib_dir, '-S', 'rake', 'command_guide'
147
+ ruby '-I', lib_dir, '-S', 'rake', 'rdoc_spec'
148
+ end
149
+ end
150
+
151
+ task 'commit' => %w[../guides.rubygems.org] do
152
+ chdir '../guides.rubygems.org' do
153
+ begin
154
+ sh 'git', 'diff', '--quiet'
155
+ rescue
156
+ sh 'git', 'commit', 'command-reference.md', 'specification-reference.md',
157
+ '-m', "Rebuild for RubyGems #{hoe.version}"
158
+ end
159
+ end
160
+ end
161
+
162
+ task 'push' => %w[../guides.rubygems.org] do
163
+ chdir '../guides.rubygems.org' do
164
+ sh 'git', 'push'
165
+ end
166
+ end
167
+
168
+ desc 'Updates and publishes the guides for the just-released RubyGems'
169
+ task 'publish' => %w[
170
+ guides:pull
171
+ guides:update
172
+ guides:commit
173
+ guides:push
174
+ ]
175
+ end
176
+
177
+ directory '../blog.rubygems.org' do
178
+ sh 'git', 'clone',
179
+ 'git@github.com:rubygems/rubygems.github.com.git',
180
+ '../blog.rubygems.org'
181
+ end
182
+
183
+ namespace 'blog' do
184
+ date = Time.now.strftime '%Y-%m-%d'
185
+ post_page = "_posts/#{date}-#{hoe.version}-released.md"
186
+
187
+ task 'pull' => %w[../blog.rubygems.org] do
188
+ chdir '../blog.rubygems.org' do
189
+ sh 'git', 'pull'
190
+ end
191
+ end
192
+
193
+ path = File.join '../blog.rubygems.org', post_page
194
+
195
+ task 'update' => [path]
196
+
197
+ file path do
198
+ name = `git config --get user.name`.strip
199
+ email = `git config --get user.email`.strip
200
+
201
+ history = File.read 'History.txt'
202
+
203
+ history.force_encoding Encoding::UTF_8 if Object.const_defined? :Encoding
204
+
205
+ _, change_log, = history.split %r%^===\s*\d.*%, 3
206
+
207
+ change_types = []
208
+
209
+ lines = change_log.strip.lines
210
+ change_log = []
211
+
212
+ while line = lines.shift do
213
+ case line
214
+ when /(^[A-Z].*)/ then
215
+ change_types << $1
216
+ change_log << "_#{$1}_\n"
217
+ when /^\*/ then
218
+ entry = [line.strip]
219
+
220
+ while /^ \S/ =~ lines.first do
221
+ entry << lines.shift.strip
222
+ end
223
+
224
+ change_log << "#{entry.join ' '}\n"
225
+ else
226
+ change_log << line
227
+ end
228
+ end
229
+
230
+ change_log = change_log.join
231
+
232
+ change_types = change_types.map do |change_type|
233
+ change_type.downcase.tr '^a-z ', ''
234
+ end
235
+
236
+ last_change_type = change_types.pop
237
+
238
+ if change_types.empty? then
239
+ change_types = ''
240
+ else
241
+ change_types = change_types.join(', ') << ' and '
242
+ end
243
+
244
+ change_types << last_change_type
245
+
246
+ require 'tempfile'
247
+
248
+ Tempfile.open 'blog_post' do |io|
249
+ io.write <<-ANNOUNCEMENT
250
+ ---
251
+ title: #{hoe.version} Released
252
+ layout: post
253
+ author: #{name}
254
+ author_email: #{email}
255
+ ---
256
+
257
+ RubyGems #{hoe.version} includes #{change_types}.
258
+
259
+ To update to the latest RubyGems you can run:
260
+
261
+ gem update --system
262
+
263
+ If you need to upgrade or downgrade please follow the [how to upgrade/downgrade
264
+ RubyGems][upgrading] instructions. To install RubyGems by hand see the
265
+ [Download RubyGems][download] page.
266
+
267
+ #{change_log}
268
+
269
+ [download]: http://rubygems.org/pages/download
270
+ [upgrading]: http://rubygems.rubyforge.org/rubygems-update/UPGRADING_rdoc.html
271
+
272
+ ANNOUNCEMENT
273
+
274
+ io.flush
275
+
276
+ sh ENV['EDITOR'], io.path
277
+
278
+ FileUtils.cp io.path, path
279
+ end
280
+ end
281
+
282
+ task 'commit' => %w[../blog.rubygems.org] do
283
+ chdir '../blog.rubygems.org' do
284
+ sh 'git', 'add', post_page
285
+ sh 'git', 'commit', post_page,
286
+ '-m', "Added #{hoe.version} release announcement"
287
+ end
288
+ end
289
+
290
+ task 'push' => %w[../blog.rubygems.org] do
291
+ chdir '../blog.rubygems.org' do
292
+ sh 'git', 'push'
293
+ end
294
+ end
295
+
296
+ desc 'Updates and publishes the blog for the just-released RubyGems'
297
+ task 'publish' => %w[
298
+ blog:pull
299
+ blog:update
300
+ blog:commit
301
+ blog:push
302
+ ]
303
+ end
304
+
129
305
  # Misc Tasks ---------------------------------------------------------
130
306
 
131
307
  # These tasks expect to have the following directory structure:
@@ -8,7 +8,7 @@
8
8
  require 'rbconfig'
9
9
 
10
10
  module Gem
11
- VERSION = '2.1.1'
11
+ VERSION = '2.1.2'
12
12
  end
13
13
 
14
14
  # Must be first since it unloads the prelude from 1.9.2
@@ -52,13 +52,15 @@ then repackaging it.
52
52
  dep = Gem::Dependency.new gem_name, version
53
53
  dep.prerelease = options[:prerelease]
54
54
 
55
- specs_and_sources, errors = Gem::SpecFetcher.fetcher.spec_for_dependency dep
55
+ specs_and_sources, errors =
56
+ Gem::SpecFetcher.fetcher.spec_for_dependency dep
57
+
56
58
  if platform then
57
59
  filtered = specs_and_sources.select { |s,| s.platform == platform }
58
60
  specs_and_sources = filtered unless filtered.empty?
59
61
  end
60
62
 
61
- spec, source = specs_and_sources.sort_by { |s,| s.version }.first
63
+ spec, source = specs_and_sources.max_by { |s,| s.version }
62
64
 
63
65
  if spec.nil? then
64
66
  show_lookup_failure gem_name, version, errors, options[:domain]
@@ -48,7 +48,12 @@ module Kernel
48
48
  # normal require handle loading a gem from the rescue below.
49
49
 
50
50
  if Gem::Specification.unresolved_deps.empty? then
51
- return gem_original_require(path)
51
+ begin
52
+ RUBYGEMS_ACTIVATION_MONITOR.exit
53
+ return gem_original_require(path)
54
+ ensure
55
+ RUBYGEMS_ACTIVATION_MONITOR.enter
56
+ end
52
57
  end
53
58
 
54
59
  # If +path+ is for a gem that has already been loaded, don't
@@ -61,7 +66,12 @@ module Kernel
61
66
  s.activated? and s.contains_requirable_file? path
62
67
  }
63
68
 
64
- return gem_original_require(path) if spec
69
+ begin
70
+ RUBYGEMS_ACTIVATION_MONITOR.exit
71
+ return gem_original_require(path)
72
+ ensure
73
+ RUBYGEMS_ACTIVATION_MONITOR.enter
74
+ end if spec
65
75
 
66
76
  # Attempt to find +path+ in any unresolved gems...
67
77
 
@@ -109,11 +119,21 @@ module Kernel
109
119
  valid.activate
110
120
  end
111
121
 
112
- gem_original_require path
122
+ begin
123
+ RUBYGEMS_ACTIVATION_MONITOR.exit
124
+ return gem_original_require(path)
125
+ ensure
126
+ RUBYGEMS_ACTIVATION_MONITOR.enter
127
+ end
113
128
  rescue LoadError => load_error
114
129
  if load_error.message.start_with?("Could not find") or
115
130
  (load_error.message.end_with?(path) and Gem.try_activate(path)) then
116
- return gem_original_require(path)
131
+ begin
132
+ RUBYGEMS_ACTIVATION_MONITOR.exit
133
+ return gem_original_require(path)
134
+ ensure
135
+ RUBYGEMS_ACTIVATION_MONITOR.enter
136
+ end
117
137
  end
118
138
 
119
139
  raise load_error
@@ -213,6 +213,8 @@ class Gem::Installer
213
213
 
214
214
  FileUtils.mkdir_p gem_dir
215
215
 
216
+ spec.loaded_from = spec_file
217
+
216
218
  if @options[:install_as_default]
217
219
  extract_bin
218
220
  write_default_spec
@@ -230,8 +232,6 @@ class Gem::Installer
230
232
 
231
233
  say spec.post_install_message unless spec.post_install_message.nil?
232
234
 
233
- spec.loaded_from = spec_file
234
-
235
235
  Gem::Specification.add_spec spec unless Gem::Specification.include? spec
236
236
 
237
237
  run_post_install_hooks
@@ -34,6 +34,32 @@ class TestGemCommandsFetchCommand < Gem::TestCase
34
34
  'gem repository directories must not be created'
35
35
  end
36
36
 
37
+ def test_execute_latest
38
+ util_setup_fake_fetcher
39
+ util_setup_spec_fetcher @a1, @a2
40
+
41
+ @fetcher.data["#{@gem_repo}gems/#{@a1.file_name}"] =
42
+ File.read(@a1.cache_file)
43
+ @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] =
44
+ File.read(@a2.cache_file)
45
+
46
+ refute_path_exists File.join(@tempdir, 'cache'), 'sanity check'
47
+
48
+ @cmd.options[:args] = [@a2.name]
49
+ @cmd.options[:version] = req('>= 0.1')
50
+
51
+ use_ui @ui do
52
+ Dir.chdir @tempdir do
53
+ @cmd.execute
54
+ end
55
+ end
56
+
57
+ assert_path_exists(File.join(@tempdir, @a2.file_name),
58
+ "#{@a2.full_name} not fetched")
59
+ refute_path_exists File.join(@tempdir, 'cache'),
60
+ 'gem repository directories must not be created'
61
+ end
62
+
37
63
  def test_execute_prerelease
38
64
  util_setup_fake_fetcher true
39
65
  util_clear_gems
@@ -53,8 +79,8 @@ class TestGemCommandsFetchCommand < Gem::TestCase
53
79
  end
54
80
  end
55
81
 
56
- assert_path_exists(File.join(@tempdir, @a2_pre.file_name),
57
- "#{@a2_pre.full_name} not fetched")
82
+ assert_path_exists(File.join(@tempdir, @a2.file_name),
83
+ "#{@a2.full_name} not fetched")
58
84
  end
59
85
 
60
86
  def test_execute_specific_prerelease
@@ -73,7 +73,7 @@ load Gem.bin_path('a', 'executable', version)
73
73
  @installer.generate_bin
74
74
 
75
75
  installed_exec = File.join util_inst_bindir, 'executable'
76
- assert File.exist? installed_exec
76
+ assert_path_exists installed_exec
77
77
 
78
78
  wrapper = File.read installed_exec
79
79
  assert_match %r|generated by RubyGems|, wrapper
@@ -136,7 +136,7 @@ gem 'other', version
136
136
  @installer.generate_bin # should not raise
137
137
 
138
138
  installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
139
- assert File.exist? installed_exec
139
+ assert_path_exists installed_exec
140
140
 
141
141
  wrapper = File.read installed_exec
142
142
  assert_match %r|generated by RubyGems|, wrapper
@@ -165,7 +165,7 @@ gem 'other', version
165
165
  @installer.generate_bin
166
166
 
167
167
  installed_exec = File.join util_inst_bindir, 'executable'
168
- assert File.exist? installed_exec
168
+ assert_path_exists installed_exec
169
169
 
170
170
  wrapper = File.read installed_exec
171
171
  assert_match %r|generated by RubyGems|, wrapper
@@ -178,7 +178,7 @@ gem 'other', version
178
178
  @installer.generate_bin
179
179
 
180
180
  installed_exec = File.join util_inst_bindir, 'executable'
181
- assert File.exist? installed_exec
181
+ assert_path_exists installed_exec
182
182
 
183
183
  wrapper = File.read installed_exec
184
184
  assert_match %r|generated by RubyGems|, wrapper
@@ -252,7 +252,7 @@ gem 'other', version
252
252
 
253
253
  assert_equal true, File.directory?(util_inst_bindir)
254
254
  installed_exec = File.join(util_inst_bindir, 'executable')
255
- assert_equal true, File.exist?(installed_exec)
255
+ assert_path_exists installed_exec
256
256
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
257
257
 
258
258
  wrapper = File.read installed_exec
@@ -287,7 +287,7 @@ gem 'other', version
287
287
  @installer.generate_bin
288
288
  assert File.directory? util_inst_bindir
289
289
  installed_exec = File.join util_inst_bindir, 'executable'
290
- assert File.exist? installed_exec
290
+ assert_path_exists installed_exec
291
291
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
292
292
 
293
293
  wrapper = File.read installed_exec
@@ -304,7 +304,7 @@ gem 'other', version
304
304
  @installer.generate_bin
305
305
  assert_equal true, File.directory?(util_inst_bindir)
306
306
  installed_exec = File.join util_inst_bindir, 'foo-executable-bar'
307
- assert_equal true, File.exist?(installed_exec)
307
+ assert_path_exists installed_exec
308
308
  ensure
309
309
  Gem::Installer.exec_format = nil
310
310
  end
@@ -318,7 +318,7 @@ gem 'other', version
318
318
  @installer.generate_bin
319
319
  assert_equal true, File.directory?(util_inst_bindir)
320
320
  installed_exec = File.join util_inst_bindir, 'executable'
321
- assert_equal true, File.exist?(installed_exec)
321
+ assert_path_exists installed_exec
322
322
  ensure
323
323
  Gem::Installer.exec_format = nil
324
324
  end
@@ -340,7 +340,7 @@ gem 'other', version
340
340
  @installer.generate_bin
341
341
 
342
342
  installed_exec = File.join("#{@gemhome}2", "bin", 'executable')
343
- assert File.exist? installed_exec
343
+ assert_path_exists installed_exec
344
344
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
345
345
 
346
346
  wrapper = File.read installed_exec
@@ -353,7 +353,7 @@ gem 'other', version
353
353
  @installer.wrappers = true
354
354
  @installer.generate_bin
355
355
 
356
- refute File.exist?(util_inst_bindir), 'bin dir was created when not needed'
356
+ refute_path_exists util_inst_bindir, 'bin dir was created when not needed'
357
357
  end
358
358
 
359
359
  def test_generate_bin_script_no_perms
@@ -389,7 +389,7 @@ gem 'other', version
389
389
  @installer.generate_bin
390
390
 
391
391
  installed_exec = File.join @gemhome, 'bin', 'executable'
392
- assert_equal true, File.exist?(installed_exec)
392
+ assert_path_exists installed_exec
393
393
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
394
394
 
395
395
  wrapper = File.read installed_exec
@@ -414,7 +414,7 @@ gem 'other', version
414
414
 
415
415
  @installer.generate_bin
416
416
  assert_equal true, File.directory?(util_inst_bindir)
417
- assert_equal true, File.exist?(installed_exec)
417
+ assert_path_exists installed_exec
418
418
  assert_equal mask, File.stat(installed_exec).mode unless win_platform?
419
419
 
420
420
  assert_match %r|generated by RubyGems|, File.read(installed_exec)
@@ -444,7 +444,7 @@ gem 'other', version
444
444
  @installer.wrappers = false
445
445
  @installer.generate_bin
446
446
 
447
- refute File.exist?(util_inst_bindir)
447
+ refute_path_exists util_inst_bindir
448
448
  end
449
449
 
450
450
  def test_generate_bin_symlink_no_perms
@@ -543,7 +543,7 @@ gem 'other', version
543
543
  @installer.generate_bin
544
544
 
545
545
  installed_exec = File.join util_inst_bindir, 'executable'
546
- assert File.exist? installed_exec
546
+ assert_path_exists installed_exec
547
547
 
548
548
  @spec = Gem::Specification.new do |s|
549
549
  s.files = ['lib/code.rb']
@@ -580,7 +580,7 @@ gem 'other', version
580
580
 
581
581
  assert_equal true, File.directory?(util_inst_bindir)
582
582
  installed_exec = File.join(util_inst_bindir, 'executable')
583
- assert_equal true, File.exist?(installed_exec)
583
+ assert_path_exists installed_exec
584
584
 
585
585
  assert_match(/Unable to use symlinks on Windows, installing wrapper/i,
586
586
  @ui.error)
@@ -647,19 +647,19 @@ gem 'other', version
647
647
  rakefile = File.join gemdir, 'ext', 'a', 'Rakefile'
648
648
 
649
649
  Gem.pre_install do |installer|
650
- refute File.exist?(cache_file), 'cache file must not exist yet'
650
+ refute_path_exists cache_file, 'cache file must not exist yet'
651
651
  true
652
652
  end
653
653
 
654
654
  Gem.post_build do |installer|
655
- assert File.exist?(gemdir), 'gem install dir must exist'
656
- assert File.exist?(rakefile), 'gem executable must exist'
657
- refute File.exist?(stub_exe), 'gem executable must not exist'
655
+ assert_path_exists gemdir, 'gem install dir must exist'
656
+ assert_path_exists rakefile, 'gem executable must exist'
657
+ refute_path_exists stub_exe, 'gem executable must not exist'
658
658
  true
659
659
  end
660
660
 
661
661
  Gem.post_install do |installer|
662
- assert File.exist?(cache_file), 'cache file must exist'
662
+ assert_path_exists cache_file, 'cache file must exist'
663
663
  end
664
664
 
665
665
  @newspec = nil
@@ -670,23 +670,23 @@ gem 'other', version
670
670
  end
671
671
 
672
672
  assert_equal @spec, @newspec
673
- assert File.exist? gemdir
674
- assert File.exist?(stub_exe), 'gem executable must exist'
673
+ assert_path_exists gemdir
674
+ assert_path_exists stub_exe, 'gem executable must exist'
675
675
 
676
676
  exe = File.join gemdir, 'bin', 'executable'
677
- assert File.exist? exe
677
+ assert_path_exists exe
678
678
 
679
679
  exe_mode = File.stat(exe).mode & 0111
680
680
  assert_equal 0111, exe_mode, "0%o" % exe_mode unless win_platform?
681
681
 
682
- assert File.exist?(File.join(gemdir, 'lib', 'code.rb'))
682
+ assert_path_exists File.join gemdir, 'lib', 'code.rb'
683
683
 
684
- assert File.exist? rakefile
684
+ assert_path_exists rakefile
685
685
 
686
686
  spec_file = File.join(@gemhome, 'specifications', @spec.spec_name)
687
687
 
688
688
  assert_equal spec_file, @newspec.loaded_from
689
- assert File.exist?(spec_file)
689
+ assert_path_exists spec_file
690
690
 
691
691
  assert_same @installer, @post_build_hook_arg
692
692
  assert_same @installer, @post_install_hook_arg
@@ -795,7 +795,7 @@ gem 'other', version
795
795
  end
796
796
 
797
797
  gemdir = File.join(@gemhome, 'gems', @spec.full_name)
798
- assert File.exist?(File.join(gemdir, 'lib', 'code.rb'))
798
+ assert_path_exists File.join gemdir, 'lib', 'code.rb'
799
799
 
800
800
  util_setup_gem
801
801
  # Morph spec to have lib/other.rb instead of code.rb and recreate
@@ -814,9 +814,9 @@ gem 'other', version
814
814
  end
815
815
  end
816
816
 
817
- assert File.exist?(File.join(gemdir, 'lib', 'other.rb'))
818
- refute(File.exist?(File.join(gemdir, 'lib', 'code.rb')),
819
- "code.rb from prior install of same gem shouldn't remain here")
817
+ assert_path_exists File.join gemdir, 'lib', 'other.rb'
818
+ refute_path_exists File.join gemdir, 'lib', 'code.rb',
819
+ "code.rb from prior install of same gem shouldn't remain here"
820
820
  end
821
821
 
822
822
  def test_install_force
@@ -826,7 +826,7 @@ gem 'other', version
826
826
  end
827
827
 
828
828
  gem_dir = File.join(@gemhome, 'gems', 'old_ruby_required-1')
829
- assert File.exist?(gem_dir)
829
+ assert_path_exists gem_dir
830
830
  end
831
831
 
832
832
  def test_install_missing_dirs
@@ -842,8 +842,8 @@ gem 'other', version
842
842
  File.directory? File.join(Gem.dir, 'docs')
843
843
  File.directory? File.join(Gem.dir, 'specifications')
844
844
 
845
- assert File.exist?(File.join(@gemhome, 'cache', @spec.file_name))
846
- assert File.exist?(File.join(@gemhome, 'specifications', @spec.spec_name))
845
+ assert_path_exists File.join @gemhome, 'cache', @spec.file_name
846
+ assert_path_exists File.join @gemhome, 'specifications', @spec.spec_name
847
847
  end
848
848
 
849
849
  def test_install_post_build_false
@@ -864,10 +864,10 @@ gem 'other', version
864
864
  end
865
865
 
866
866
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
867
- refute File.exist? spec_file
867
+ refute_path_exists spec_file
868
868
 
869
869
  gem_dir = File.join @gemhome, 'gems', @spec.full_name
870
- refute File.exist? gem_dir
870
+ refute_path_exists gem_dir
871
871
  end
872
872
 
873
873
  def test_install_post_build_nil
@@ -882,10 +882,10 @@ gem 'other', version
882
882
  end
883
883
 
884
884
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
885
- assert File.exist? spec_file
885
+ assert_path_exists spec_file
886
886
 
887
887
  gem_dir = File.join @gemhome, 'gems', @spec.full_name
888
- assert File.exist? gem_dir
888
+ assert_path_exists gem_dir
889
889
  end
890
890
 
891
891
  def test_install_pre_install_false
@@ -906,7 +906,7 @@ gem 'other', version
906
906
  end
907
907
 
908
908
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
909
- refute File.exist? spec_file
909
+ refute_path_exists spec_file
910
910
  end
911
911
 
912
912
  def test_install_pre_install_nil
@@ -921,7 +921,7 @@ gem 'other', version
921
921
  end
922
922
 
923
923
  spec_file = File.join @gemhome, 'specifications', @spec.spec_name
924
- assert File.exist? spec_file
924
+ assert_path_exists spec_file
925
925
  end
926
926
 
927
927
  def test_install_with_message
@@ -937,6 +937,31 @@ gem 'other', version
937
937
  assert_match %r|I am a shiny gem!|, @ui.output
938
938
  end
939
939
 
940
+ def test_install_extension_install_dir
941
+ gemhome2 = "#{@gemhome}2"
942
+
943
+ @spec.extensions << "extconf.rb"
944
+ write_file File.join(@tempdir, "extconf.rb") do |io|
945
+ io.write <<-RUBY
946
+ require "mkmf"
947
+ create_makefile("#{@spec.name}")
948
+ RUBY
949
+ end
950
+
951
+ @spec.files += %w[extconf.rb]
952
+
953
+ use_ui @ui do
954
+ path = Gem::Package.build @spec
955
+
956
+ installer = Gem::Installer.new path, :install_dir => gemhome2
957
+ installer.install
958
+ end
959
+
960
+ expected_makefile = File.join gemhome2, 'gems', @spec.full_name, 'Makefile'
961
+
962
+ assert_path_exists expected_makefile
963
+ end
964
+
940
965
  def test_install_extension_and_script
941
966
  @spec.extensions << "extconf.rb"
942
967
  write_file File.join(@tempdir, "extconf.rb") do |io|
@@ -963,16 +988,16 @@ gem 'other', version
963
988
  RUBY
964
989
  end
965
990
 
966
- assert !File.exist?(File.join(@spec.gem_dir, rb))
967
- assert !File.exist?(File.join(@spec.gem_dir, rb2))
991
+ refute_path_exists File.join @spec.gem_dir, rb
992
+ refute_path_exists File.join @spec.gem_dir, rb2
968
993
  use_ui @ui do
969
994
  path = Gem::Package.build @spec
970
995
 
971
996
  @installer = Gem::Installer.new path
972
997
  @installer.install
973
998
  end
974
- assert File.exist?(File.join(@spec.gem_dir, rb))
975
- assert File.exist?(File.join(@spec.gem_dir, rb2))
999
+ assert_path_exists File.join @spec.gem_dir, rb
1000
+ assert_path_exists File.join @spec.gem_dir, rb2
976
1001
  end
977
1002
 
978
1003
  def test_install_extension_flat
@@ -1001,14 +1026,14 @@ gem 'other', version
1001
1026
  }
1002
1027
 
1003
1028
  so = File.join(@spec.gem_dir, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
1004
- assert !File.exist?(so)
1029
+ refute_path_exists so
1005
1030
  use_ui @ui do
1006
1031
  path = Gem::Package.build @spec
1007
1032
 
1008
1033
  @installer = Gem::Installer.new path
1009
1034
  @installer.install
1010
1035
  end
1011
- assert File.exist?(so)
1036
+ assert_path_exists so
1012
1037
  rescue
1013
1038
  puts '-' * 78
1014
1039
  puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
@@ -1253,8 +1278,8 @@ gem 'other', version
1253
1278
 
1254
1279
  @installer.unpack dest
1255
1280
 
1256
- assert File.exist?(File.join(dest, 'lib', 'code.rb'))
1257
- assert File.exist?(File.join(dest, 'bin', 'executable'))
1281
+ assert_path_exists File.join dest, 'lib', 'code.rb'
1282
+ assert_path_exists File.join dest, 'bin', 'executable'
1258
1283
  end
1259
1284
 
1260
1285
  def test_write_build_info_file
@@ -1313,20 +1338,20 @@ gem 'other', version
1313
1338
 
1314
1339
  def test_write_spec
1315
1340
  FileUtils.rm @spec.spec_file
1316
- refute File.exist?(@spec.spec_file)
1341
+ refute_path_exists @spec.spec_file
1317
1342
 
1318
1343
  @installer.spec = @spec
1319
1344
  @installer.gem_home = @gemhome
1320
1345
 
1321
1346
  @installer.write_spec
1322
1347
 
1323
- assert File.exist?(@spec.spec_file)
1348
+ assert_path_exists @spec.spec_file
1324
1349
  assert_equal @spec, eval(File.read(@spec.spec_file))
1325
1350
  end
1326
1351
 
1327
1352
  def test_write_spec_writes_cached_spec
1328
1353
  FileUtils.rm @spec.spec_file
1329
- refute File.exist?(@spec.spec_file)
1354
+ refute_path_exists @spec.spec_file
1330
1355
 
1331
1356
  @spec.files = %w[a.rb b.rb c.rb]
1332
1357
 
@@ -1359,7 +1384,7 @@ gem 'other', version
1359
1384
 
1360
1385
  assert File.directory? util_inst_bindir
1361
1386
  installed_exec = File.join util_inst_bindir, 'executable'
1362
- assert File.exist? installed_exec
1387
+ assert_path_exists installed_exec
1363
1388
 
1364
1389
  assert File.directory? File.join(Gem.dir, 'specifications')
1365
1390
  assert File.directory? File.join(Gem.dir, 'specifications', 'default')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -32,7 +32,7 @@ cert_chain:
32
32
  KDyY1VIazVgoC8XvR4h/95/iScPiuglzA+DBG1hip1xScAtw05BrXyUNrc9CEMYU
33
33
  wgF94UVoHRp6ywo8I7NP3HcwFQDFNEZPNGXsng==
34
34
  -----END CERTIFICATE-----
35
- date: 2013-09-10 00:00:00.000000000 Z
35
+ date: 2013-09-11 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: minitest
@@ -492,7 +492,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
492
492
  version: '0'
493
493
  requirements: []
494
494
  rubyforge_project: rubygems-update
495
- rubygems_version: 2.1.0
495
+ rubygems_version: 2.1.1
496
496
  signing_key:
497
497
  specification_version: 4
498
498
  summary: RubyGems is a package management framework for Ruby
metadata.gz.sig CHANGED
Binary file