vagrant-group 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a760544d3f71b0a17d173f8679fae04a8dc0128
4
- data.tar.gz: 3e31e279fc715245f468d8d2c8a664a0a2abf3c3
3
+ metadata.gz: 40fe040fb02b96693012398f6c7ad29f9da9e53f
4
+ data.tar.gz: c13cfca9beb58de17cdd25bb82b9a5cd7eee43c7
5
5
  SHA512:
6
- metadata.gz: 96a0ed8ac11d66a9e188d3b0aa0e2de8a7e0144ca4145b9e044d25826973d85d410c9d16666bbfccb910333afec1449ca574c72d00636627b160e62f81d20775
7
- data.tar.gz: f701445d7c405c6972c2d77e133969ab3f1f665d13b2ac7e06370b6797c208cc3cc2e08fca7fb40995cc0c50746afb23860d582f87d926538aebf6b7a71b5cf4
6
+ metadata.gz: 6fe1074b869a6bf6b519bbbec9fd1024f14d87cfefc842d3240a2bb68f554bc68013b71754d0273175519b52616ba0da1412226079d2d4e575d0b000be8f35df
7
+ data.tar.gz: 778f25785132b31039db9deb480718e6ef835d36c0529d83a5724757e8cf679cd4ba9ab9d84b751f881f17791a1e8a1507b96bbc74a755fb6521be8f15cecec9
@@ -2,6 +2,8 @@ module VagrantPlugins
2
2
  module Group
3
3
  class Command < Vagrant.plugin(2, :command)
4
4
 
5
+ COMMANDS = %w(up halt destroy provision hosts)
6
+
5
7
  def self.synopsis
6
8
  "runs vagrant command on specific group of VMs"
7
9
  end # self.synopsis
@@ -9,7 +11,7 @@ module VagrantPlugins
9
11
  def execute
10
12
  options = {}
11
13
  opts = OptionParser.new do |o|
12
- o.banner = 'Usage: vagrant group <group-name> <up|halt|destroy|provision|hosts>'
14
+ o.banner = sprintf("Usage: vagrant group <group-name> <%s>", COMMANDS.join("|"))
13
15
  o.separator ''
14
16
 
15
17
  o.on('-h', '--help', 'Print this help') do
@@ -21,7 +23,7 @@ module VagrantPlugins
21
23
 
22
24
  group, action = argv[0], argv[1]
23
25
 
24
- if !group || !action || !['up', 'halt', 'destroy', 'provision', 'hosts'].include?(action)
26
+ if !group || !action || !COMMANDS.include?(action)
25
27
  safe_puts(opts.help)
26
28
  return nil
27
29
  end
@@ -31,7 +33,9 @@ module VagrantPlugins
31
33
 
32
34
  with_target_vms() do |machine|
33
35
  if machine.config.group.groups.has_key?(group)
34
- @env.ui.info(sprintf(' - %s', machine.name))
36
+ if machine.config.group.groups[group].to_a.include? machine.name.to_s
37
+ @env.ui.info(sprintf(' - %s', machine.name))
38
+ end
35
39
  elsif
36
40
  @env.ui.warn('No hosts associated.')
37
41
  break
@@ -1,7 +1,7 @@
1
1
  module VagrantPlugins
2
2
  module Group
3
3
 
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
 
6
6
  end # Group
7
7
  end # VagrantPlugins
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-group
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Magosa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-06 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler