vagrant-foodshow 1.0.0 → 1.0.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: f146d0ff605189d2e409ede395779c9be1d9f282
4
- data.tar.gz: 455533e5892334c78b3b900b276f2b53ab502f17
3
+ metadata.gz: 70bb757fb91620373f0ff8ed75fc4a6a9f491f10
4
+ data.tar.gz: bb922e878f3e8e9ce9f50afa0d1055bb216f6251
5
5
  SHA512:
6
- metadata.gz: 0c8cc0f7499bf6aeda07a578a1ccb03881ca9c268f2aa2f84983f561602c4d2e03e6672ef3435d26ed5474e60e85275f06ba1e7ee347670af3c628064a53b8c0
7
- data.tar.gz: 99d663cea9e2df4bc40e453b8c9a3f8612f64091b00759518f4fb00cf0a9c839124fe1b7fe0b720f347e21dde9f6c8ae7121514ed55e6ded60993b6218256834
6
+ metadata.gz: d3e07cc7476493280b46f45631913d475c93c9b3793e7424c8b491e9d5854517d56c7cbff07dd4c926a87e847e5cabff62b1e57e3c63e84529b4555c71982678
7
+ data.tar.gz: 290de7d390ffed5d5aab9de8b70e61268680bbaec105cd9f6f48adb5fd902799e05176c3994442f3317f94b08bb54dcaaa971d4202aa38ca4a929847209e443a
data/Gemfile CHANGED
@@ -3,9 +3,10 @@ source 'https://rubygems.org'
3
3
  gem 'rake'
4
4
 
5
5
  group :development do
6
- gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.5.1"
6
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git", :tag => "v1.6.3"
7
7
  end
8
8
 
9
9
  group :plugins do
10
+ gem "vagrant-parallels", :git => "https://github.com/Parallels/vagrant-parallels"
10
11
  gemspec
11
12
  end
data/README.md CHANGED
@@ -13,7 +13,7 @@ Ngrok tunnel can operate in TCP and HTTP modes. In HTTP tunnel mode `ngrok` prov
13
13
 
14
14
  ### Ngrok installation
15
15
 
16
- You should go to [ngrok.com](http://ngrok.com) and download ngrok binary for your system. By default vagrant-foodshow will search ngrok binary at `~/bin/ngrok`. You must place binary into *bin* directory in your home folder. To change default location you must set `foodshow.ngrok_bin` option (See [Advanced tunnel example](#advanced-tunnel-example)).
16
+ You should go to [ngrok.com](http://ngrok.com) and download ngrok binary for your system. Vagrant-foodshow will search ngrok binary in PATH. `~/bin/ngrok` will be used if no ngrok binary in PATH. To disable search you may set `foodshow.ngrok_bin` option (See [Advanced tunnel example](#advanced-tunnel-example)).
17
17
 
18
18
  ### Plugin installation
19
19
 
@@ -132,7 +132,7 @@ Read this document if you want to start self-hosted server https://github.com/in
132
132
  Option | Default | Scope | Purpose
133
133
  -------|---------|---------|--------
134
134
  `enabled` | `false` | config | Enable foodshow plugin
135
- `ngrok_bin` | `~/bin/ngrok` | config+tunnel | Ngrok binary location (you should put a binary file at this location)
135
+ `ngrok_bin` | `nil` | config+tunnel | By default vagrant-foodshow will search ngrok binary in PATH, then at ~/bin/ngrok. You may override this behavior by setting this option
136
136
  `forward_ssh` | `false` | config | Automatically search and forward vagrant ssh guest port (authtoken required)
137
137
  `timeout` | `10` | config | Max waiting time for establishing tunnel
138
138
  `authtoken` | `nil` | config+tunnel | Auth token. Required for TCP tunnels and some functions (Go to [ngrok.com](http://ngrok.com) to get authkey)
@@ -58,13 +58,14 @@ module VagrantPlugins
58
58
 
59
59
  def validate(machine)
60
60
  errors = _detected_errors
61
- unless ::File.executable? @ngrok_bin
62
- errors << "You must put ngrok binary to #{@ngrok_bin}.\n"\
63
- " Go to http://ngrok.com and download ngrok binary.\n"\
64
- " You can change binary location by changing option foodshow.ngrok_bin.\n\n"\
65
- " EXAMPLE. Download and unpack ngrok to ~/bin on Mac OS x86_64:\n"\
66
- " curl -O https://dl.ngrok.com/darwin_amd64/ngrok.zip && unzip ngrok.zip && mkdir -p ~/bin && mv ngrok ~/bin\n\n"\
67
- " You can read docs at http://github.com/express42/vagrant-foodshow\n"
61
+ if @ngrok_bin == UNSET_VALUE
62
+ errors << "Ngrok binary not found!\n"\
63
+ " Make sure you have downloaded ngrok binary from http://ngrok.com\n"\
64
+ " You can do this:\n"\
65
+ " 1) Add directory with ngrok binary your PATH\n"\
66
+ " 2) Aut ngrok binary in ~/bin/ngrok\n"\
67
+ " 3) Set ngrok binary location with option foodshow.ngrok_bin in your vagrant file\n\n"\
68
+ " You can read docs at http://github.com/express42/vagrant-foodshow"
68
69
  end
69
70
 
70
71
  unless @authtoken
@@ -87,7 +88,7 @@ module VagrantPlugins
87
88
  end
88
89
 
89
90
  def finalize!
90
- @ngrok_bin = ::File.expand_path('~/bin/ngrok') if @ngrok_bin == UNSET_VALUE
91
+ @ngrok_bin = VagrantPlugins::Foodshow::Util::NgrokConfig.where_ngrok if @ngrok_bin == UNSET_VALUE
91
92
 
92
93
  @trust_host_root_certs = nil if @trust_host_root_certs == UNSET_VALUE
93
94
  @server_addr = nil if @server_addr == UNSET_VALUE
@@ -4,6 +4,19 @@ module VagrantPlugins
4
4
  class NgrokConfig
5
5
  NGROK_ALLOWED_OPTIONS = %w(authtoken hostname httpauth proto subdomain host port server_addr trust_host_root_certs)
6
6
 
7
+ def self.where_ngrok
8
+ cmd = 'ngrok'
9
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
10
+ ENV['PATH'].split(::File::PATH_SEPARATOR).each do |path|
11
+ exts.each { |ext|
12
+ exe = ::File.join(path, "#{cmd}#{ext}")
13
+ return exe if ::File.executable?(exe) && !File.directory?(exe)
14
+ }
15
+ end
16
+ return ::File.expand_path('~/bin/ngrok') if ::File.executable?(::File.expand_path('~/bin/ngrok'))
17
+ return VagrantPlugins::Foodshow::Config::UNSET_VALUE
18
+ end
19
+
7
20
  def self.build_cmd(config)
8
21
  cmd = config.delete(:ngrok_bin) + " -log=stdout"
9
22
  host = config.delete(:host)
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Foodshow
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-foodshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
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-04-27 00:00:00.000000000 Z
11
+ date: 2014-09-02 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.5'
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.5'
27
27
  description: You can share your vagrant vm with your colleagues easily by using vagrant-foodshow
@@ -31,7 +31,7 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
- - .gitignore
34
+ - ".gitignore"
35
35
  - Gemfile
36
36
  - MIT-LICENSE
37
37
  - README.md
@@ -55,17 +55,17 @@ require_paths:
55
55
  - lib
56
56
  required_ruby_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
- - - '>='
63
+ - - ">="
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project: vagrant-foodshow
68
- rubygems_version: 2.2.2
68
+ rubygems_version: 2.4.1
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