rubygems-update 3.3.19 → 3.3.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/bin/update_rubygems +1 -1
  4. data/bundler/CHANGELOG.md +26 -0
  5. data/bundler/lib/bundler/build_metadata.rb +2 -2
  6. data/bundler/lib/bundler/cli/install.rb +5 -2
  7. data/bundler/lib/bundler/cli/outdated.rb +12 -3
  8. data/bundler/lib/bundler/cli/platform.rb +1 -1
  9. data/bundler/lib/bundler/cli.rb +5 -3
  10. data/bundler/lib/bundler/definition.rb +61 -11
  11. data/bundler/lib/bundler/fetcher.rb +6 -6
  12. data/bundler/lib/bundler/gem_helpers.rb +7 -1
  13. data/bundler/lib/bundler/installer/standalone.rb +1 -1
  14. data/bundler/lib/bundler/installer.rb +8 -1
  15. data/bundler/lib/bundler/lazy_specification.rb +21 -21
  16. data/bundler/lib/bundler/man/bundle-cache.1 +6 -0
  17. data/bundler/lib/bundler/man/bundle-cache.1.ronn +7 -0
  18. data/bundler/lib/bundler/man/bundle-config.1 +2 -2
  19. data/bundler/lib/bundler/man/bundle-config.1.ronn +3 -3
  20. data/bundler/lib/bundler/man/bundle-install.1 +4 -0
  21. data/bundler/lib/bundler/man/bundle-install.1.ronn +6 -0
  22. data/bundler/lib/bundler/man/bundle-platform.1 +15 -5
  23. data/bundler/lib/bundler/man/bundle-platform.1.ronn +14 -7
  24. data/bundler/lib/bundler/man/bundle.1 +3 -6
  25. data/bundler/lib/bundler/man/bundle.1.ronn +3 -4
  26. data/bundler/lib/bundler/resolver.rb +2 -1
  27. data/bundler/lib/bundler/ruby_dsl.rb +1 -1
  28. data/bundler/lib/bundler/ruby_version.rb +5 -5
  29. data/bundler/lib/bundler/rubygems_ext.rb +13 -0
  30. data/bundler/lib/bundler/source/metadata.rb +1 -1
  31. data/bundler/lib/bundler/source_list.rb +4 -0
  32. data/bundler/lib/bundler/spec_set.rb +15 -28
  33. data/bundler/lib/bundler/version.rb +1 -1
  34. data/lib/rubygems/available_set.rb +3 -3
  35. data/lib/rubygems/basic_specification.rb +2 -2
  36. data/lib/rubygems/command.rb +6 -6
  37. data/lib/rubygems/commands/cert_command.rb +1 -1
  38. data/lib/rubygems/commands/cleanup_command.rb +1 -1
  39. data/lib/rubygems/commands/contents_command.rb +1 -1
  40. data/lib/rubygems/commands/dependency_command.rb +4 -4
  41. data/lib/rubygems/commands/fetch_command.rb +2 -2
  42. data/lib/rubygems/commands/generate_index_command.rb +2 -2
  43. data/lib/rubygems/commands/install_command.rb +7 -7
  44. data/lib/rubygems/commands/pristine_command.rb +5 -5
  45. data/lib/rubygems/commands/setup_command.rb +4 -4
  46. data/lib/rubygems/commands/sources_command.rb +3 -3
  47. data/lib/rubygems/commands/specification_command.rb +2 -2
  48. data/lib/rubygems/commands/uninstall_command.rb +4 -4
  49. data/lib/rubygems/commands/update_command.rb +5 -5
  50. data/lib/rubygems/commands/which_command.rb +1 -1
  51. data/lib/rubygems/config_file.rb +7 -7
  52. data/lib/rubygems/core_ext/kernel_warn.rb +1 -1
  53. data/lib/rubygems/defaults.rb +1 -1
  54. data/lib/rubygems/dependency.rb +5 -5
  55. data/lib/rubygems/dependency_installer.rb +5 -5
  56. data/lib/rubygems/dependency_list.rb +4 -4
  57. data/lib/rubygems/doctor.rb +4 -4
  58. data/lib/rubygems/exceptions.rb +1 -1
  59. data/lib/rubygems/ext/ext_conf_builder.rb +2 -2
  60. data/lib/rubygems/gemcutter_utilities.rb +1 -1
  61. data/lib/rubygems/indexer.rb +3 -3
  62. data/lib/rubygems/installer.rb +5 -13
  63. data/lib/rubygems/name_tuple.rb +3 -3
  64. data/lib/rubygems/package/tar_header.rb +17 -17
  65. data/lib/rubygems/package/tar_writer.rb +1 -1
  66. data/lib/rubygems/package.rb +19 -8
  67. data/lib/rubygems/platform.rb +15 -15
  68. data/lib/rubygems/query_utils.rb +6 -6
  69. data/lib/rubygems/remote_fetcher.rb +3 -3
  70. data/lib/rubygems/request/connection_pools.rb +2 -2
  71. data/lib/rubygems/request/http_pool.rb +1 -1
  72. data/lib/rubygems/request.rb +1 -1
  73. data/lib/rubygems/request_set/gem_dependency_api.rb +3 -3
  74. data/lib/rubygems/request_set/lockfile/parser.rb +12 -12
  75. data/lib/rubygems/request_set/lockfile/tokenizer.rb +2 -2
  76. data/lib/rubygems/request_set.rb +3 -3
  77. data/lib/rubygems/requirement.rb +1 -1
  78. data/lib/rubygems/resolver/api_specification.rb +4 -4
  79. data/lib/rubygems/resolver/best_set.rb +3 -3
  80. data/lib/rubygems/resolver/conflict.rb +3 -3
  81. data/lib/rubygems/resolver/git_specification.rb +3 -3
  82. data/lib/rubygems/resolver/index_specification.rb +3 -2
  83. data/lib/rubygems/resolver/installed_specification.rb +2 -2
  84. data/lib/rubygems/resolver/installer_set.rb +7 -12
  85. data/lib/rubygems/resolver/lock_set.rb +1 -1
  86. data/lib/rubygems/resolver/lock_specification.rb +1 -1
  87. data/lib/rubygems/resolver/vendor_specification.rb +3 -3
  88. data/lib/rubygems/resolver.rb +4 -4
  89. data/lib/rubygems/security/policy.rb +6 -6
  90. data/lib/rubygems/security/signer.rb +1 -1
  91. data/lib/rubygems/security.rb +1 -1
  92. data/lib/rubygems/source/git.rb +4 -4
  93. data/lib/rubygems/source.rb +1 -1
  94. data/lib/rubygems/spec_fetcher.rb +1 -1
  95. data/lib/rubygems/specification.rb +26 -24
  96. data/lib/rubygems/specification_policy.rb +4 -4
  97. data/lib/rubygems/uninstaller.rb +4 -4
  98. data/lib/rubygems/user_interaction.rb +2 -2
  99. data/lib/rubygems/version.rb +12 -4
  100. data/lib/rubygems.rb +8 -8
  101. data/rubygems-update.gemspec +1 -1
  102. data/setup.rb +1 -1
  103. data/test/rubygems/helper.rb +5 -5
  104. data/test/rubygems/test_gem_config_file.rb +17 -5
  105. data/test/rubygems/test_gem_dependency_installer.rb +2 -2
  106. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.lock +4 -4
  107. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/Cargo.toml +1 -1
  108. data/test/rubygems/test_gem_ext_cargo_builder/custom_name/build.rb +1 -1
  109. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.lock +4 -4
  110. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/Cargo.toml +1 -1
  111. data/test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example/build.rb +1 -1
  112. data/test/rubygems/test_gem_installer.rb +6 -3
  113. data/test/rubygems/test_gem_package.rb +22 -0
  114. data/test/rubygems/test_gem_package_tar_reader.rb +1 -1
  115. data/test/rubygems/test_gem_requirement.rb +9 -3
  116. data/test/rubygems/test_gem_resolver_index_specification.rb +1 -1
  117. data/test/rubygems/test_gem_resolver_installer_set.rb +44 -0
  118. data/test/rubygems/test_gem_specification.rb +11 -2
  119. data/test/rubygems/test_gem_version.rb +9 -2
  120. data/test/rubygems/test_require.rb +1 -1
  121. data/test/rubygems/utilities.rb +4 -4
  122. metadata +3 -3
@@ -114,7 +114,7 @@ class Gem::RemoteFetcher
114
114
  cache_dir =
115
115
  if Dir.pwd == install_dir # see fetch_command
116
116
  install_dir
117
- elsif File.writable?(install_cache_dir) || (File.writable?(install_dir) && (not File.exist?(install_cache_dir)))
117
+ elsif File.writable?(install_cache_dir) || (File.writable?(install_dir) && (!File.exist?(install_cache_dir)))
118
118
  install_cache_dir
119
119
  else
120
120
  File.join Gem.user_dir, "cache"
@@ -247,7 +247,7 @@ class Gem::RemoteFetcher
247
247
 
248
248
  data = send "fetch_#{uri.scheme}", uri, mtime, head
249
249
 
250
- if data and !head and uri.to_s.end_with?(".gz")
250
+ if data && !head && uri.to_s.end_with?(".gz")
251
251
  begin
252
252
  data = Gem::Util.gunzip data
253
253
  rescue Zlib::GzipFile::Error
@@ -288,7 +288,7 @@ class Gem::RemoteFetcher
288
288
  return Gem.read_binary(path)
289
289
  end
290
290
 
291
- if update and path
291
+ if update && path
292
292
  Gem.write_binary(path, data)
293
293
  end
294
294
 
@@ -39,7 +39,7 @@ class Gem::Request::ConnectionPools # :nodoc:
39
39
  def get_no_proxy_from_env
40
40
  env_no_proxy = ENV["no_proxy"] || ENV["NO_PROXY"]
41
41
 
42
- return [] if env_no_proxy.nil? or env_no_proxy.empty?
42
+ return [] if env_no_proxy.nil? || env_no_proxy.empty?
43
43
 
44
44
  env_no_proxy.split(/\s*,\s*/)
45
45
  end
@@ -78,7 +78,7 @@ class Gem::Request::ConnectionPools # :nodoc:
78
78
 
79
79
  no_proxy = get_no_proxy_from_env
80
80
 
81
- if proxy_uri and not no_proxy?(hostname, no_proxy)
81
+ if proxy_uri && !no_proxy?(hostname, no_proxy)
82
82
  proxy_hostname = proxy_uri.respond_to?(:hostname) ? proxy_uri.hostname : proxy_uri.host
83
83
  net_http_args + [
84
84
  proxy_hostname,
@@ -26,7 +26,7 @@ class Gem::Request::HTTPPool # :nodoc:
26
26
 
27
27
  def close_all
28
28
  until @queue.empty?
29
- if connection = @queue.pop(true) and connection.started?
29
+ if (connection = @queue.pop(true)) && connection.started?
30
30
  connection.finish
31
31
  end
32
32
  end
@@ -173,7 +173,7 @@ class Gem::Request
173
173
  require "uri"
174
174
  uri = URI(Gem::UriFormatter.new(env_proxy).normalize)
175
175
 
176
- if uri and uri.user.nil? and uri.password.nil?
176
+ if uri && uri.user.nil? && uri.password.nil?
177
177
  user = ENV["#{_scheme}_proxy_user"] || ENV["#{_SCHEME}_PROXY_USER"]
178
178
  password = ENV["#{_scheme}_proxy_pass"] || ENV["#{_SCHEME}_PROXY_PASS"]
179
179
 
@@ -371,7 +371,7 @@ class Gem::RequestSet::GemDependencyAPI
371
371
  duplicate = @dependencies.include? name
372
372
 
373
373
  @dependencies[name] =
374
- if requirements.empty? and not source_set
374
+ if requirements.empty? && !source_set
375
375
  Gem::Requirement.default
376
376
  elsif source_set
377
377
  Gem::Requirement.source_set
@@ -789,7 +789,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
789
789
 
790
790
  raise ArgumentError,
791
791
  "You must specify engine_version along with the Ruby engine" if
792
- engine and not engine_version
792
+ engine && !engine_version
793
793
 
794
794
  return true if @installing
795
795
 
@@ -800,7 +800,7 @@ Gem dependencies file #{@path} includes git reference for both ref/branch and ta
800
800
  raise Gem::RubyVersionMismatch, message
801
801
  end
802
802
 
803
- if engine and engine != Gem.ruby_engine
803
+ if engine && engine != Gem.ruby_engine
804
804
  message = "Your Ruby engine is #{Gem.ruby_engine}, " +
805
805
  "but your #{gem_deps_file} requires #{engine}"
806
806
 
@@ -30,7 +30,7 @@ class Gem::RequestSet::Lockfile::Parser
30
30
  when "PLATFORMS" then
31
31
  parse_PLATFORMS
32
32
  else
33
- token = get until @tokens.empty? or peek.first == :section
33
+ token = get until @tokens.empty? || peek.first == :section
34
34
  end
35
35
  else
36
36
  raise "BUG: unhandled token #{token.type} (#{token.value.inspect}) at line #{token.line} column #{token.column}"
@@ -44,7 +44,7 @@ class Gem::RequestSet::Lockfile::Parser
44
44
  def get(expected_types = nil, expected_value = nil) # :nodoc:
45
45
  token = @tokens.shift
46
46
 
47
- if expected_types and not Array(expected_types).include? token.type
47
+ if expected_types && !Array(expected_types).include?(token.type)
48
48
  unget token
49
49
 
50
50
  message = "unexpected token [#{token.type.inspect}, #{token.value.inspect}], " +
@@ -53,7 +53,7 @@ class Gem::RequestSet::Lockfile::Parser
53
53
  raise Gem::RequestSet::Lockfile::ParseError.new message, token.column, token.line, @filename
54
54
  end
55
55
 
56
- if expected_value and expected_value != token.value
56
+ if expected_value && expected_value != token.value
57
57
  unget token
58
58
 
59
59
  message = "unexpected token [#{token.type.inspect}, #{token.value.inspect}], " +
@@ -67,7 +67,7 @@ class Gem::RequestSet::Lockfile::Parser
67
67
  end
68
68
 
69
69
  def parse_DEPENDENCIES # :nodoc:
70
- while not @tokens.empty? and :text == peek.type do
70
+ while !@tokens.empty? && :text == peek.type do
71
71
  token = get :text
72
72
 
73
73
  requirements = []
@@ -127,7 +127,7 @@ class Gem::RequestSet::Lockfile::Parser
127
127
  set = Gem::Resolver::LockSet.new sources
128
128
  last_specs = nil
129
129
 
130
- while not @tokens.empty? and :text == peek.type do
130
+ while !@tokens.empty? && :text == peek.type do
131
131
  token = get :text
132
132
  name = token.value
133
133
  column = token.column
@@ -144,7 +144,7 @@ class Gem::RequestSet::Lockfile::Parser
144
144
  type = token.type
145
145
  data = token.value
146
146
 
147
- if type == :text and column == 4
147
+ if type == :text && column == 4
148
148
  version, platform = data.split "-", 2
149
149
 
150
150
  platform =
@@ -183,7 +183,7 @@ class Gem::RequestSet::Lockfile::Parser
183
183
 
184
184
  type = peek.type
185
185
  value = peek.value
186
- if type == :entry and %w[branch ref tag].include? value
186
+ if type == :entry && %w[branch ref tag].include?(value)
187
187
  get
188
188
  get :text
189
189
 
@@ -199,7 +199,7 @@ class Gem::RequestSet::Lockfile::Parser
199
199
 
200
200
  last_spec = nil
201
201
 
202
- while not @tokens.empty? and :text == peek.type do
202
+ while !@tokens.empty? && :text == peek.type do
203
203
  token = get :text
204
204
  name = token.value
205
205
  column = token.column
@@ -214,7 +214,7 @@ class Gem::RequestSet::Lockfile::Parser
214
214
  type = token.type
215
215
  data = token.value
216
216
 
217
- if type == :text and column == 4
217
+ if type == :text && column == 4
218
218
  last_spec = set.add_git_spec name, data, repository, revision, true
219
219
  else
220
220
  dependency = parse_dependency name, data
@@ -246,7 +246,7 @@ class Gem::RequestSet::Lockfile::Parser
246
246
  set = Gem::Resolver::VendorSet.new
247
247
  last_spec = nil
248
248
 
249
- while not @tokens.empty? and :text == peek.first do
249
+ while !@tokens.empty? && :text == peek.first do
250
250
  token = get :text
251
251
  name = token.value
252
252
  column = token.column
@@ -261,7 +261,7 @@ class Gem::RequestSet::Lockfile::Parser
261
261
  type = token.type
262
262
  data = token.value
263
263
 
264
- if type == :text and column == 4
264
+ if type == :text && column == 4
265
265
  last_spec = set.add_vendor_gem name, directory
266
266
  else
267
267
  dependency = parse_dependency name, data
@@ -281,7 +281,7 @@ class Gem::RequestSet::Lockfile::Parser
281
281
  end
282
282
 
283
283
  def parse_PLATFORMS # :nodoc:
284
- while not @tokens.empty? and :text == peek.first do
284
+ while !@tokens.empty? && :text == peek.first do
285
285
  name = get(:text).value
286
286
 
287
287
  @platforms << name
@@ -1,4 +1,4 @@
1
- # frozen_string_literal: true
1
+ #) frozen_string_literal: true
2
2
  require_relative "parser"
3
3
 
4
4
  class Gem::RequestSet::Lockfile::Tokenizer
@@ -26,7 +26,7 @@ class Gem::RequestSet::Lockfile::Tokenizer
26
26
  end
27
27
 
28
28
  def skip(type)
29
- @tokens.shift while not @tokens.empty? and peek.type == type
29
+ @tokens.shift while !@tokens.empty? && peek.type == type
30
30
  end
31
31
 
32
32
  ##
@@ -443,14 +443,14 @@ class Gem::RequestSet
443
443
 
444
444
  def tsort_each_child(node) # :nodoc:
445
445
  node.spec.dependencies.each do |dep|
446
- next if dep.type == :development and not @development
446
+ next if dep.type == :development && !@development
447
447
 
448
448
  match = @requests.find do |r|
449
- dep.match? r.spec.name, r.spec.version, @prerelease
449
+ dep.match? r.spec.name, r.spec.version, r.spec.is_a?(Gem::Resolver::InstalledSpecification) || @prerelease
450
450
  end
451
451
 
452
452
  unless match
453
- next if dep.type == :development and @development_shallow
453
+ next if dep.type == :development && @development_shallow
454
454
  next if @soft_missing
455
455
  raise Gem::DependencyError,
456
456
  "Unresolved dependency found during sorting - #{dep} (requested by #{node.spec.full_name})"
@@ -253,7 +253,7 @@ class Gem::Requirement
253
253
  def specific?
254
254
  return true if @requirements.length > 1 # GIGO, > 1, > 2 is silly
255
255
 
256
- not %w[> >=].include? @requirements.first.first # grab the operator
256
+ !%w[> >=].include? @requirements.first.first # grab the operator
257
257
  end
258
258
 
259
259
  def to_s # :nodoc:
@@ -40,10 +40,10 @@ class Gem::Resolver::APISpecification < Gem::Resolver::Specification
40
40
  end
41
41
 
42
42
  def ==(other) # :nodoc:
43
- self.class === other and
44
- @set == other.set and
45
- @name == other.name and
46
- @version == other.version and
43
+ self.class === other &&
44
+ @set == other.set &&
45
+ @name == other.name &&
46
+ @version == other.version &&
47
47
  @platform == other.platform
48
48
  end
49
49
 
@@ -25,7 +25,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
25
25
  end
26
26
 
27
27
  def find_all(req) # :nodoc:
28
- pick_sets if @remote and @sets.empty?
28
+ pick_sets if @remote && @sets.empty?
29
29
 
30
30
  super
31
31
  rescue Gem::RemoteFetcher::FetchError => e
@@ -35,7 +35,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
35
35
  end
36
36
 
37
37
  def prefetch(reqs) # :nodoc:
38
- pick_sets if @remote and @sets.empty?
38
+ pick_sets if @remote && @sets.empty?
39
39
 
40
40
  super
41
41
  end
@@ -63,7 +63,7 @@ class Gem::Resolver::BestSet < Gem::Resolver::ComposedSet
63
63
  uri = uri + "."
64
64
 
65
65
  raise error unless api_set = @sets.find do |set|
66
- Gem::Resolver::APISet === set and set.dep_uri == uri
66
+ Gem::Resolver::APISet === set && set.dep_uri == uri
67
67
  end
68
68
 
69
69
  index_set = Gem::Resolver::IndexSet.new api_set.source
@@ -27,9 +27,9 @@ class Gem::Resolver::Conflict
27
27
  end
28
28
 
29
29
  def ==(other) # :nodoc:
30
- self.class === other and
31
- @dependency == other.dependency and
32
- @activated == other.activated and
30
+ self.class === other &&
31
+ @dependency == other.dependency &&
32
+ @activated == other.activated &&
33
33
  @failed_dep == other.failed_dep
34
34
  end
35
35
 
@@ -6,9 +6,9 @@
6
6
 
7
7
  class Gem::Resolver::GitSpecification < Gem::Resolver::SpecSpecification
8
8
  def ==(other) # :nodoc:
9
- self.class === other and
10
- @set == other.set and
11
- @spec == other.spec and
9
+ self.class === other &&
10
+ @set == other.set &&
11
+ @spec == other.spec &&
12
12
  @source == other.source
13
13
  end
14
14
 
@@ -21,7 +21,8 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
21
21
  @name = name
22
22
  @version = version
23
23
  @source = source
24
- @platform = platform.to_s
24
+ @platform = Gem::Platform.new(platform.to_s)
25
+ @original_platform = platform.to_s
25
26
 
26
27
  @spec = nil
27
28
  end
@@ -91,7 +92,7 @@ class Gem::Resolver::IndexSpecification < Gem::Resolver::Specification
91
92
  def spec # :nodoc:
92
93
  @spec ||=
93
94
  begin
94
- tuple = Gem::NameTuple.new @name, @version, @platform
95
+ tuple = Gem::NameTuple.new @name, @version, @original_platform
95
96
 
96
97
  @source.fetch_spec tuple
97
98
  end
@@ -5,8 +5,8 @@
5
5
 
6
6
  class Gem::Resolver::InstalledSpecification < Gem::Resolver::SpecSpecification
7
7
  def ==(other) # :nodoc:
8
- self.class === other and
9
- @set == other.set and
8
+ self.class === other &&
9
+ @set == other.set &&
10
10
  @spec == other.spec
11
11
  end
12
12
 
@@ -61,13 +61,12 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
61
61
  found = find_all request
62
62
 
63
63
  found.delete_if do |s|
64
- s.version.prerelease? and not s.local?
64
+ s.version.prerelease? && !s.local?
65
65
  end unless dependency.prerelease?
66
66
 
67
67
  found = found.select do |s|
68
- Gem::Source::SpecificFile === s.source or
69
- Gem::Platform::RUBY == s.platform or
70
- Gem::Platform.local === s.platform
68
+ Gem::Source::SpecificFile === s.source ||
69
+ Gem::Platform.match(s.platform)
71
70
  end
72
71
 
73
72
  found = found.sort_by do |s|
@@ -111,14 +110,14 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
111
110
  # Should local gems should be considered?
112
111
 
113
112
  def consider_local? # :nodoc:
114
- @domain == :both or @domain == :local
113
+ @domain == :both || @domain == :local
115
114
  end
116
115
 
117
116
  ##
118
117
  # Should remote gems should be considered?
119
118
 
120
119
  def consider_remote? # :nodoc:
121
- @domain == :both or @domain == :remote
120
+ @domain == :both || @domain == :remote
122
121
  end
123
122
 
124
123
  ##
@@ -137,8 +136,8 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
137
136
 
138
137
  dep = req.dependency
139
138
 
140
- return res if @ignore_dependencies and
141
- @always_install.none? {|spec| dep.match? spec }
139
+ return res if @ignore_dependencies &&
140
+ @always_install.none? {|spec| dep.match? spec }
142
141
 
143
142
  name = dep.name
144
143
 
@@ -168,10 +167,6 @@ class Gem::Resolver::InstallerSet < Gem::Resolver::Set
168
167
  end
169
168
  end
170
169
 
171
- res.delete_if do |spec|
172
- spec.version.prerelease? and not dep.prerelease?
173
- end
174
-
175
170
  res.concat @remote_set.find_all req if consider_remote?
176
171
 
177
172
  res
@@ -54,7 +54,7 @@ class Gem::Resolver::LockSet < Gem::Resolver::Set
54
54
  dep = Gem::Dependency.new name, version
55
55
 
56
56
  found = @specs.find do |spec|
57
- dep.matches_spec? spec and spec.platform == platform
57
+ dep.matches_spec?(spec) && spec.platform == platform
58
58
  end
59
59
 
60
60
  tuple = Gem::NameTuple.new found.name, found.version, found.platform
@@ -71,7 +71,7 @@ class Gem::Resolver::LockSpecification < Gem::Resolver::Specification
71
71
 
72
72
  def spec
73
73
  @spec ||= Gem::Specification.find do |spec|
74
- spec.name == @name and spec.version == @version
74
+ spec.name == @name && spec.version == @version
75
75
  end
76
76
 
77
77
  @spec ||= Gem::Specification.new do |s|
@@ -6,9 +6,9 @@
6
6
 
7
7
  class Gem::Resolver::VendorSpecification < Gem::Resolver::SpecSpecification
8
8
  def ==(other) # :nodoc:
9
- self.class === other and
10
- @set == other.set and
11
- @spec == other.spec and
9
+ self.class === other &&
10
+ @set == other.set &&
11
+ @spec == other.spec &&
12
12
  @source == other.source
13
13
  end
14
14
 
@@ -153,10 +153,10 @@ class Gem::Resolver
153
153
  s.fetch_development_dependencies if @development
154
154
 
155
155
  s.dependencies.reverse_each do |d|
156
- next if d.type == :development and not @development
157
- next if d.type == :development and @development_shallow and
156
+ next if d.type == :development && !@development
157
+ next if d.type == :development && @development_shallow &&
158
158
  act.development?
159
- next if d.type == :development and @development_shallow and
159
+ next if d.type == :development && @development_shallow &&
160
160
  act.parent
161
161
 
162
162
  reqs << Gem::Resolver::DependencyRequest.new(d, act)
@@ -192,7 +192,7 @@ class Gem::Resolver
192
192
  conflict = e.conflicts.values.first
193
193
  raise Gem::DependencyResolutionError, Conflict.new(conflict.requirement_trees.first.first, conflict.existing, conflict.requirement)
194
194
  ensure
195
- @output.close if defined?(@output) and !debug?
195
+ @output.close if defined?(@output) && !debug?
196
196
  end
197
197
 
198
198
  ##
@@ -88,16 +88,16 @@ class Gem::Security::Policy
88
88
 
89
89
  message = "certificate #{signer.subject}"
90
90
 
91
- if not_before = signer.not_before and not_before > time
91
+ if (not_before = signer.not_before) && not_before > time
92
92
  raise Gem::Security::Exception,
93
93
  "#{message} not valid before #{not_before}"
94
94
  end
95
95
 
96
- if not_after = signer.not_after and not_after < time
96
+ if (not_after = signer.not_after) && not_after < time
97
97
  raise Gem::Security::Exception, "#{message} not valid after #{not_after}"
98
98
  end
99
99
 
100
- if issuer and not signer.verify issuer.public_key
100
+ if issuer && !signer.verify(issuer.public_key)
101
101
  raise Gem::Security::Exception,
102
102
  "#{message} was not issued by #{issuer.subject}"
103
103
  end
@@ -109,7 +109,7 @@ class Gem::Security::Policy
109
109
  # Ensures the public key of +key+ matches the public key in +signer+
110
110
 
111
111
  def check_key(signer, key)
112
- unless signer and key
112
+ unless signer && key
113
113
  return true unless @only_signed
114
114
 
115
115
  raise Gem::Security::Exception, "missing key or signature"
@@ -231,7 +231,7 @@ class Gem::Security::Policy
231
231
 
232
232
  if @verify_data
233
233
  raise Gem::Security::Exception, "no digests provided (probable bug)" if
234
- signer_digests.nil? or signer_digests.empty?
234
+ signer_digests.nil? || signer_digests.empty?
235
235
  else
236
236
  signer_digests = {}
237
237
  end
@@ -248,7 +248,7 @@ class Gem::Security::Policy
248
248
 
249
249
  if @only_trusted
250
250
  check_trust chain, digester, trust_dir
251
- elsif signatures.empty? and digests.empty?
251
+ elsif signatures.empty? && digests.empty?
252
252
  # trust is irrelevant if there's no signatures to verify
253
253
  else
254
254
  alert_warning "#{subject signer} is not trusted for #{full_name}"
@@ -141,7 +141,7 @@ class Gem::Security::Signer
141
141
 
142
142
  raise Gem::Security::Exception, "no certs provided" if @cert_chain.empty?
143
143
 
144
- if @cert_chain.length == 1 and @cert_chain.last.not_after < Time.now
144
+ if @cert_chain.length == 1 && @cert_chain.last.not_after < Time.now
145
145
  alert("Your certificate has expired, trying to re-sign it...")
146
146
 
147
147
  re_sign_key(
@@ -618,7 +618,7 @@ module Gem::Security
618
618
  path = File.expand_path path
619
619
 
620
620
  File.open path, "wb", permissions do |io|
621
- if passphrase and cipher
621
+ if passphrase && cipher
622
622
  io.write pemmable.to_pem cipher, passphrase
623
623
  else
624
624
  io.write pemmable.to_pem
@@ -76,10 +76,10 @@ class Gem::Source::Git < Gem::Source
76
76
  end
77
77
 
78
78
  def ==(other) # :nodoc:
79
- super and
80
- @name == other.name and
81
- @repository == other.repository and
82
- @reference == other.reference and
79
+ super &&
80
+ @name == other.name &&
81
+ @repository == other.repository &&
82
+ @reference == other.reference &&
83
83
  @need_submodules == other.need_submodules
84
84
  end
85
85
 
@@ -62,7 +62,7 @@ class Gem::Source
62
62
  end
63
63
 
64
64
  def ==(other) # :nodoc:
65
- self.class === other and @uri == other.uri
65
+ self.class === other && @uri == other.uri
66
66
  end
67
67
 
68
68
  alias_method :eql?, :== # :nodoc:
@@ -98,7 +98,7 @@ class Gem::SpecFetcher
98
98
 
99
99
  found[source] = specs.select do |tup|
100
100
  if dependency.match?(tup)
101
- if matching_platform and !Gem::Platform.match_gem?(tup.platform, tup.name)
101
+ if matching_platform && !Gem::Platform.match_gem?(tup.platform, tup.name)
102
102
  pm = (
103
103
  rejected_specs[dependency] ||= \
104
104
  Gem::PlatformMismatch.new(tup.name, tup.version))