vagrant-group 0.8.1 → 0.8.2.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f2a416c04db932ac362b1e2cde2d5c811831bd92
4
- data.tar.gz: a9bc0f5a75c7585e435a5e43af8a0389f719a274
3
+ metadata.gz: 037f506c60cb2490265cc415f1a6adbd192c9708
4
+ data.tar.gz: 35c837b18164c383e072634b855c8615a5862abf
5
5
  SHA512:
6
- metadata.gz: 2f3d9856ed8b0dbcf6ee6159a0c7f0f56ef0cd844ed9ee690d5b9624007cbd359b15a6140e7da8c1b9801df2964357f5ed1212ac09d3c66b3f695a3b2c87212a
7
- data.tar.gz: e924a6c08a31dfeed08a59870fff3ec28839a4ea7c719b97a4be4fe69b009a0879853364f7f47b432c5218bd8457b8c02ebdb1636a207e250d380c44a58cf2d4
6
+ metadata.gz: 2c8012fa9b7c7b5ebcb8b8741c2a5c97afde8ed70e1a2c48e44c94b52d399ab5edc43197b9dbcda53c98ee7afd0f40eb7c937da3b243a57d744034f8391b2723
7
+ data.tar.gz: 6975c418a5082fed5c7f19e481f22d66f955314308e97592908c3be51c19e33b0b96b470705bbbf7bb6e3d2f72a5683a1891c378899e141db9a9358e8e312e65
@@ -5,15 +5,15 @@ module VagrantPlugins
5
5
  COMMANDS = %w(up halt destroy provision reload hosts suspend resume)
6
6
 
7
7
  def self.synopsis
8
- "runs vagrant command on specific group of VMs"
8
+ 'runs vagrant command on specific group of VMs'
9
9
  end # self.synopsis
10
10
 
11
11
  def execute
12
12
  options = {
13
- :provision_ignore_sentinel => false, # otherwise reload command does provision
13
+ provision_ignore_sentinel: false, # otherwise reload command does provision
14
14
  }
15
15
  opts = OptionParser.new do |o|
16
- o.banner = sprintf("Usage: vagrant group <%s> <group-name>", COMMANDS.join("|"))
16
+ o.banner = sprintf('Usage: vagrant group <%s> <group-name>', COMMANDS.join('|'))
17
17
  o.separator ''
18
18
 
19
19
  o.on('-h', '--help', 'Print this help') do
@@ -33,7 +33,8 @@ module VagrantPlugins
33
33
 
34
34
  argv = parse_options(opts)
35
35
 
36
- action, pattern = argv[0], argv[1]
36
+ action = argv[0]
37
+ pattern = argv[1]
37
38
 
38
39
  if !pattern || !action || !COMMANDS.include?(action)
39
40
  safe_puts(opts.help)
@@ -50,7 +51,7 @@ module VagrantPlugins
50
51
  groups.each do |group|
51
52
  print_hosts(group)
52
53
  end
53
- elsif
54
+ else
54
55
  groups.each do |group|
55
56
  do_action(action, options, group)
56
57
  end
@@ -58,14 +59,14 @@ module VagrantPlugins
58
59
  end # execute
59
60
 
60
61
  def print_hosts(group)
61
- @env.ui.info(sprintf('Hosts in %s group:', group))
62
+ @env.ui.info("Hosts in #{group} group:")
62
63
 
63
- with_target_vms() do |machine|
64
- if machine.config.group.groups.has_key?(group)
64
+ with_target_vms do |machine|
65
+ if machine.config.group.groups.key?(group)
65
66
  if machine.config.group.groups[group].to_a.include? machine.name.to_s
66
- @env.ui.info(sprintf(' - %s', machine.name))
67
+ @env.ui.info(" - #{machine.name}")
67
68
  end
68
- elsif
69
+ else
69
70
  @env.ui.warn('No hosts associated.')
70
71
  break
71
72
  end
@@ -73,8 +74,8 @@ module VagrantPlugins
73
74
  end # print_hosts
74
75
 
75
76
  def do_action(action, options, group)
76
- with_target_vms() do |machine|
77
- if machine.config.group.groups.has_key?(group)
77
+ with_target_vms do |machine|
78
+ if machine.config.group.groups.key?(group)
78
79
  if machine.config.group.groups[group].include? machine.name.to_s
79
80
  machine.action(action, **options)
80
81
  end
@@ -85,19 +86,19 @@ module VagrantPlugins
85
86
  def all_groups
86
87
  groups = Set.new
87
88
 
88
- with_target_vms() do |machine|
89
- machine.config.group.groups.to_h.each do |group_name, hosts|
89
+ with_target_vms do |machine|
90
+ machine.config.group.groups.to_h.each do |group_name, _hosts|
90
91
  groups << group_name
91
92
  end
92
93
  end
93
94
 
94
- return groups.to_a
95
+ groups.to_a
95
96
  end # all_groups
96
97
 
97
98
  def find_groups(pattern)
98
99
  groups = []
99
100
 
100
- if pattern[0] == "/" && pattern[-1] == "/"
101
+ if pattern[0] == '/' && pattern[-1] == '/'
101
102
  reg = Regexp.new(pattern[1..-2])
102
103
  all_groups.each do |item|
103
104
  groups << item if item.match(reg)
@@ -1,7 +1,6 @@
1
1
  module VagrantPlugins
2
2
  module Group
3
3
  class Config < Vagrant.plugin(2, :config)
4
-
5
4
  attr_accessor :groups
6
5
 
7
6
  def initialize
@@ -11,7 +10,6 @@ module VagrantPlugins
11
10
  def finalize!
12
11
  @groups = {} if @groups == UNSET_VALUE
13
12
  end
14
-
15
13
  end # Config
16
14
  end # Group
17
15
  end # VagrantPlugins
@@ -1,7 +1,6 @@
1
1
  module VagrantPlugins
2
2
  module Group
3
3
  class Plugin < Vagrant.plugin(2)
4
-
5
4
  name 'vagrant-vm-group'
6
5
  description 'Plugin allows to group VMs'
7
6
 
@@ -14,7 +13,6 @@ module VagrantPlugins
14
13
  require_relative 'config'
15
14
  Config
16
15
  end
17
-
18
16
  end # Plugin
19
17
  end # Group
20
18
  end # VagrantPlugins
@@ -1,7 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Group
3
-
4
- VERSION = "0.8.1"
5
-
3
+ VERSION = '0.8.2.pre'
6
4
  end # Group
7
5
  end # VagrantPlugins
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["krzysztof@magosa.pl"]
11
11
  spec.summary = "Plugin allows to create groups of hosts and perform basic commands on them."
12
12
  # spec.description = %q{TODO: Write a longer description. Optional.}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/vagrant-group/vagrant-group"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-group
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2.pre
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-21 00:00:00.000000000 Z
11
+ date: 2015-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  description:
@@ -45,7 +45,7 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
48
+ - ".gitignore"
49
49
  - Gemfile
50
50
  - LICENSE.txt
51
51
  - README.md
@@ -56,7 +56,7 @@ files:
56
56
  - lib/vagrant-group/plugin.rb
57
57
  - lib/vagrant-group/version.rb
58
58
  - vagrant-group.gemspec
59
- homepage: ''
59
+ homepage: https://github.com/vagrant-group/vagrant-group
60
60
  licenses:
61
61
  - MIT
62
62
  metadata: {}
@@ -66,17 +66,17 @@ require_paths:
66
66
  - lib
67
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">"
75
75
  - !ruby/object:Gem::Version
76
- version: '0'
76
+ version: 1.3.1
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 2.0.14
79
+ rubygems_version: 2.4.5.1
80
80
  signing_key:
81
81
  specification_version: 4
82
82
  summary: Plugin allows to create groups of hosts and perform basic commands on them.