rubygems-update 2.6.9 → 2.6.10
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 +4 -4
- data/History.txt +7 -0
- data/Manifest.txt +2 -0
- data/lib/rubygems.rb +1 -1
- data/lib/rubygems/commands/setup_command.rb +1 -1
- data/lib/rubygems/core_ext/kernel_require.rb +1 -1
- data/lib/rubygems/specification.rb +1 -1
- data/test/rubygems/test_gem_remote_fetcher.rb +2 -2
- data/test/rubygems/test_gem_specification.rb +1 -1
- data/test/rubygems/test_require.rb +25 -0
- data/util/patch_with_prs.rb +76 -0
- data/util/update_changelog.rb +67 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c92c832ef9ee468263f9ed601e77a1fe1544df8
|
4
|
+
data.tar.gz: e0564deb664a4c72dc115a15bc0eed6af67505fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f309ad05bf0c71ec039b0624f4b55a3445bce516219d0bab7919ff3a789ee90bd039c2bbaed973320d80b9b3fd73dbb45995bfd5fee7e92f1ecdd3a34916192
|
7
|
+
data.tar.gz: 37c4f20bedf66dd0dd5ad5c0b434dad8cc96c0656362228c081f062a882d46d8c877d34ce0898412056c3143a52ccdcc094f4f9883f31338f3c8409b7b5f618e
|
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/lib/rubygems.rb
CHANGED
@@ -47,7 +47,7 @@ class Gem::Commands::SetupCommand < Gem::Command
|
|
47
47
|
end
|
48
48
|
|
49
49
|
add_option '--[no-]document [TYPES]', Array,
|
50
|
-
'Generate documentation for RubyGems
|
50
|
+
'Generate documentation for RubyGems',
|
51
51
|
'List the documentation types you wish to',
|
52
52
|
'generate. For example: rdoc,ri' do |value, options|
|
53
53
|
options[:document] = case value
|
@@ -2698,7 +2698,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|
2698
2698
|
|
2699
2699
|
unless specification_version.is_a?(Integer)
|
2700
2700
|
raise Gem::InvalidSpecificationException,
|
2701
|
-
'specification_version must be
|
2701
|
+
'specification_version must be an Integer (did you mean version?)'
|
2702
2702
|
end
|
2703
2703
|
|
2704
2704
|
case platform
|
@@ -163,7 +163,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
163
163
|
fetcher = Gem::RemoteFetcher.new nil
|
164
164
|
@fetcher = fetcher
|
165
165
|
def fetcher.request(uri, request_class, last_modified = nil)
|
166
|
-
raise SocketError, "
|
166
|
+
raise SocketError, "oops"
|
167
167
|
end
|
168
168
|
|
169
169
|
uri = 'http://gems.example.com/yaml'
|
@@ -171,7 +171,7 @@ PeIQQkFng2VVot/WAQbv3ePqWq07g1BBcwIBAg==
|
|
171
171
|
fetcher.fetch_size uri
|
172
172
|
end
|
173
173
|
|
174
|
-
assert_equal "SocketError:
|
174
|
+
assert_equal "SocketError: oops (#{uri})", e.message
|
175
175
|
end
|
176
176
|
|
177
177
|
def test_no_proxy
|
@@ -3080,7 +3080,7 @@ Did you mean 'Ruby'?
|
|
3080
3080
|
end
|
3081
3081
|
end
|
3082
3082
|
|
3083
|
-
err = 'specification_version must be
|
3083
|
+
err = 'specification_version must be an Integer (did you mean version?)'
|
3084
3084
|
assert_equal err, e.message
|
3085
3085
|
end
|
3086
3086
|
end
|
@@ -341,6 +341,31 @@ class TestGemRequire < Gem::TestCase
|
|
341
341
|
Kernel::RUBYGEMS_ACTIVATION_MONITOR.exit
|
342
342
|
end
|
343
343
|
|
344
|
+
def test_require_when_gem_defined
|
345
|
+
default_gem_spec = new_default_spec("default", "2.0.0.0",
|
346
|
+
nil, "default/gem.rb")
|
347
|
+
install_default_specs(default_gem_spec)
|
348
|
+
c = Class.new do
|
349
|
+
def self.gem(*args)
|
350
|
+
raise "received #gem with #{args.inspect}"
|
351
|
+
end
|
352
|
+
end
|
353
|
+
assert c.send(:require, "default/gem")
|
354
|
+
assert_equal %w(default-2.0.0.0), loaded_spec_names
|
355
|
+
end
|
356
|
+
|
357
|
+
def test_require_default_when_gem_defined
|
358
|
+
a = new_spec("a", "1", nil, "lib/a.rb")
|
359
|
+
install_specs a
|
360
|
+
c = Class.new do
|
361
|
+
def self.gem(*args)
|
362
|
+
raise "received #gem with #{args.inspect}"
|
363
|
+
end
|
364
|
+
end
|
365
|
+
assert c.send(:require, "a")
|
366
|
+
assert_equal %w(a-1), loaded_spec_names
|
367
|
+
end
|
368
|
+
|
344
369
|
def silence_warnings
|
345
370
|
old_verbose, $VERBOSE = $VERBOSE, false
|
346
371
|
yield
|
@@ -0,0 +1,76 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$:.unshift File.expand_path("../../lib", __FILE__)
|
4
|
+
require "rubygems"
|
5
|
+
require "optparse"
|
6
|
+
|
7
|
+
def confirm(prompt = "")
|
8
|
+
loop do
|
9
|
+
print(prompt)
|
10
|
+
print(": ") unless prompt.empty?
|
11
|
+
break if $stdin.gets.strip == "y"
|
12
|
+
end
|
13
|
+
rescue Interrupt
|
14
|
+
abort
|
15
|
+
end
|
16
|
+
|
17
|
+
def sh(*cmd)
|
18
|
+
return if system(*cmd)
|
19
|
+
raise "#{cmd} failed"
|
20
|
+
end
|
21
|
+
|
22
|
+
version = nil
|
23
|
+
prs = []
|
24
|
+
|
25
|
+
OptionParser.new do |opts|
|
26
|
+
opts.banner = "Usage: #{__FILE__} [options]"
|
27
|
+
|
28
|
+
opts.on("--version=VERSION", "The version to release") do |v|
|
29
|
+
version = v
|
30
|
+
end
|
31
|
+
end.parse!
|
32
|
+
|
33
|
+
prs = ARGV.dup
|
34
|
+
|
35
|
+
version ||= begin
|
36
|
+
version = Gem::Version.new(Gem::VERSION)
|
37
|
+
segments = version.segments
|
38
|
+
if segments.last.is_a?(String)
|
39
|
+
segments << "1"
|
40
|
+
else
|
41
|
+
segments[-1] += 1
|
42
|
+
end
|
43
|
+
segments.join(".")
|
44
|
+
end
|
45
|
+
|
46
|
+
confirm "You are about to release #{version}, currently #{Gem::VERSION}"
|
47
|
+
|
48
|
+
branch = version.split(".", 3)[0, 2].join(".")
|
49
|
+
sh("git", "checkout", branch)
|
50
|
+
sh("git", "submodule", "update", "--init", "--recursive")
|
51
|
+
|
52
|
+
commits = `git log --oneline origin/master --`.split("\n").map {|l| l.split(/\s/, 2) }.reverse
|
53
|
+
commits.select! {|_sha, message| message =~ /(Auto merge of|Merge pull request) ##{Regexp.union(*prs)}/ }
|
54
|
+
|
55
|
+
unless system("git", "cherry-pick", "-x", "-m", "1", *commits.map(&:first))
|
56
|
+
abort unless system("zsh")
|
57
|
+
end
|
58
|
+
|
59
|
+
sh(Gem.ruby, File.expand_path("../update_changelog.rb", __FILE__))
|
60
|
+
|
61
|
+
version_file = "lib/rubygems.rb"
|
62
|
+
version_contents = File.read(version_file)
|
63
|
+
unless version_contents.sub!(/^(\s*VERSION = )(["'])#{Gem::Version::VERSION_PATTERN}\2/, "\\1#{version.to_s.dump}")
|
64
|
+
abort "failed to update #{version_file}, is it in the expected format?"
|
65
|
+
end
|
66
|
+
File.open(version_file, "w") {|f| f.write(version_contents) }
|
67
|
+
|
68
|
+
confirm "Update changelog"
|
69
|
+
sh("git", "commit", "-am", "Version #{version} with changelog")
|
70
|
+
sh("rake", "release", "VERSION=#{version}")
|
71
|
+
sh("git", "checkout", "master")
|
72
|
+
sh("git", "pull")
|
73
|
+
unless system("git", "merge", "v#{version}", "--no-edit")
|
74
|
+
abort unless system("zsh")
|
75
|
+
end
|
76
|
+
sh("git", "push")
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'net/http'
|
5
|
+
|
6
|
+
def access_token_query_string
|
7
|
+
@access_token_query_string ||= begin
|
8
|
+
token = ENV['GITHUB_API_TOKEN']
|
9
|
+
token ? "?access_token=#{token.strip}" : ''
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def github_api(path)
|
14
|
+
base = 'https://api.github.com'
|
15
|
+
url = path.start_with?(base) ? path : base + path
|
16
|
+
url += access_token_query_string
|
17
|
+
uri = URI.parse(url)
|
18
|
+
return unless response = Net::HTTP.get_response(uri)
|
19
|
+
JSON.load(response.body)
|
20
|
+
end
|
21
|
+
|
22
|
+
def wrap(text, length, indent)
|
23
|
+
result = []
|
24
|
+
work = text.dup
|
25
|
+
|
26
|
+
while work.length > length
|
27
|
+
if work =~ /^(.{0,#{length}})[ \n]/o
|
28
|
+
result << $1
|
29
|
+
work.slice!(0, $&.length)
|
30
|
+
else
|
31
|
+
result << work.slice!(0, length)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
result << work unless work.empty?
|
36
|
+
result = result.reduce(String.new) do |acc, elem|
|
37
|
+
acc << "\n" << ' ' * indent unless acc.empty?
|
38
|
+
acc << elem
|
39
|
+
end
|
40
|
+
result += "\n" unless result.end_with?("\n")
|
41
|
+
result
|
42
|
+
end
|
43
|
+
|
44
|
+
def sentence(text)
|
45
|
+
text = text[0].upcase + text[1..-1]
|
46
|
+
text.end_with?('.') ? text : text << '.'
|
47
|
+
end
|
48
|
+
|
49
|
+
branch = ARGV.shift || "HEAD"
|
50
|
+
|
51
|
+
history = File.read(File.expand_path('../../History.txt', __FILE__))
|
52
|
+
|
53
|
+
File.open(File.expand_path('../../ChangeLog', __FILE__), 'w') do |changelog|
|
54
|
+
commits = `git log --oneline v#{Gem::VERSION}..#{branch}`.split("\n")
|
55
|
+
prs = commits.reverse_each.map { |c| c =~ /(Auto merge of|Merge pull request) #(\d+)/ && $2 }.compact
|
56
|
+
prs.each do |pr|
|
57
|
+
next if history =~ /Pull\srequest\s##{pr}/m
|
58
|
+
details = github_api "/repos/rubygems/rubygems/pulls/#{pr}"
|
59
|
+
title, user = details.values_at('title', 'user')
|
60
|
+
user = github_api(user['url'])
|
61
|
+
name = user['name'] || user['login']
|
62
|
+
changelog << wrap(
|
63
|
+
['*', sentence(title), sentence("Pull request ##{pr} by #{name}")].join(' '),
|
64
|
+
74, 2
|
65
|
+
)
|
66
|
+
end
|
67
|
+
end
|
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.
|
4
|
+
version: 2.6.10
|
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: 2017-01-
|
13
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: builder
|
@@ -773,7 +773,9 @@ files:
|
|
773
773
|
- util/create_certs.rb
|
774
774
|
- util/create_encrypted_key.rb
|
775
775
|
- util/generate_spdx_license_list.rb
|
776
|
+
- util/patch_with_prs.rb
|
776
777
|
- util/update_bundled_ca_certificates.rb
|
778
|
+
- util/update_changelog.rb
|
777
779
|
homepage: https://rubygems.org
|
778
780
|
licenses:
|
779
781
|
- Ruby
|
@@ -798,7 +800,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
798
800
|
version: '0'
|
799
801
|
requirements: []
|
800
802
|
rubyforge_project:
|
801
|
-
rubygems_version: 2.6.
|
803
|
+
rubygems_version: 2.6.9
|
802
804
|
signing_key:
|
803
805
|
specification_version: 4
|
804
806
|
summary: RubyGems is a package management framework for Ruby
|