vagrant-plugins 0.2.1 → 0.2.2
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.
- data/CHANGELOG.md +5 -0
- data/README.md +22 -1
- data/lib/vagrant-plugins/command.rb +45 -44
- data/lib/vagrant-plugins/version.rb +1 -1
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -31,10 +31,31 @@ Vagrant.require_plugin 'vagrant-plugins'
|
|
31
31
|
## Usage
|
32
32
|
|
33
33
|
```bash
|
34
|
-
$ vagrant plugins [-a|--all]
|
34
|
+
$ vagrant plugins [-a|--all] [-H|--no-head] [-v|--verbose]
|
35
35
|
```
|
36
36
|
|
37
37
|
* `-a|--all` : Display *vagrant's* builtin plugins as well.
|
38
|
+
* `-H|--no-head` : Do _not_ print descriptive column headings
|
39
|
+
* `-v|--verbose` : Be verbose and display plugin features
|
40
|
+
|
41
|
+
The *verbose* flag will print a check map like this:
|
42
|
+
|
43
|
+
```bash
|
44
|
+
$ vagrant plugins -v
|
45
|
+
+- hosts
|
46
|
+
|+- guests
|
47
|
+
||+- provisioners
|
48
|
+
|||+- commands
|
49
|
+
||||+- action_hooks
|
50
|
+
|||||+- configs
|
51
|
+
|||||| name description
|
52
|
+
------ ------------------ -------------------------------------------------------------------------------------------------------------
|
53
|
+
*** vbguest management Provides automatic and/or manual management of the VirtualBox Guest Additions inside the Vagrant environment.
|
54
|
+
* plugins List all vagrant plugins loaded in the current vagrant environment
|
55
|
+
```
|
56
|
+
|
57
|
+
Note, that the feature columns are not delimited by tab, an asterisk (`*`) will indicate that a feature is present.
|
58
|
+
For example above: *vbguest management* registers *commands*, *action hooks* and *configs*, while *plugins* only registers *commands*.
|
38
59
|
|
39
60
|
## Contributing
|
40
61
|
|
@@ -27,37 +27,40 @@ module VagrantPlugininspection
|
|
27
27
|
|
28
28
|
ui = VagrantPlugininspection::UI::Columnized.new('plugins')
|
29
29
|
|
30
|
-
|
30
|
+
builtins = [VagrantPlugininspection::Plugin]
|
31
|
+
builtins += VagrantPlugins.constants.map { |p|
|
32
|
+
VagrantPlugininspection::Inflector::constantize("VagrantPlugins::#{p}::Plugin")
|
33
|
+
}
|
34
|
+
|
35
|
+
plugins = Vagrant.plugin("1").registered - builtins
|
36
|
+
|
37
|
+
if !options[:all] && plugins.empty?
|
31
38
|
ui.info "No plugins registered"
|
32
|
-
|
39
|
+
# return a falsy value to the shell
|
40
|
+
return 1
|
41
|
+
end
|
33
42
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if options[:all] || !builtins.include?(plugin)
|
40
|
-
info = {
|
41
|
-
:name => plugin.name,
|
42
|
-
:description => plugin.description
|
43
|
-
}
|
43
|
+
infos = (options[:all] ? Vagrant.plugin("1").registered : plugins).map { |plugin|
|
44
|
+
info = {
|
45
|
+
:name => plugin.name,
|
46
|
+
:description => plugin.description
|
47
|
+
}
|
44
48
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
info.merge!({
|
50
|
+
:hosts => !!plugin.data[:hosts],
|
51
|
+
:guests => !!plugin.data[:guests],
|
52
|
+
:provisioners => !!plugin.data[:provisioners],
|
53
|
+
:commands => plugin.data[:command] && !plugin.command.to_hash.empty?,
|
54
|
+
:action_hooks => !!plugin.data[:action_hooks],
|
55
|
+
:configs => plugin.data[:config] && !plugin.config.to_hash.empty?,
|
56
|
+
}) if options[:verbose]
|
53
57
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
}.compact
|
58
|
+
# return the plugins info Hash
|
59
|
+
info
|
60
|
+
}.compact
|
58
61
|
|
59
|
-
|
60
|
-
|
62
|
+
if options[:verbose] && !options[:no_heads]
|
63
|
+
head = <<-EOS
|
61
64
|
+- hosts
|
62
65
|
|+- guests
|
63
66
|
||+- provisioners
|
@@ -65,26 +68,24 @@ module VagrantPlugininspection
|
|
65
68
|
||||+- action_hooks
|
66
69
|
|||||+- configs
|
67
70
|
EOS
|
68
|
-
|
69
|
-
|
71
|
+
ui.info head, :prefix => false
|
72
|
+
end
|
70
73
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
seperator "\t"
|
80
|
-
end
|
81
|
-
column :name
|
74
|
+
ui.print_columns(infos, :heads => !options[:no_heads]) do
|
75
|
+
if options[:verbose]
|
76
|
+
column :hosts, :name => '|'
|
77
|
+
column :guests, :name => '|'
|
78
|
+
column :provisioners, :name => '|'
|
79
|
+
column :commands, :name => '|'
|
80
|
+
column :action_hooks, :name => '|'
|
81
|
+
column :configs, :name => '|'
|
82
82
|
seperator "\t"
|
83
|
-
column :description
|
84
83
|
end
|
85
|
-
|
84
|
+
column :name
|
85
|
+
seperator "\t"
|
86
|
+
column :description
|
86
87
|
end
|
87
|
-
|
88
|
-
|
89
|
-
end
|
88
|
+
|
89
|
+
end # execute
|
90
|
+
end # Command
|
90
91
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: vagrant
|