rubygems-update 2.6.3 → 2.6.4

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: bed7c7899639f9d4eb539d69521ede2590f48bf7
4
- data.tar.gz: 8a477e9b22457409b503bfd6c2d4db1b210d4bd8
3
+ metadata.gz: ae122381f72a89b501634c0647d02389dc8f2360
4
+ data.tar.gz: f55b58bf8be379f12b8f617986c4f320c9976e0f
5
5
  SHA512:
6
- metadata.gz: ab3c776e4e1f56437bcab1717d93b228519eb7a9b945868e91e8ec22e85f06b0201df7579c0450f8b45d3a0692e3abed75561d55dce83ec09e405d66a8ebcc03
7
- data.tar.gz: ac178d28e4a95baf5ae57d1e8f90d0195b83b2b7591595a4a7415839dfc7d661cba75448916f036e300f1eb8b30b9cb53f2f3152cd2bc98dbda6de8db74a4419
6
+ metadata.gz: 2ffbdd1cc35bdac49d847c9c3396fed9e5515c9b083c37e93f6f4da6c3b14c860db35b655d73258fc1f4c7e4d327723c503cbbed6983c4eaed56cbcbe0bc96f7
7
+ data.tar.gz: f47e81a5998a75ada652786f196645cfdc64f4e1708dc1c9969d2407326697680206126a853c0abfc6e684875c54d35f25f0b2161e0046a09edb10ac50f00841
@@ -13,9 +13,11 @@ contributors to follow to reduce the time it takes to get changes merged in.
13
13
  * Match indentation (two spaces)
14
14
  * Match coding style (`if`, `elsif`, `when` need trailing `then`)
15
15
 
16
- 3. Don't modify the history file or version number.
16
+ 3. If any new files are added or existing files removed in a commit or PR, please update the `Manifest.txt` accordingly.
17
17
 
18
- 4. If you have any questions, just ask on IRC in #rubygems on Freenode or file
18
+ 4. Don't modify the history file or version number.
19
+
20
+ 5. If you have any questions, just ask on IRC in #rubygems on Freenode or file
19
21
  an issue here: http://github.com/rubygems/rubygems/issues
20
22
 
21
23
  For more information and ideas on how to contribute to RubyGems ecosystem, see
@@ -1,5 +1,22 @@
1
1
  # coding: UTF-8
2
2
 
3
+ === 2.6.4 / ---
4
+
5
+ Minor enhancements:
6
+
7
+ * Use Gem::Util::NULL_DEVICE instead of hard coded strings. Pull request #1588
8
+ by Chris Charabaruk.
9
+ * Use File.symlink on MS Windows if supported. Pull request #1418
10
+ by Nobuyoshi Nakada.
11
+
12
+ Bug fixes:
13
+
14
+ * Redact uri password from error output when gem fetch fails. Pull request
15
+ #1565 by Brian Fletcher.
16
+ * Suppress warnings. Pull request #1594 by Nobuyoshi Nakada.
17
+ * Escape user-supplied content served on web pages by `gem server` to avoid
18
+ potential XSS vulnerabilities. Samuel Giddins.
19
+
3
20
  === 2.6.3 / 2016-04-05
4
21
 
5
22
  Minor enhancements:
@@ -362,6 +362,7 @@ test/rubygems/test_gem_validator.rb
362
362
  test/rubygems/test_gem_version.rb
363
363
  test/rubygems/test_gem_version_option.rb
364
364
  test/rubygems/test_kernel.rb
365
+ test/rubygems/test_remote_fetch_error.rb
365
366
  test/rubygems/test_require.rb
366
367
  test/rubygems/wrong_key_cert.pem
367
368
  test/rubygems/wrong_key_cert_32.pem
@@ -1,38 +1,42 @@
1
- ---
2
- version: "{build}"
1
+ version: '{build}'
3
2
  branches:
4
3
  only:
5
- - master
6
- - auto
7
- - /[\d.]+/
4
+ - master
5
+ - auto
6
+ - /[\d.]+/
7
+ skip_tags: true
8
8
  clone_depth: 10
9
+ environment:
10
+ matrix:
11
+ - ruby_version: 193
12
+ - ruby_version: 200
13
+ - ruby_version: 200-x64
14
+ - ruby_version: 21
15
+ - ruby_version: 21-x64
16
+ - ruby_version: 22
17
+ - ruby_version: 22-x64
9
18
  install:
10
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
11
- - SET GEM_HOME=%APPDATA%\.gem
12
- - ruby --version
13
- - gem --version
14
- - gem install rake -v "~> 10.5" --no-rdoc --no-ri
15
- - gem install hoe-travis --no-rdoc --no-ri
16
- - gem install minitest -v "~> 4.7" --no-rdoc --no-ri
17
- - rake travis:before --trace
18
- - gem list --details
19
- - gem env
19
+ - ps: >-
20
+ $env:path = 'C:\Ruby' + $env:ruby_version + '\bin;' + $env:path
21
+
22
+ $env:TRAVIS = $TRUE
23
+
24
+ if ((gem query -i rake) -eq $False){ gem install rake --no-document }
25
+
26
+ if ((gem query -i hoe) -eq $False){ gem install hoe --no-document }
20
27
 
28
+ gem install minitest -v "~> 4.7" --no-document
29
+
30
+ ruby -v
31
+ cache:
32
+ - C:\Ruby193\lib\ruby\gems\1.9.1
33
+ - C:\Ruby200\lib\ruby\gems\2.0.0
34
+ - C:\Ruby200-x64\lib\ruby\gems\2.0.0
35
+ - C:\Ruby21\lib\ruby\gems\2.1.0
36
+ - C:\Ruby21-x64\lib\ruby\gems\2.1.0
37
+ - C:\Ruby22\lib\ruby\gems\2.2.0
38
+ - C:\Ruby22-x64\lib\ruby\gems\2.2.0
21
39
  build: off
22
40
  test_script:
23
- - rake -rdevkit travis
24
- after_test:
25
- # FIXME: missing `diff` to check manifest differences
26
- #- rake -rdevkit travis:after --trace
27
-
28
- environment:
29
- matrix:
30
- # FIXME: Tests don't even run on Ruby 1.9.3 on Windows on Appveyor.
31
- # See: https://github.com/rubygems/rubygems/issues/1270
32
- #- ruby_version: "193"
33
- - ruby_version: "200"
34
- - ruby_version: "200-x64"
35
- - ruby_version: "21"
36
- - ruby_version: "21-x64"
37
- - ruby_version: "22"
38
- - ruby_version: "22-x64"
41
+ - cmd: rake -rdevkit test
42
+ deploy: off
@@ -10,7 +10,7 @@ require 'rbconfig'
10
10
  require 'thread'
11
11
 
12
12
  module Gem
13
- VERSION = '2.6.3'
13
+ VERSION = '2.6.4'
14
14
  end
15
15
 
16
16
  # Must be first since it unloads the prelude from 1.9.2
@@ -259,7 +259,7 @@ is too hard to use.
259
259
  if options[:domain] == :remote || specs.all? { |spec| spec.is_a? Gem::Source }
260
260
  version
261
261
  else
262
- spec = specs.select { |spec| spec.version == version }
262
+ spec = specs.select { |s| s.version == version }
263
263
  if spec.first.default_gem?
264
264
  "default: #{version}"
265
265
  else
@@ -170,6 +170,7 @@ module Gem
170
170
  # An English description of the error.
171
171
 
172
172
  def wordy
173
+ @source.uri.password = 'REDACTED' unless @source.uri.password.nil?
173
174
  "Unable to download data from #{@source.uri} - #{@error.message}"
174
175
  end
175
176
 
@@ -509,12 +509,6 @@ class Gem::Installer
509
509
  # the symlink if the gem being installed has a newer version.
510
510
 
511
511
  def generate_bin_symlink(filename, bindir)
512
- if Gem.win_platform? then
513
- alert_warning "Unable to use symlinks on Windows, installing wrapper"
514
- generate_bin_script filename, bindir
515
- return
516
- end
517
-
518
512
  src = File.join gem_dir, spec.bindir, filename
519
513
  dst = File.join bindir, formatted_program_filename(filename)
520
514
 
@@ -528,6 +522,9 @@ class Gem::Installer
528
522
  end
529
523
 
530
524
  FileUtils.symlink src, dst, :verbose => Gem.configuration.really_verbose
525
+ rescue NotImplementedError, SystemCallError
526
+ alert_warning "Unable to use symlinks, installing wrapper"
527
+ generate_bin_script filename, bindir
531
528
  end
532
529
 
533
530
  ##
@@ -27,7 +27,13 @@ class Gem::RemoteFetcher
27
27
 
28
28
  def initialize(message, uri)
29
29
  super message
30
- @uri = uri
30
+ begin
31
+ uri = URI(uri)
32
+ uri.password = 'REDACTED' if uri.password
33
+ @uri = uri.to_s
34
+ rescue URI::InvalidURIError, ArgumentError
35
+ @uri = uri
36
+ end
31
37
  end
32
38
 
33
39
  def to_s # :nodoc:
@@ -34,7 +34,7 @@ class Gem::Server
34
34
  include ERB::Util
35
35
  include Gem::UserInteraction
36
36
 
37
- SEARCH = <<-SEARCH
37
+ SEARCH = <<-ERB
38
38
  <form class="headerSearch" name="headerSearchForm" method="get" action="/rdoc">
39
39
  <div id="search" style="float:right">
40
40
  <label for="q">Filter/Search</label>
@@ -42,9 +42,9 @@ class Gem::Server
42
42
  <button type="submit" style="display:none"></button>
43
43
  </div>
44
44
  </form>
45
- SEARCH
45
+ ERB
46
46
 
47
- DOC_TEMPLATE = <<-'DOC_TEMPLATE'
47
+ DOC_TEMPLATE = <<-'ERB'
48
48
  <?xml version="1.0" encoding="iso-8859-1"?>
49
49
  <!DOCTYPE html
50
50
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -68,35 +68,33 @@ class Gem::Server
68
68
  <h1>Summary</h1>
69
69
  <p>There are <%=values["gem_count"]%> gems installed:</p>
70
70
  <p>
71
- <%= values["specs"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
71
+ <%= values["specs"].map { |v| "<a href\"##{u v["name"]}\">#{h v["name"]}</a>" }.join ', ' %>.
72
72
  <h1>Gems</h1>
73
73
 
74
74
  <dl>
75
75
  <% values["specs"].each do |spec| %>
76
76
  <dt>
77
77
  <% if spec["first_name_entry"] then %>
78
- <a name="<%=spec["name"]%>"></a>
78
+ <a name="<%=h spec["name"]%>"></a>
79
79
  <% end %>
80
80
 
81
- <b><%=spec["name"]%> <%=spec["version"]%></b>
81
+ <b><%=h spec["name"]%> <%=h spec["version"]%></b>
82
82
 
83
- <% if spec["ri_installed"] then %>
84
- <a href="<%=spec["doc_path"]%>">[rdoc]</a>
85
- <% elsif spec["rdoc_installed"] then %>
86
- <a href="<%=spec["doc_path"]%>">[rdoc]</a>
83
+ <% if spec["ri_installed"] || spec["rdoc_installed"] then %>
84
+ <a href="<%=u spec["doc_path"]%>">[rdoc]</a>
87
85
  <% else %>
88
86
  <span title="rdoc not installed">[rdoc]</span>
89
87
  <% end %>
90
88
 
91
89
  <% if spec["homepage"] then %>
92
- <a href="<%=spec["homepage"]%>" title="<%=spec["homepage"]%>">[www]</a>
90
+ <a href="<%=u spec["homepage"]%>" title="<%=h spec["homepage"]%>">[www]</a>
93
91
  <% else %>
94
92
  <span title="no homepage available">[www]</span>
95
93
  <% end %>
96
94
 
97
95
  <% if spec["has_deps"] then %>
98
96
  - depends on
99
- <%= spec["dependencies"].map { |v| "<a href=\"##{v["name"]}\">#{v["name"]}</a>" }.join ', ' %>.
97
+ <%= spec["dependencies"].map { |v| "<a href=\"##{u v["name"]}>#{h v["name"]}</a>" }.join ', ' %>.
100
98
  <% end %>
101
99
  </dt>
102
100
  <dd>
@@ -110,7 +108,7 @@ class Gem::Server
110
108
  Executables are
111
109
  <%end%>
112
110
 
113
- <%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{v["executable"]}</span>"}.join ', ' %>.
111
+ <%= spec["executables"].map { |v| "<span class=\"context-item-name\">#{h v["executable"]}</span>"}.join ', ' %>.
114
112
 
115
113
  <%end%>
116
114
  <br/>
@@ -127,10 +125,10 @@ class Gem::Server
127
125
  </div>
128
126
  </body>
129
127
  </html>
130
- DOC_TEMPLATE
128
+ ERB
131
129
 
132
130
  # CSS is copy & paste from rdoc-style.css, RDoc V1.0.1 - 20041108
133
- RDOC_CSS = <<-RDOC_CSS
131
+ RDOC_CSS = <<-CSS
134
132
  body {
135
133
  font-family: Verdana,Arial,Helvetica,sans-serif;
136
134
  font-size: 90%;
@@ -338,9 +336,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
338
336
  .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
339
337
  .ruby-regexp { color: #ffa07a; background: transparent; }
340
338
  .ruby-value { color: #7fffd4; background: transparent; }
341
- RDOC_CSS
339
+ CSS
342
340
 
343
- RDOC_NO_DOCUMENTATION = <<-'NO_DOC'
341
+ RDOC_NO_DOCUMENTATION = <<-'ERB'
344
342
  <?xml version="1.0" encoding="iso-8859-1"?>
345
343
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
346
344
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -372,9 +370,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
372
370
  </div>
373
371
  </body>
374
372
  </html>
375
- NO_DOC
373
+ ERB
376
374
 
377
- RDOC_SEARCH_TEMPLATE = <<-'RDOC_SEARCH'
375
+ RDOC_SEARCH_TEMPLATE = <<-'ERB'
378
376
  <?xml version="1.0" encoding="iso-8859-1"?>
379
377
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
380
378
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -401,10 +399,10 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
401
399
  <% doc_items.each do |doc_item| %>
402
400
  <dt>
403
401
  <b><%=doc_item[:name]%></b>
404
- <a href="<%=doc_item[:url]%>">[rdoc]</a>
402
+ <a href="<%=u doc_item[:url]%>">[rdoc]</a>
405
403
  </dt>
406
404
  <dd>
407
- <%=doc_item[:summary]%>
405
+ <%=h doc_item[:summary]%>
408
406
  <br/>
409
407
  <br/>
410
408
  </dd>
@@ -423,7 +421,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
423
421
  </div>
424
422
  </body>
425
423
  </html>
426
- RDOC_SEARCH
424
+ ERB
427
425
 
428
426
  def self.run(options)
429
427
  new(options[:gemdir], options[:port], options[:daemon],
@@ -459,9 +457,9 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
459
457
 
460
458
  def doc_root gem_name
461
459
  if have_rdoc_4_plus? then
462
- "/doc_root/#{gem_name}/"
460
+ "/doc_root/#{u gem_name}/"
463
461
  else
464
- "/doc_root/#{gem_name}/rdoc/index.html"
462
+ "/doc_root/#{u gem_name}/rdoc/index.html"
465
463
  end
466
464
  end
467
465
 
@@ -5,6 +5,8 @@
5
5
  # See LICENSE.txt for permissions.
6
6
  #++
7
7
 
8
+ require 'rubygems/util'
9
+
8
10
  begin
9
11
  require 'io/console'
10
12
  rescue LoadError
@@ -676,13 +678,8 @@ class Gem::SilentUI < Gem::StreamUI
676
678
  def initialize
677
679
  reader, writer = nil, nil
678
680
 
679
- begin
680
- reader = File.open('/dev/null', 'r')
681
- writer = File.open('/dev/null', 'w')
682
- rescue Errno::ENOENT
683
- reader = File.open('nul', 'r')
684
- writer = File.open('nul', 'w')
685
- end
681
+ reader = File.open(Gem::Util::NULL_DEVICE, 'r')
682
+ writer = File.open(Gem::Util::NULL_DEVICE, 'w')
686
683
 
687
684
  super reader, writer, writer, false
688
685
  end
@@ -701,4 +698,3 @@ class Gem::SilentUI < Gem::StreamUI
701
698
  SilentProgressReporter.new(@outs, *args)
702
699
  end
703
700
  end
704
-
@@ -6,6 +6,10 @@ require 'rubygems/command_manager'
6
6
  #
7
7
  # DO NOT include code like this in your rubygems_plugin.rb
8
8
 
9
+ module Gem::Commands
10
+ remove_const(:InterruptCommand) if defined?(InterruptCommand)
11
+ end
12
+
9
13
  class Gem::Commands::InterruptCommand < Gem::Command
10
14
 
11
15
  def initialize
@@ -2,6 +2,20 @@
2
2
  require 'rubygems/installer_test_case'
3
3
 
4
4
  class TestGemInstaller < Gem::InstallerTestCase
5
+ @@symlink_supported = nil
6
+
7
+ def symlink_supported?
8
+ if @@symlink_supported.nil?
9
+ begin
10
+ File.symlink("", "")
11
+ rescue Errno::ENOENT, Errno::EEXIST
12
+ @@symlink_supported = true
13
+ rescue NotImplementedError, SystemCallError
14
+ @@symlink_supported = false
15
+ end
16
+ end
17
+ @@symlink_supported
18
+ end
5
19
 
6
20
  def setup
7
21
  super
@@ -552,7 +566,7 @@ gem 'other', version
552
566
  end
553
567
 
554
568
  def test_generate_bin_symlink_update_older
555
- return if win_platform? #Windows FS do not support symlinks
569
+ return if !symlink_supported?
556
570
 
557
571
  @installer.wrappers = false
558
572
  util_make_exec
@@ -588,7 +602,7 @@ gem 'other', version
588
602
  end
589
603
 
590
604
  def test_generate_bin_symlink_update_remove_wrapper
591
- return if win_platform? #Windows FS do not support symlinks
605
+ return if !symlink_supported?
592
606
 
593
607
  @installer.wrappers = true
594
608
  util_make_exec
@@ -639,7 +653,12 @@ gem 'other', version
639
653
  installed_exec = File.join(util_inst_bindir, 'executable')
640
654
  assert_path_exists installed_exec
641
655
 
642
- assert_match(/Unable to use symlinks on Windows, installing wrapper/i,
656
+ if symlink_supported?
657
+ assert_send([File, :symlink?, installed_exec])
658
+ return
659
+ end
660
+
661
+ assert_match(/Unable to use symlinks, installing wrapper/i,
643
662
  @ui.error)
644
663
 
645
664
  wrapper = File.read installed_exec
@@ -651,7 +670,7 @@ gem 'other', version
651
670
  end
652
671
 
653
672
  def test_generate_bin_uses_default_shebang
654
- return if win_platform? #Windows FS do not support symlinks
673
+ return if !symlink_supported?
655
674
 
656
675
  @installer.wrappers = true
657
676
  util_make_exec
@@ -16,5 +16,13 @@ class TestGemSourceFetchProblem < Gem::TestCase
16
16
  assert_equal 'test', e.message
17
17
  end
18
18
 
19
+ def test_password_redacted
20
+ source = Gem::Source.new 'https://username:secret@gemsource.com'
21
+ error = RuntimeError.new 'test'
22
+
23
+ sf = Gem::SourceFetchProblem.new source, error
24
+
25
+ refute_match sf.wordy, 'secret'
26
+ end
19
27
  end
20
28
 
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+ require 'rubygems/test_case'
3
+
4
+ class TestRemoteFetchError < Gem::TestCase
5
+
6
+ def test_password_redacted
7
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://user:secret@gemsource.org')
8
+ refute_match error.to_s, 'secret'
9
+ end
10
+
11
+ def test_invalid_url
12
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://::gemsource.org')
13
+ assert_equal error.to_s, 'There was an error fetching (https://::gemsource.org)'
14
+ end
15
+
16
+ def test_to_s
17
+ error = Gem::RemoteFetcher::FetchError.new('There was an error fetching', 'https://gemsource.org')
18
+ assert_equal error.to_s, 'There was an error fetching (https://gemsource.org)'
19
+ end
20
+ end
21
+
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.6.3
4
+ version: 2.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-04-05 00:00:00.000000000 Z
13
+ date: 2016-04-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdoc
@@ -520,6 +520,7 @@ files:
520
520
  - test/rubygems/test_gem_version.rb
521
521
  - test/rubygems/test_gem_version_option.rb
522
522
  - test/rubygems/test_kernel.rb
523
+ - test/rubygems/test_remote_fetch_error.rb
523
524
  - test/rubygems/test_require.rb
524
525
  - test/rubygems/wrong_key_cert.pem
525
526
  - test/rubygems/wrong_key_cert_32.pem
@@ -552,7 +553,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
552
553
  version: '0'
553
554
  requirements: []
554
555
  rubyforge_project:
555
- rubygems_version: 2.6.2
556
+ rubygems_version: 2.6.3
556
557
  signing_key:
557
558
  specification_version: 4
558
559
  summary: RubyGems is a package management framework for Ruby