bindler 0.1.2 → 0.1.3
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/Gemfile.lock +1 -1
- data/lib/bindler/bend_vagrant.rb +48 -8
- data/lib/bindler/logging.rb +4 -0
- data/lib/bindler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ee682fcd6eb61c143513850d676616ce96b6d1f
|
4
|
+
data.tar.gz: f5dc7c1baef26adea185c238c76958034d37688d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbf6923420ca24f3a20c270739e732baa1eadde4b019e0963cd9e821fd1339d7187b07b6f12c95395723448a123bd11676719e3ef4fc2f9d2babe9493bfc0e06
|
7
|
+
data.tar.gz: 75f19d62c42e6060e99c4f569d014fc2916d773a6e0903694566596b1af21d9381957da49341191083a5b088a3f6db60b668cca00f2c58b2eac539907c4f13e9
|
data/Gemfile.lock
CHANGED
data/lib/bindler/bend_vagrant.rb
CHANGED
@@ -17,22 +17,61 @@ Vagrant::Environment.class_eval do
|
|
17
17
|
alias old_hook hook
|
18
18
|
def hook(name)
|
19
19
|
unless @__custom_plugins_loaded
|
20
|
-
|
21
|
-
|
20
|
+
if bindler_plugins_file
|
21
|
+
bindler_debug 'Loading local plugins...'
|
22
|
+
__load_local_plugins
|
23
|
+
else
|
24
|
+
lookup_paths = VagrantPlugins::Bindler::LocalPluginsManifestExt::PLUGINS_JSON_LOOKUP
|
25
|
+
bindler_debug "Local plugins manifest file not found, looked into #{lookup_paths.inspect}"
|
26
|
+
end
|
27
|
+
|
28
|
+
bindler_debug 'Loading plugins installed globally...'
|
29
|
+
__load_global_plugins
|
22
30
|
|
23
31
|
@__custom_plugins_loaded = true
|
24
32
|
end
|
25
33
|
old_hook name
|
26
34
|
end
|
27
35
|
|
28
|
-
# This method loads plugins from
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
# This method loads plugins from `~/.vagrant.d/global-plugins.json` file
|
37
|
+
#
|
38
|
+
# It is basically a Copy & Paste from Vagrant::Environment#load_plugins [1]
|
39
|
+
#
|
40
|
+
# [1] https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/environment.rb#L720-L754
|
41
|
+
#
|
42
|
+
# DISCUSS: What if vagrant had a way of setting the path for the manifest file
|
43
|
+
# for the whole environment?
|
44
|
+
def __load_global_plugins
|
45
|
+
# If we're in a Bundler environment, don't load plugins. This only
|
46
|
+
# happens in plugin development environments.
|
47
|
+
if defined?(Bundler)
|
48
|
+
require 'bundler/shared_helpers'
|
49
|
+
if Bundler::SharedHelpers.in_bundle?
|
50
|
+
@logger.warn("In a bundler environment, not loading environment plugins!")
|
51
|
+
return
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
# Load the plugins
|
56
|
+
plugins_json_file = @home_path.join("global-plugins.json")
|
57
|
+
bindler_debug("Loading plugins from: #{plugins_json_file}")
|
58
|
+
if plugins_json_file.file?
|
59
|
+
data = JSON.parse(plugins_json_file.read)
|
60
|
+
data["installed"].each do |plugin|
|
61
|
+
bindler_info("Loading plugin from JSON: #{plugin}")
|
62
|
+
begin
|
63
|
+
Vagrant.require_plugin(plugin)
|
64
|
+
rescue Vagrant::Errors::PluginLoadError => e
|
65
|
+
@ui.error(e.message + "\n")
|
66
|
+
rescue Vagrant::Errors::PluginLoadFailed => e
|
67
|
+
@ui.error(e.message + "\n")
|
68
|
+
end
|
69
|
+
end
|
34
70
|
end
|
71
|
+
end
|
35
72
|
|
73
|
+
# This method loads plugins from a project specific `plugins.json` file
|
74
|
+
def __load_local_plugins
|
36
75
|
ARGV.each do |arg|
|
37
76
|
if !arg.start_with?("-") && arg == 'bindler'
|
38
77
|
bindler_debug 'bindler command detected, setting VAGRANT_NO_PLUGINS to 1'
|
@@ -47,6 +86,7 @@ Vagrant::Environment.class_eval do
|
|
47
86
|
end
|
48
87
|
|
49
88
|
# Prepend our local gem path and reset the paths that Rubygems knows about.
|
89
|
+
bindler_debug 'Tweaking GEM_HOME'
|
50
90
|
ENV["GEM_PATH"] = "#{local_data_path.join('gems')}#{::File::PATH_SEPARATOR}#{ENV["GEM_PATH"]}"
|
51
91
|
::Gem.clear_paths
|
52
92
|
|
data/lib/bindler/logging.rb
CHANGED
data/lib/bindler/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bindler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Rehm
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|