ngrok 1.6.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 069bbe9d2f0279891df1128f3f07c75db277e3fb
4
+ data.tar.gz: cdd23d2d9dde41b10c6e7af8fc9d383117d77339
5
+ SHA512:
6
+ metadata.gz: 9cf9c54406b8089306f217393ab7cda60e53e402be25a772cd89979086cc591893c8950af1952d5f2af4713977f31f40c8cc0ef606d2ea7149546d9c25a49b2f
7
+ data.tar.gz: 94fa5f262a98832944bce550ed196e05510082d6448b054c54d0e11e13574ca71eee55636f3c0bf378d81faf2c49c9520bd76b1cd9722cf91081e68f4ef32574
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ngrok.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Alex Peattie
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,54 @@
1
+ # ngrok
2
+
3
+ [**ngrok**](http://ngrok.com/) packaged as a Ruby gem! This is partly to allow easy installation (although hopefully ngrok should be installable [with homebrew soon](https://github.com/Homebrew/homebrew/pull/23732)), and partly as a fun proof-of-concept.
4
+
5
+ This doesn't currently work on Windows.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'ngrok'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself with:
18
+
19
+ $ gem install ngrok
20
+
21
+ ## Usage
22
+
23
+ Start your ngrok tunnel like normal:
24
+
25
+ $ ngrok 8000
26
+
27
+ For full usage examples see <https://ngrok.com/usage>.
28
+
29
+ ## Why?
30
+
31
+ Why not just install the ngrok binary normally? E.g.:
32
+
33
+ ```bash
34
+ curl -O https://dl.ngrok.com/darwin_amd64/ngrok.zip && unzip ngrok.zip -d /usr/local/bin
35
+ ```
36
+
37
+ ### Pros
38
+ * One line to install & uninstall (with `gem uninstall`)
39
+ * Manage multiple versions of ngrok on your system
40
+ * Automatically selects the right binary for your OS
41
+ * Works with [Bundler](http://bundler.io/)
42
+
43
+ ### Cons
44
+ * Gem contains multiple binaries (so it's a bigger download)
45
+ * No Windows support (yet)
46
+ * The gem installs ngrok in a bit of a crazy way (see below)
47
+
48
+ ## How?
49
+
50
+ The binaries for the various OSes are kept in the `/vendor` directory. When the gem is installed, we detect the current OS with `Rbconfig` (adapted from [Selenium](https://github.com/SeleniumHQ/selenium/blob/master/rake-tasks/checks.rb)) and select the right binary.
51
+
52
+ Then we set up a daemon that watches the file system (with [listen](https://github.com/guard/listen)), to wait for the placeholder (Ruby) binary to be installed, and replace it with the appropriate ngrok binary.
53
+
54
+ If there's a more elegant way to make this work, please let me know :smile:! Just open an [issue](https://github.com/alexpeattie/ngrok-gem/issues) or [pull request](https://github.com/alexpeattie/ngrok-gem/pulls).
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ abort "There was a problem installing your gem. The ngrok gem can't currently be installed to non-default directories (i.e. using the -​-install-dir or -​-bindir options).
4
+
5
+ Please install ngrok manually - e.g. `curl -O https://dl.ngrok.com/darwin_amd64/ngrok.zip && unzip ngrok.zip -d /usr/local/bin`"
@@ -0,0 +1,17 @@
1
+ # Adapted from https://github.com/SeleniumHQ/selenium/blob/master/rake-tasks/checks.rb
2
+ # and http://stackoverflow.com/questions/11784109/detecting-operating-systems-in-ruby
3
+
4
+ # require 'pathname'
5
+ # require 'fileutils'
6
+ require 'daemons'
7
+
8
+ task :default => [:build]
9
+
10
+ task :build do
11
+ # raise Gem::Specification.find_by_name("ngrok").inspect
12
+ fork do
13
+ listener = File.expand_path('../../lib/listener.rb', __FILE__)
14
+ Daemons.run(listener, ARGV: ['start'], log_output: true, backtrace: true)
15
+ end
16
+ sleep 2
17
+ end
@@ -0,0 +1,29 @@
1
+ require 'listen'
2
+ require 'fileutils'
3
+ require 'rubygems'
4
+ require 'rbconfig'
5
+
6
+ def os
7
+ @os ||= (
8
+ host_os = RbConfig::CONFIG['host_os']
9
+ case host_os
10
+ # TODO: Windows support
11
+ # when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
12
+ # :win
13
+ when /darwin|mac os/
14
+ :osx
15
+ else
16
+ :linux
17
+ end
18
+ )
19
+ end
20
+
21
+ listener = Listen.to(Gem.bindir(Gem.dir), only: /^ngrok$/) do |modified, added|
22
+ old_bin = (modified + added).first
23
+ new_bin = File.expand_path("../../vendor/ngrok-#{os}", __FILE__)
24
+
25
+ FileUtils.cp new_bin, old_bin
26
+ exit
27
+ end
28
+ listener.start
29
+ sleep
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+
3
+ # def bin_after_install(spec)
4
+ # raise 'yo' if spec.installed_by_version.version.to_f > 0
5
+ # # ['ngrok']
6
+ # # end
7
+ # end
8
+
9
+ Gem::Specification.new do |spec|
10
+ spec.name = 'ngrok'
11
+ spec.version = '1.6.1'
12
+ spec.authors = ['Alex Peattie']
13
+ spec.email = ['alexpeattie@gmail.com']
14
+ spec.summary = %q{ngrok packaged as a gem (for easy installation)}
15
+ spec.homepage = 'http://github.com/alexpeattie/ngrok-gem'
16
+ spec.license = 'MIT'
17
+
18
+ spec.files = `git ls-files`.split($/)
19
+ spec.extensions = ['ext/rakefile.rb']
20
+ spec.require_paths = ["lib"]
21
+ spec.executables = ['ngrok']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.3'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_runtime_dependency 'daemons'
26
+ spec.add_runtime_dependency 'listen'
27
+ end
Binary file
Binary file
metadata ADDED
@@ -0,0 +1,113 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ngrok
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.6.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex Peattie
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: daemons
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: listen
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description:
70
+ email:
71
+ - alexpeattie@gmail.com
72
+ executables:
73
+ - ngrok
74
+ extensions:
75
+ - ext/rakefile.rb
76
+ extra_rdoc_files: []
77
+ files:
78
+ - .gitignore
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - bin/ngrok
84
+ - ext/rakefile.rb
85
+ - lib/listener.rb
86
+ - ngrok.gemspec
87
+ - vendor/ngrok-linux
88
+ - vendor/ngrok-osx
89
+ homepage: http://github.com/alexpeattie/ngrok-gem
90
+ licenses:
91
+ - MIT
92
+ metadata: {}
93
+ post_install_message:
94
+ rdoc_options: []
95
+ require_paths:
96
+ - lib
97
+ required_ruby_version: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ requirements: []
108
+ rubyforge_project:
109
+ rubygems_version: 2.0.14
110
+ signing_key:
111
+ specification_version: 4
112
+ summary: ngrok packaged as a gem (for easy installation)
113
+ test_files: []