vagrant-foodshow 0.0.6 → 0.0.8

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: e59b96661564dbad9346832b58123e12b4577010
4
- data.tar.gz: 3407de4dc6a45f73d362091f36fffd0c7ae58431
3
+ metadata.gz: d2c18e133d54680de1cff45b980bcec79a66bb11
4
+ data.tar.gz: b87f5cd17a303d0cd5e1f4839bf8c6a1f4e4bb1d
5
5
  SHA512:
6
- metadata.gz: 0c4d813475f020b8a65a8570569b5b28aff190bf9b9fb16661f13a3247eed93adea472f73344aa063387ab0c78b2927116a7d4d853eea387a4c07d77ed7584e0
7
- data.tar.gz: 7601a43d090138b304ec27fed6e0538cfeeb6c3b62f13de844bfa34b5b5ad499ed94fe5215014913098c3e7e14db9338dae3ccf0a39d393baad790019ef64412
6
+ metadata.gz: d278adae5aa813ebb71938f38695de830be8477506d2d22056a8bf016bfd7a0dac98e6c7e26fc786bd69005d1597af7d9cd9cc94a03627258eaf2922691c24c5
7
+ data.tar.gz: e47a40018a2de86eacd1d0a0066fc5f4381674ec10857668438db91b8040d7e4e6748a4ae890e2eb7cafaab432f4f9e3953e3c6fa6c6e8821cccfa163a396271
@@ -8,7 +8,8 @@ module VagrantPlugins
8
8
 
9
9
  def call(env)
10
10
 
11
- Dir.glob("#{env[:tmp_path] || '/tmp'}/ngrok-#{env[:machine].id}-*.pid") do |pid_file|
11
+ machine_id = VagrantPlugins::Foodshow::Util::NgrokConfig.get_machine_id(env)
12
+ Dir.glob("#{env[:tmp_path] || '/tmp'}/ngrok-#{machine_id}-*.pid") do |pid_file|
12
13
  ::File.open(pid_file, "r") do |f|
13
14
  begin
14
15
  pid = f.readline().to_i
@@ -16,6 +16,14 @@ module VagrantPlugins
16
16
  cmd = cmd + " " + host + ":" + port.to_s
17
17
  end
18
18
 
19
+ def self.get_machine_id(env)
20
+ if env[:machine].provider_name.to_s().start_with?('vmware')
21
+ machine_id = env[:machine].id.match(/\h+\-\h+\-\h+\-\h+\-\h+/)[0]
22
+ else
23
+ machine_id = env[:machine].id
24
+ end
25
+ end
26
+
19
27
  def self.merge_config(env, tunnel)
20
28
  config = {}
21
29
  foodshow_config = env[:machine].config.foodshow
@@ -35,9 +43,11 @@ module VagrantPlugins
35
43
  end
36
44
  config.merge!(tunnel)
37
45
 
38
- config[:config] = (env[:tmp_path] || "/tmp") + ("ngrok-" + env[:machine].id + "-" + config[:port].to_s + ".cfg")
39
- config[:log_file] = (env[:tmp_path] || "/tmp") + ("ngrok-" + env[:machine].id + "-" + config[:port].to_s + ".log")
40
- config[:pid_file] = (env[:tmp_path] || "/tmp") + ("ngrok-" + env[:machine].id + "-" + config[:port].to_s + ".pid")
46
+ machine_id = get_machine_id(env)
47
+
48
+ config[:config] = (env[:tmp_path] || "/tmp") + ("ngrok-" + machine_id + "-" + config[:port].to_s + ".cfg")
49
+ config[:log_file] = (env[:tmp_path] || "/tmp") + ("ngrok-" + machine_id + "-" + config[:port].to_s + ".log")
50
+ config[:pid_file] = (env[:tmp_path] || "/tmp") + ("ngrok-" + machine_id + "-" + config[:port].to_s + ".pid")
41
51
  config
42
52
  end
43
53
  end
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Foodshow
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-foodshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Borzykh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-21 00:00:00.000000000 Z
11
+ date: 2014-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project: vagrant-foodshow
68
- rubygems_version: 2.2.1
68
+ rubygems_version: 2.2.2
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: You can share your vagrant vm with your colleagues easily by using vagrant-foodshow