bundler-source-vault 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/plugins.rb +33 -14
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9dd9d758331183b7fe023c975f48730512d8bb5b40bd97bd6b3ab97e39836b7
|
|
4
|
+
data.tar.gz: c9b20bd237cf149953cae0f50921b16018f9fa2a75dfb3d4124b90851fac9f78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc6d4456bb45e43ce03903820d3a8b17ec077cadca5e6b0aeca8428a5dd85999e1d6ec05d23fd3eb942114d1f4f96095bfb6fe3fc9b61bd8a65f54136ac0662a
|
|
7
|
+
data.tar.gz: 91eb3531d515d09e60506bd2d1977fce87a8f92fa91fd5fc08f9759efefa493742a35e5d3feedacfec2f3a9d68c9837ab7d89d43c3f0b013c05b66b0e5b3c2d5
|
data/plugins.rb
CHANGED
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
# Bundler installs plugin dependencies (
|
|
2
|
-
# does not
|
|
3
|
-
#
|
|
4
|
-
#
|
|
1
|
+
# Bundler installs plugin dependencies (here: gemvault) alongside the plugin
|
|
2
|
+
# but does not put them on the load path before loading plugins.rb -- see the
|
|
3
|
+
# "Currently not done to avoid conflicts" comment in bundler/plugin.rb. The
|
|
4
|
+
# require below must resolve gemvault through RubyGems itself, so every gem
|
|
5
|
+
# root that may hold gemvault has to be visible to Gem::Specification first.
|
|
5
6
|
#
|
|
6
|
-
# Work around by registering Plugin.root as a gem search path so dependencies
|
|
7
|
-
# installed there are activatable via `require`.
|
|
8
7
|
# Development: when loaded from within the gemvault source tree, the gemvault
|
|
9
|
-
# gem isn't installed so its lib/ must be on $LOAD_PATH for the require below.
|
|
10
|
-
gemvault_lib =
|
|
11
|
-
$LOAD_PATH.unshift(gemvault_lib)
|
|
8
|
+
# gem isn't installed, so its lib/ must be on $LOAD_PATH for the require below.
|
|
9
|
+
gemvault_lib = Pathname(__dir__).parent.join("lib")
|
|
10
|
+
$LOAD_PATH.unshift(gemvault_lib.to_s) if gemvault_lib.directory? && !$LOAD_PATH.include?(gemvault_lib.to_s)
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
# Installed, this file lives at <gem root>/gems/bundler-source-vault-<v>/, and
|
|
13
|
+
# gemvault sits in the same root: Bundler's local or global plugin root, or a
|
|
14
|
+
# plain GEM_HOME when installed with `gem install`. Bundler's plugin roots are
|
|
15
|
+
# also candidates because `Bundler::Plugin.root` is the project-local root even
|
|
16
|
+
# when the plugin actually loads from the global one.
|
|
17
|
+
plugin_roots = defined?(Bundler::Plugin) ? [Bundler::Plugin.root, Bundler::Plugin.global_root] : []
|
|
18
|
+
gem_root = Pathname(__dir__).parent.parent
|
|
19
|
+
candidate_dirs = [gem_root, *plugin_roots]
|
|
20
|
+
.map { |root| Pathname(root.to_s).join("specifications") }
|
|
21
|
+
.uniq
|
|
22
|
+
.select(&:directory?)
|
|
23
|
+
|
|
24
|
+
searched_dirs = Gem::Specification.dirs.map { |dir| Pathname(dir) }
|
|
25
|
+
unsearched_dirs = candidate_dirs - searched_dirs
|
|
26
|
+
|
|
27
|
+
if unsearched_dirs.any?
|
|
28
|
+
Gem::Specification.dirs = (searched_dirs + unsearched_dirs).map { |dir| dir.parent.to_s }
|
|
29
|
+
elsif candidate_dirs.any?
|
|
30
|
+
begin
|
|
31
|
+
Gem::Specification.find_by_name("gemvault")
|
|
32
|
+
rescue Gem::LoadError
|
|
33
|
+
# The searched dirs are right but the spec cache predates this install:
|
|
34
|
+
# `bundle plugin install` switches GEM_HOME to the plugin root and caches
|
|
35
|
+
# specs during resolution, before gemvault lands there.
|
|
36
|
+
Gem::Specification.reset
|
|
18
37
|
end
|
|
19
38
|
end
|
|
20
39
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bundler-source-vault
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Gillis
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.2.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.2.0
|
|
26
26
|
description: Registers the :vault source type with Bundler, enabling gem installation
|
|
27
27
|
from .gemv vault files
|
|
28
28
|
email:
|