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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +15 -13
- data/.travis.yml +2 -2
- data/CHANGELOG.md +40 -3
- data/CONTRIBUTING.md +9 -5
- data/DEVELOPMENT.md +30 -18
- data/ISSUES.md +26 -22
- data/Rakefile +15 -4
- data/bin/rubocop +1 -1
- data/bundler.gemspec +2 -2
- data/exe/bundle +7 -0
- data/lib/bundler.rb +6 -3
- data/lib/bundler/capistrano.rb +1 -1
- data/lib/bundler/cli.rb +27 -10
- data/lib/bundler/cli/binstubs.rb +2 -0
- data/lib/bundler/cli/exec.rb +1 -1
- data/lib/bundler/cli/install.rb +87 -56
- data/lib/bundler/cli/lock.rb +5 -0
- data/lib/bundler/cli/open.rb +3 -1
- data/lib/bundler/cli/outdated.rb +8 -8
- data/lib/bundler/cli/plugin.rb +23 -0
- data/lib/bundler/cli/update.rb +2 -2
- data/lib/bundler/cli/viz.rb +3 -0
- data/lib/bundler/definition.rb +72 -16
- data/lib/bundler/dsl.rb +19 -7
- data/lib/bundler/endpoint_specification.rb +2 -2
- data/lib/bundler/env.rb +2 -2
- data/lib/bundler/errors.rb +15 -1
- data/lib/bundler/fetcher.rb +5 -2
- data/lib/bundler/fetcher/compact_index.rb +2 -2
- data/lib/bundler/fetcher/dependency.rb +8 -4
- data/lib/bundler/fetcher/downloader.rb +1 -1
- data/lib/bundler/friendly_errors.rb +1 -1
- data/lib/bundler/index.rb +29 -36
- data/lib/bundler/inline.rb +14 -4
- data/lib/bundler/installer.rb +22 -3
- data/lib/bundler/installer/gem_installer.rb +1 -1
- data/lib/bundler/installer/standalone.rb +1 -1
- data/lib/bundler/mirror.rb +4 -4
- data/lib/bundler/plugin.rb +156 -0
- data/lib/bundler/plugin/api.rb +56 -0
- data/lib/bundler/plugin/dsl.rb +29 -0
- data/lib/bundler/plugin/index.rb +88 -0
- data/lib/bundler/plugin/installer.rb +99 -0
- data/lib/bundler/plugin/installer/git.rb +38 -0
- data/lib/bundler/plugin/installer/rubygems.rb +27 -0
- data/lib/bundler/plugin/source_list.rb +24 -0
- data/lib/bundler/postit_trampoline.rb +54 -0
- data/lib/bundler/psyched_yaml.rb +1 -1
- data/lib/bundler/remote_specification.rb +5 -5
- data/lib/bundler/resolver.rb +27 -29
- data/lib/bundler/ruby_version.rb +29 -3
- data/lib/bundler/rubygems_ext.rb +3 -1
- data/lib/bundler/rubygems_integration.rb +10 -4
- data/lib/bundler/runtime.rb +1 -16
- data/lib/bundler/settings.rb +19 -15
- data/lib/bundler/setup.rb +1 -0
- data/lib/bundler/shared_helpers.rb +3 -0
- data/lib/bundler/source.rb +4 -3
- data/lib/bundler/source/gemspec.rb +13 -0
- data/lib/bundler/source/git.rb +4 -3
- data/lib/bundler/source/git/git_proxy.rb +9 -5
- data/lib/bundler/source/path.rb +11 -2
- data/lib/bundler/source/rubygems.rb +28 -15
- data/lib/bundler/source_list.rb +5 -1
- data/lib/bundler/spec_set.rb +3 -3
- data/lib/bundler/ssl_certs/index.rubygems.org/GlobalSignRootCA.pem +21 -0
- data/lib/bundler/ssl_certs/rubygems.org/{AddTrustExternalCARoot-2048.pem → AddTrustExternalCARoot.pem} +0 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +54 -29
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +5 -2
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +3 -3
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -2
- data/lib/bundler/ui/shell.rb +4 -0
- data/lib/bundler/ui/silent.rb +3 -0
- data/lib/bundler/uri_credentials_filter.rb +36 -0
- data/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +50 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +80 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +56 -144
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +35 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +58 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +61 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +53 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +114 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +45 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +35 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +123 -0
- data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
- data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +46 -51
- data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +4 -2
- data/lib/bundler/vendor/postit/lib/postit.rb +15 -0
- data/lib/bundler/vendor/postit/lib/postit/environment.rb +44 -0
- data/lib/bundler/vendor/postit/lib/postit/installer.rb +28 -0
- data/lib/bundler/vendor/postit/lib/postit/parser.rb +21 -0
- data/lib/bundler/vendor/postit/lib/postit/setup.rb +12 -0
- data/lib/bundler/vendor/postit/lib/postit/version.rb +3 -0
- data/lib/bundler/version.rb +1 -1
- data/lib/bundler/vlad.rb +1 -1
- data/lib/bundler/yaml_serializer.rb +67 -0
- data/man/bundle-install.ronn +10 -5
- data/man/bundle-package.ronn +7 -6
- data/man/bundle-platform.ronn +1 -1
- data/man/bundle-update.ronn +5 -2
- data/man/bundle.ronn +5 -5
- data/man/gemfile.5.ronn +32 -28
- metadata +37 -12
- data/lib/bundler/ssl_certs/Fastly.pem +0 -82
- data/lib/bundler/ssl_certs/GlobalSignOrganizationValidationCA.pem +0 -26
- data/lib/bundler/ssl_certs/GlobalSignRoot.pem +0 -18
- 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 = [
|
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
|
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 =
|
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
|
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(
|
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
|
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
|
-
"#{
|
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
|
-
|
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
|
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 =
|
405
|
-
gem_path = "#{
|
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
|
413
|
-
SharedHelpers.filesystem_access("#{
|
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
|
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
|
data/lib/bundler/source_list.rb
CHANGED
@@ -12,7 +12,11 @@ module Bundler
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def add_path_source(options = {})
|
15
|
-
|
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 = {})
|
data/lib/bundler/spec_set.rb
CHANGED
@@ -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
|
-
"
|
121
|
-
"
|
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-----
|
File without changes
|
@@ -1,24 +1,41 @@
|
|
1
|
-
# Contributor Code of Conduct
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
2
|
|
3
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
17
|
-
* Trolling
|
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
|
20
|
-
|
21
|
-
* Other
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
|
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
|
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.
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
|
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
|
-
|
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/
|
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
|
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
|
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
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
describe <%= config[:constant_name] %> do
|
4
|
-
it
|
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
|
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(
|
2
|
-
require
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
+
require "<%= config[:namespaced_path] %>"
|
data/lib/bundler/ui/shell.rb
CHANGED
data/lib/bundler/ui/silent.rb
CHANGED
@@ -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"]
|
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
|