bundler 1.12.6 → 1.13.0.pre.1

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

Potentially problematic release.


This version of bundler might be problematic. Click here for more details.

Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +15 -13
  3. data/.travis.yml +2 -2
  4. data/CHANGELOG.md +40 -3
  5. data/CONTRIBUTING.md +9 -5
  6. data/DEVELOPMENT.md +30 -18
  7. data/ISSUES.md +26 -22
  8. data/Rakefile +15 -4
  9. data/bin/rubocop +1 -1
  10. data/bundler.gemspec +2 -2
  11. data/exe/bundle +7 -0
  12. data/lib/bundler.rb +6 -3
  13. data/lib/bundler/capistrano.rb +1 -1
  14. data/lib/bundler/cli.rb +27 -10
  15. data/lib/bundler/cli/binstubs.rb +2 -0
  16. data/lib/bundler/cli/exec.rb +1 -1
  17. data/lib/bundler/cli/install.rb +87 -56
  18. data/lib/bundler/cli/lock.rb +5 -0
  19. data/lib/bundler/cli/open.rb +3 -1
  20. data/lib/bundler/cli/outdated.rb +8 -8
  21. data/lib/bundler/cli/plugin.rb +23 -0
  22. data/lib/bundler/cli/update.rb +2 -2
  23. data/lib/bundler/cli/viz.rb +3 -0
  24. data/lib/bundler/definition.rb +72 -16
  25. data/lib/bundler/dsl.rb +19 -7
  26. data/lib/bundler/endpoint_specification.rb +2 -2
  27. data/lib/bundler/env.rb +2 -2
  28. data/lib/bundler/errors.rb +15 -1
  29. data/lib/bundler/fetcher.rb +5 -2
  30. data/lib/bundler/fetcher/compact_index.rb +2 -2
  31. data/lib/bundler/fetcher/dependency.rb +8 -4
  32. data/lib/bundler/fetcher/downloader.rb +1 -1
  33. data/lib/bundler/friendly_errors.rb +1 -1
  34. data/lib/bundler/index.rb +29 -36
  35. data/lib/bundler/inline.rb +14 -4
  36. data/lib/bundler/installer.rb +22 -3
  37. data/lib/bundler/installer/gem_installer.rb +1 -1
  38. data/lib/bundler/installer/standalone.rb +1 -1
  39. data/lib/bundler/mirror.rb +4 -4
  40. data/lib/bundler/plugin.rb +156 -0
  41. data/lib/bundler/plugin/api.rb +56 -0
  42. data/lib/bundler/plugin/dsl.rb +29 -0
  43. data/lib/bundler/plugin/index.rb +88 -0
  44. data/lib/bundler/plugin/installer.rb +99 -0
  45. data/lib/bundler/plugin/installer/git.rb +38 -0
  46. data/lib/bundler/plugin/installer/rubygems.rb +27 -0
  47. data/lib/bundler/plugin/source_list.rb +24 -0
  48. data/lib/bundler/postit_trampoline.rb +54 -0
  49. data/lib/bundler/psyched_yaml.rb +1 -1
  50. data/lib/bundler/remote_specification.rb +5 -5
  51. data/lib/bundler/resolver.rb +27 -29
  52. data/lib/bundler/ruby_version.rb +29 -3
  53. data/lib/bundler/rubygems_ext.rb +3 -1
  54. data/lib/bundler/rubygems_integration.rb +10 -4
  55. data/lib/bundler/runtime.rb +1 -16
  56. data/lib/bundler/settings.rb +19 -15
  57. data/lib/bundler/setup.rb +1 -0
  58. data/lib/bundler/shared_helpers.rb +3 -0
  59. data/lib/bundler/source.rb +4 -3
  60. data/lib/bundler/source/gemspec.rb +13 -0
  61. data/lib/bundler/source/git.rb +4 -3
  62. data/lib/bundler/source/git/git_proxy.rb +9 -5
  63. data/lib/bundler/source/path.rb +11 -2
  64. data/lib/bundler/source/rubygems.rb +28 -15
  65. data/lib/bundler/source_list.rb +5 -1
  66. data/lib/bundler/spec_set.rb +3 -3
  67. data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
  68. data/lib/bundler/ssl_certs/rubygems.org/{AddTrustExternalCARoot-2048.pem → AddTrustExternalCARoot.pem} +0 -0
  69. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +54 -29
  70. data/lib/bundler/templates/newgem/newgem.gemspec.tt +5 -2
  71. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +3 -3
  72. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -2
  73. data/lib/bundler/ui/shell.rb +4 -0
  74. data/lib/bundler/ui/silent.rb +3 -0
  75. data/lib/bundler/uri_credentials_filter.rb +36 -0
  76. data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +1 -1
  77. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
  78. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
  79. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +56 -144
  80. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
  81. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
  82. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
  83. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
  84. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
  85. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
  86. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
  87. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
  88. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  89. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +46 -51
  90. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +4 -2
  91. data/lib/bundler/vendor/postit/lib/postit.rb +15 -0
  92. data/lib/bundler/vendor/postit/lib/postit/environment.rb +44 -0
  93. data/lib/bundler/vendor/postit/lib/postit/installer.rb +28 -0
  94. data/lib/bundler/vendor/postit/lib/postit/parser.rb +21 -0
  95. data/lib/bundler/vendor/postit/lib/postit/setup.rb +12 -0
  96. data/lib/bundler/vendor/postit/lib/postit/version.rb +3 -0
  97. data/lib/bundler/version.rb +1 -1
  98. data/lib/bundler/vlad.rb +1 -1
  99. data/lib/bundler/yaml_serializer.rb +67 -0
  100. data/man/bundle-install.ronn +10 -5
  101. data/man/bundle-package.ronn +7 -6
  102. data/man/bundle-platform.ronn +1 -1
  103. data/man/bundle-update.ronn +5 -2
  104. data/man/bundle.ronn +5 -5
  105. data/man/gemfile.5.ronn +32 -28
  106. metadata +37 -12
  107. data/lib/bundler/ssl_certs/Fastly.pem +0 -82
  108. data/lib/bundler/ssl_certs/GlobalSignOrganizationValidationCA.pem +0 -26
  109. data/lib/bundler/ssl_certs/GlobalSignRoot.pem +0 -18
  110. data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRoot.pem +0 -18
@@ -21,12 +21,13 @@ module Bundler
21
21
  @dependency_names = []
22
22
  @allow_remote = false
23
23
  @allow_cached = false
24
- @caches = [Bundler.app_cache, *Bundler.rubygems.gem_cache]
24
+ @caches = [cache_path, *Bundler.rubygems.gem_cache]
25
25
 
26
26
  Array(options["remotes"] || []).reverse_each {|r| add_remote(r) }
27
27
  end
28
28
 
29
29
  def remote!
30
+ @specs = nil
30
31
  @allow_remote = true
31
32
  end
32
33
 
@@ -123,11 +124,11 @@ module Bundler
123
124
  Bundler.ui.confirm message
124
125
 
125
126
  path = cached_gem(spec)
126
- if Bundler.requires_sudo?
127
+ if requires_sudo?
127
128
  install_path = Bundler.tmp(spec.full_name)
128
129
  bin_path = install_path.join("bin")
129
130
  else
130
- install_path = Bundler.rubygems.gem_dir
131
+ install_path = rubygems_dir
131
132
  bin_path = Bundler.system_bindir
132
133
  end
133
134
 
@@ -142,12 +143,13 @@ module Bundler
142
143
  :env_shebang => true
143
144
  ).install
144
145
  end
146
+ spec.full_gem_path = installed_spec.full_gem_path
145
147
 
146
148
  # SUDO HAX
147
- if Bundler.requires_sudo?
149
+ if requires_sudo?
148
150
  Bundler.rubygems.repository_subdirectories.each do |name|
149
151
  src = File.join(install_path, name, "*")
150
- dst = File.join(Bundler.rubygems.gem_dir, name)
152
+ dst = File.join(rubygems_dir, name)
151
153
  if name == "extensions" && Dir.glob(src).any?
152
154
  src = File.join(src, "*/*")
153
155
  ext_src = Dir.glob(src).first
@@ -173,7 +175,7 @@ module Bundler
173
175
 
174
176
  spec.post_install_message
175
177
  ensure
176
- Bundler.rm_rf(install_path) if Bundler.requires_sudo?
178
+ Bundler.rm_rf(install_path) if requires_sudo?
177
179
  end
178
180
 
179
181
  def cache(spec, custom_path = nil)
@@ -247,7 +249,7 @@ module Bundler
247
249
  end
248
250
 
249
251
  def loaded_from(spec)
250
- "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec"
252
+ "#{rubygems_dir}/specifications/#{spec.full_name}.gemspec"
251
253
  end
252
254
 
253
255
  def cached_gem(spec)
@@ -315,8 +317,7 @@ module Bundler
315
317
  @cached_specs ||= begin
316
318
  idx = installed_specs.dup
317
319
 
318
- path = Bundler.app_cache
319
- Dir["#{path}/*.gem"].each do |gemfile|
320
+ Dir["#{cache_path}/*.gem"].each do |gemfile|
320
321
  next if gemfile =~ /^bundler\-[\d\.]+?\.gem/
321
322
  s ||= Bundler.rubygems.spec_from_gem(gemfile)
322
323
  s.source = self
@@ -343,7 +344,7 @@ module Bundler
343
344
 
344
345
  # because ensuring we have all the gems we need involves downloading
345
346
  # the gemspecs of those gems, if the non-api sites contain more than
346
- # about 100 gems, we just treat all sites as non-api for speed.
347
+ # about 100 gems, we treat all sites as non-api for speed.
347
348
  allow_api = idx.size < API_REQUEST_LIMIT && dependency_names.size < API_REQUEST_LIMIT
348
349
  Bundler.ui.debug "Need to query more than #{API_REQUEST_LIMIT} gems." \
349
350
  " Downloading full index instead..." unless allow_api
@@ -401,16 +402,16 @@ module Bundler
401
402
  uri = spec.remote.uri
402
403
  spec.fetch_platform
403
404
 
404
- download_path = Bundler.requires_sudo? ? Bundler.tmp(spec.full_name) : Bundler.rubygems.gem_dir
405
- gem_path = "#{Bundler.rubygems.gem_dir}/cache/#{spec.full_name}.gem"
405
+ download_path = requires_sudo? ? Bundler.tmp(spec.full_name) : rubygems_dir
406
+ gem_path = "#{rubygems_dir}/cache/#{spec.full_name}.gem"
406
407
 
407
408
  SharedHelpers.filesystem_access("#{download_path}/cache") do |p|
408
409
  FileUtils.mkdir_p(p)
409
410
  end
410
411
  Bundler.rubygems.download_gem(spec, uri, download_path)
411
412
 
412
- if Bundler.requires_sudo?
413
- SharedHelpers.filesystem_access("#{Bundler.rubygems.gem_dir}/cache") do |p|
413
+ if requires_sudo?
414
+ SharedHelpers.filesystem_access("#{rubygems_dir}/cache") do |p|
414
415
  Bundler.mkdir_p(p)
415
416
  end
416
417
  Bundler.sudo "mv #{download_path}/cache/#{spec.full_name}.gem #{gem_path}"
@@ -418,7 +419,7 @@ module Bundler
418
419
 
419
420
  gem_path
420
421
  ensure
421
- Bundler.rm_rf(download_path) if Bundler.requires_sudo?
422
+ Bundler.rm_rf(download_path) if requires_sudo?
422
423
  end
423
424
 
424
425
  def builtin_gem?(spec)
@@ -432,6 +433,18 @@ module Bundler
432
433
  def installed?(spec)
433
434
  installed_specs[spec].any?
434
435
  end
436
+
437
+ def requires_sudo?
438
+ Bundler.requires_sudo?
439
+ end
440
+
441
+ def rubygems_dir
442
+ Bundler.rubygems.gem_dir
443
+ end
444
+
445
+ def cache_path
446
+ Bundler.app_cache
447
+ end
435
448
  end
436
449
  end
437
450
  end
@@ -12,7 +12,11 @@ module Bundler
12
12
  end
13
13
 
14
14
  def add_path_source(options = {})
15
- add_source_to_list Source::Path.new(options), path_sources
15
+ if options["gemspec"]
16
+ add_source_to_list Source::Gemspec.new(options), path_sources
17
+ else
18
+ add_source_to_list Source::Path.new(options), path_sources
19
+ end
16
20
  end
17
21
 
18
22
  def add_git_source(options = {})
@@ -7,7 +7,7 @@ module Bundler
7
7
  extend Forwardable
8
8
  include TSort, Enumerable
9
9
 
10
- def_delegators :@specs, :<<, :length, :add, :remove
10
+ def_delegators :@specs, :<<, :length, :add, :remove, :size
11
11
  def_delegators :sorted, :each
12
12
 
13
13
  def initialize(specs)
@@ -117,8 +117,8 @@ module Bundler
117
117
  rescue TSort::Cyclic => error
118
118
  cgems = extract_circular_gems(error)
119
119
  raise CyclicDependencyError, "Your bundle requires gems that depend" \
120
- " depend on each other, creating an infinite loop. Please remove" \
121
- " either gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
120
+ " on each other, creating an infinite loop. Please remove either" \
121
+ " gem '#{cgems[1]}' or gem '#{cgems[0]}' and try again."
122
122
  end
123
123
  end
124
124
 
@@ -0,0 +1,21 @@
1
+ -----BEGIN CERTIFICATE-----
2
+ MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
3
+ A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
4
+ b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
5
+ MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
6
+ YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
7
+ aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
8
+ jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
9
+ xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
10
+ 1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
11
+ snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
12
+ U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
13
+ 9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
14
+ BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
15
+ AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
16
+ yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
17
+ 38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
18
+ AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
19
+ DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
20
+ HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
21
+ -----END CERTIFICATE-----
@@ -1,24 +1,41 @@
1
- # Contributor Code of Conduct
1
+ # Contributor Covenant Code of Conduct
2
2
 
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
3
+ ## Our Pledge
7
4
 
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
12
22
 
13
23
  Examples of unacceptable behavior by participants include:
14
24
 
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
18
28
  * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
22
39
 
23
40
  Project maintainers have the right and responsibility to remove, edit, or
24
41
  reject comments, commits, code, wiki edits, issues, and other contributions
@@ -26,24 +43,32 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
26
43
  permanently any contributor for other behaviors that they deem inappropriate,
27
44
  threatening, offensive, or harmful.
28
45
 
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
33
54
 
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
55
+ ## Enforcement
36
56
 
37
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at <%=config[:email]%>. All
58
+ reported by contacting the project team at <%= config[:email] %>. All
39
59
  complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
43
69
 
44
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
47
72
 
48
73
  [homepage]: http://contributor-covenant.org
49
- [version]: http://contributor-covenant.org/version/1/3/0/
74
+ [version]: http://contributor-covenant.org/version/1/4/
@@ -21,10 +21,13 @@ Gem::Specification.new do |spec|
21
21
  if spec.respond_to?(:metadata)
22
22
  spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
23
23
  else
24
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
24
+ raise "RubyGems 2.0 or newer is required to protect against " \
25
+ "public gem pushes."
25
26
  end
26
27
 
27
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
29
+ f.match(%r{^(test|spec|features)/})
30
+ end
28
31
  spec.bindir = "exe"
29
32
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
33
  spec.require_paths = ["lib"]
@@ -1,11 +1,11 @@
1
- require 'spec_helper'
1
+ require "spec_helper"
2
2
 
3
3
  describe <%= config[:constant_name] %> do
4
- it 'has a version number' do
4
+ it "has a version number" do
5
5
  expect(<%= config[:constant_name] %>::VERSION).not_to be nil
6
6
  end
7
7
 
8
- it 'does something useful' do
8
+ it "does something useful" do
9
9
  expect(false).to eq(true)
10
10
  end
11
11
  end
@@ -1,2 +1,2 @@
1
- $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- require '<%= config[:namespaced_path] %>'
1
+ $LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
2
+ require "<%= config[:namespaced_path] %>"
@@ -17,6 +17,10 @@ module Bundler
17
17
  @warning_history = []
18
18
  end
19
19
 
20
+ def add_color(string, color)
21
+ @shell.set_color(string, color)
22
+ end
23
+
20
24
  def info(msg, newline = nil)
21
25
  tell_me(msg, nil, newline) if level("info")
22
26
  end
@@ -2,6 +2,9 @@
2
2
  module Bundler
3
3
  module UI
4
4
  class Silent
5
+ def add_color(string, color)
6
+ end
7
+
5
8
  def info(message, newline = nil)
6
9
  end
7
10
 
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+ module Bundler
3
+ module URICredentialsFilter
4
+ module_function
5
+
6
+ def credential_filtered_uri(uri_to_anonymize)
7
+ return uri_to_anonymize if uri_to_anonymize.nil?
8
+ uri = uri_to_anonymize.dup
9
+ uri = URI(uri.to_s) unless uri.is_a?(URI)
10
+ if uri.userinfo
11
+ # oauth authentication
12
+ if uri.password == "x-oauth-basic" || uri.password == "x"
13
+ # URI as string does not display with password if no user is set
14
+ oauth_designation = uri.password
15
+ uri.user = oauth_designation
16
+ end
17
+ uri.password = nil
18
+ end
19
+ return uri if uri_to_anonymize.is_a?(URI)
20
+ return uri.to_s if uri_to_anonymize.is_a?(String)
21
+ rescue URI::InvalidURIError # uri is not canonical uri scheme
22
+ uri
23
+ end
24
+
25
+ def credential_filtered_string(str_to_filter, uri)
26
+ return str_to_filter if uri.nil? || str_to_filter.nil?
27
+ str_with_no_credentials = str_to_filter.dup
28
+ anonymous_uri_str = credential_filtered_uri(uri).to_s
29
+ uri_str = uri.to_s
30
+ if anonymous_uri_str != uri_str
31
+ str_with_no_credentials = str_with_no_credentials.gsub(uri_str, anonymous_uri_str)
32
+ end
33
+ str_with_no_credentials
34
+ end
35
+ end
36
+ end
@@ -50,7 +50,7 @@ class Bundler::CompactIndexClient
50
50
  mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"
51
51
  local_temp_path.open(mode) {|f| f << content }
52
52
 
53
- response_etag = response["ETag"].gsub(%r{\AW/}, "")
53
+ response_etag = response["ETag"]
54
54
  if etag_for(local_temp_path) == response_etag
55
55
  FileUtils.mv(local_temp_path, local_path)
56
56
  return
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+ module Bundler::Molinillo
3
+ # @!visibility private
4
+ module Delegates
5
+ # Delegates all {Bundler::Molinillo::ResolutionState} methods to a `#state` property.
6
+ module ResolutionState
7
+ # (see Bundler::Molinillo::ResolutionState#name)
8
+ def name
9
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
10
+ current_state.name
11
+ end
12
+
13
+ # (see Bundler::Molinillo::ResolutionState#requirements)
14
+ def requirements
15
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
16
+ current_state.requirements
17
+ end
18
+
19
+ # (see Bundler::Molinillo::ResolutionState#activated)
20
+ def activated
21
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
22
+ current_state.activated
23
+ end
24
+
25
+ # (see Bundler::Molinillo::ResolutionState#requirement)
26
+ def requirement
27
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
28
+ current_state.requirement
29
+ end
30
+
31
+ # (see Bundler::Molinillo::ResolutionState#possibilities)
32
+ def possibilities
33
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
34
+ current_state.possibilities
35
+ end
36
+
37
+ # (see Bundler::Molinillo::ResolutionState#depth)
38
+ def depth
39
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
40
+ current_state.depth
41
+ end
42
+
43
+ # (see Bundler::Molinillo::ResolutionState#conflicts)
44
+ def conflicts
45
+ current_state = state || Bundler::Molinillo::ResolutionState.empty
46
+ current_state.conflicts
47
+ end
48
+ end
49
+ end
50
+ end