vagrant-devcommands 0.7.1 → 0.7.2

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: d5ee9f0199422e98644aad8e3565eee99f0a377c
4
- data.tar.gz: ae0304f6fc9f8cccb74c77ada99a43abb08a3783
3
+ metadata.gz: 2286eb231a9e6537418f0a60167b17b3022f386c
4
+ data.tar.gz: 9faa6c649189f8626c622441c4ff9bb26a37a67c
5
5
  SHA512:
6
- metadata.gz: ea3a8bb6ca2b768c1ea3c9a6f1b00fd07d9647ffa8f0c8b3a5b50aa66d48de79446d3ef9df4abe90b5b3fa00654e8e9f60c3611143c0623814d3a18041ee0640
7
- data.tar.gz: cd6bbefafdb65ee225b2d2fdbef0af2ebba0384c82756216e8ec198952a955b585cf0af0fdefae395e8896c85468d335b71749ba50f65bf7c9e72a0f88b13e06
6
+ metadata.gz: f993ab2fff187f77800617b595e443ff15e3a7b4376bd8a733a0e7c2e30589475fa6790f29ee2d2cc6df910f015a7a7e52758f234966d100a93988096c0ccff6
7
+ data.tar.gz: 3c2ae42e63a90567cb49085f5646143f115db29ec960def9eacce7b0b1704c0c3b717bc5d3c219544c07cfe274fb6923129448ea8fff653b1a76cbf61cfa2e8f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.7.2 (2017-03-12)
4
+
5
+ - Bug fixes
6
+ - Machine names passed via argv are properly detected and used
7
+ ([#1](https://github.com/mneudert/vagrant-devcommands/pull/1))
8
+
3
9
  ## v0.7.1 (2017-02-15)
4
10
 
5
11
  - Bug fixes
@@ -2,6 +2,8 @@ module VagrantPlugins
2
2
  module DevCommands
3
3
  # Defines the executable vagrant command
4
4
  class Command < Vagrant.plugin(2, :command)
5
+ UTIL = VagrantPlugins::DevCommands::Util
6
+
5
7
  def self.synopsis
6
8
  'runs vagrant commands from a Commandfile'
7
9
  end
@@ -48,7 +50,8 @@ module VagrantPlugins
48
50
  return nil if @argv.empty?
49
51
 
50
52
  command = @argv[0].to_s
51
- command = @argv[1].to_s if @env.machine_index.include?(command)
53
+ command = @argv[1].to_s if UTIL.machine_name?(@argv[1].to_s,
54
+ @env.machine_index)
52
55
 
53
56
  command
54
57
  end
@@ -91,16 +94,17 @@ module VagrantPlugins
91
94
  def run_argv
92
95
  argv = @argv.dup
93
96
 
94
- argv.shift if @env.machine_index.include?(argv[0].to_s)
97
+ argv.shift if UTIL.machine_name?(argv[0].to_s, @env.machine_index)
95
98
  argv.shift
96
99
  argv
97
100
  end
98
101
 
99
102
  def run_box(cmd)
100
- return cmd.box.to_s if cmd.box
101
- return @argv[0].to_s if @env.machine_index.include?(@argv[0].to_s)
103
+ box = nil
104
+ box = cmd.box.to_s if cmd.box
105
+ box = @argv[0] if UTIL.machine_name?(@argv[0].to_s, @env.machine_index)
102
106
 
103
- nil
107
+ box
104
108
  end
105
109
 
106
110
  def run_internal(command, args = nil)
@@ -2,6 +2,10 @@ module VagrantPlugins
2
2
  module DevCommands
3
3
  # Utility module
4
4
  class Util
5
+ def self.machine_name?(name, machine_index)
6
+ machine_index.any? { |machine| name == machine.name }
7
+ end
8
+
5
9
  def self.pad_to(items)
6
10
  items.keys.map(&:length).max
7
11
  end
@@ -1,6 +1,6 @@
1
1
  module VagrantPlugins
2
2
  # Defines the current plugin version
3
3
  module DevCommands
4
- VERSION = '0.7.1'.freeze
4
+ VERSION = '0.7.2'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-devcommands
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Neudert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-15 00:00:00.000000000 Z
11
+ date: 2017-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler