vagrant-multiplug 0.0.1 → 0.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f0fc8d069b49f2d4a8d02316ea962cf4bce669a
4
- data.tar.gz: 3e608a90546481e3af3a4bf702621bedc9116b90
3
+ metadata.gz: 1daf696a9321e6cd4181f3c569280b64934bad90
4
+ data.tar.gz: b13d3e1e56035447a08cc2815f551e040dad6205
5
5
  SHA512:
6
- metadata.gz: d5388cb5e3e27261360d72122e919d782151ab5b924f9eeebf73b5115fca5fb64be7237345fe202a67b4285777e608a46a9c68789cff844c00d159963797aefa
7
- data.tar.gz: b857bac5140bd010f0b60dba841bb15ec12a29f06d406f865d0732ec12cf1267e5ba4dad83bf129a25ca27dfbd00592c90f97ccbe89203fa87ce77f63a963c5a
6
+ metadata.gz: 62f1d2ed525d5806c30e6f59dcd0395c3c60921de9354e2c176c5d4a6a91228eff20c53eb0b4d8d2ae1e2c92fddb923be0898785529677bb4b727411f99133d0
7
+ data.tar.gz: 05d736b9113418145bbf4d3fe55ad6e3f1155a35bdd2369f1752b26ff3a086bc9b4237d841d3b1fe47d238fdd854f8be5fa649e8bef5306115e9ca4a91f54cb7
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## 0.0.2
2
+ - Fix installed package checking logic
3
+
4
+ ## 0.0.1
5
+ - 1st Release
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Multiplug
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ module VagrantPlugins
7
7
  end
8
8
 
9
9
  def call(env)
10
- restart if env[:machine].config.plugin.dependencies.any? do |dependency|
10
+ results = env[:machine].config.plugin.dependencies.map do |dependency|
11
11
  case
12
12
  when dependency.installed?
13
13
  false
@@ -17,12 +17,14 @@ module VagrantPlugins
17
17
  exit(1)
18
18
  end
19
19
  end
20
+ restart if results.any?
20
21
  @app.call(env)
21
22
  end
22
23
 
23
24
  private
24
25
 
25
26
  def restart
27
+ puts "Restarting vagrant..."
26
28
  exec "#{$0} #{ARGV * ' '}"
27
29
  end
28
30
  end
@@ -20,8 +20,15 @@ module VagrantPlugins
20
20
  @version = version
21
21
  end
22
22
 
23
+ # @note ::Vagrant.has_plugin?(@name, @version) cannot be used because it looks up from caches
23
24
  def installed?
24
- ::Vagrant.has_plugin?(@name, @version)
25
+ `vagrant plugin list`.each_line.any? do |line|
26
+ if @version
27
+ line == "#{@name} (#{@version})\n"
28
+ else
29
+ line.start_with?("#{@name} (")
30
+ end
31
+ end
25
32
  end
26
33
 
27
34
  # @return [String] Command-line options for `vagrant plugin install NAME`
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-multiplug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".gitignore"
49
49
  - ".travis.yml"
50
+ - CHANGELOG.md
50
51
  - Gemfile
51
52
  - LICENSE.txt
52
53
  - README.md