vagrant-plugins 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ # v0.2.2
2
+
3
+ * include this plugin to the list of *buildin plugins*, which will cause it the be hidden by default.
4
+ * get the "no plugins" detection working.
5
+
1
6
  # v0.2.1
2
7
 
3
8
  * fixes false positive feature detection for comfigs and commands
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
- if Vagrant.plugin("1").registered.empty?
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
- else
39
+ # return a falsy value to the shell
40
+ return 1
41
+ end
33
42
 
34
- builtins = VagrantPlugins.constants.map { |p|
35
- VagrantPlugininspection::Inflector::constantize("VagrantPlugins::#{p}::Plugin")
36
- } if !options[:all]
37
-
38
- plugins = Vagrant.plugin("1").registered.map { |plugin|
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
- info.merge!({
46
- :hosts => !!plugin.data[:hosts],
47
- :guests => !!plugin.data[:guests],
48
- :provisioners => !!plugin.data[:provisioners],
49
- :commands => plugin.data[:command] && !plugin.command.to_hash.empty?,
50
- :action_hooks => !!plugin.data[:action_hooks],
51
- :configs => plugin.data[:config] && !plugin.config.to_hash.empty?,
52
- }) if options[:verbose]
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
- # return the plugins info Hash
55
- info
56
- end
57
- }.compact
58
+ # return the plugins info Hash
59
+ info
60
+ }.compact
58
61
 
59
- if options[:verbose] && !options[:no_heads]
60
- head = <<-EOS
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
- ui.info head, :prefix => false
69
- end
71
+ ui.info head, :prefix => false
72
+ end
70
73
 
71
- ui.print_columns(plugins, :heads => !options[:no_heads]) do
72
- if options[:verbose]
73
- column :hosts, :name => '|'
74
- column :guests, :name => '|'
75
- column :provisioners, :name => '|'
76
- column :commands, :name => '|'
77
- column :action_hooks, :name => '|'
78
- column :configs, :name => '|'
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
- end
88
-
89
- end
88
+
89
+ end # execute
90
+ end # Command
90
91
  end
@@ -1,3 +1,3 @@
1
1
  module VagrantPlugininspection
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  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.1
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-16 00:00:00.000000000 Z
12
+ date: 2012-05-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant