mogotest 0.9.1 → 0.10.0
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.
- data/Rakefile +2 -2
- data/bin/mogotest +12 -3
- data/lib/localtunnel/tunnel.rb +8 -8
- data/mogotest.gemspec +3 -3
- metadata +6 -6
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('mogotest', '0.
|
5
|
+
Echoe.new('mogotest', '0.10.0') do |p|
|
6
6
|
p.description = "Test your local Web servers on Mogotest without poking a hole in your firewall."
|
7
7
|
p.url = "http://mogotest.com"
|
8
8
|
p.author = "Jeff Lindsay"
|
@@ -14,4 +14,4 @@ Echoe.new('mogotest', '0.9.1') do |p|
|
|
14
14
|
p.executable_pattern = ["bin/*"]
|
15
15
|
p.runtime_dependencies = ["json >=1.2.4", "net-ssh >=2.0.22", "net-ssh-gateway >=1.0.1", "rest-client >=1.6.1"]
|
16
16
|
p.development_dependencies = []
|
17
|
-
end
|
17
|
+
end
|
data/bin/mogotest
CHANGED
@@ -51,13 +51,22 @@ end
|
|
51
51
|
args = options.parse!
|
52
52
|
api_key = args[0]
|
53
53
|
test_host = args[1]
|
54
|
-
|
55
|
-
unless api_key && test_host &&
|
54
|
+
reflected_connection = args[2]
|
55
|
+
unless api_key && test_host && reflected_connection
|
56
56
|
puts options
|
57
57
|
exit
|
58
58
|
end
|
59
59
|
|
60
|
-
|
60
|
+
reflected_connection_parts = reflected_connection.split(':')
|
61
|
+
if reflected_connection_parts.size == 2
|
62
|
+
reflected_host = reflected_connection_parts.first
|
63
|
+
reflected_port = reflected_connection_parts.last
|
64
|
+
else
|
65
|
+
reflected_host = '127.0.0.1'
|
66
|
+
reflected_port = reflected_connection_parts.first
|
67
|
+
end
|
68
|
+
|
69
|
+
x = LocalTunnel::Tunnel.new(tunnel_host, reflected_host, reflected_port, public_ssh_key)
|
61
70
|
response = x.register_tunnel
|
62
71
|
|
63
72
|
m = Mogotest::Tunnel.new(api_host, api_key, test_host, response['host'])
|
data/lib/localtunnel/tunnel.rb
CHANGED
@@ -11,11 +11,12 @@ module LocalTunnel; end
|
|
11
11
|
|
12
12
|
class LocalTunnel::Tunnel
|
13
13
|
|
14
|
-
attr_accessor :tunnel_host, :
|
14
|
+
attr_accessor :tunnel_host, :reflected_host, :reflected_port, :key, :host
|
15
15
|
|
16
|
-
def initialize(tunnel_host,
|
16
|
+
def initialize(tunnel_host, reflected_host, reflected_port, key)
|
17
17
|
@tunnel_host = tunnel_host
|
18
|
-
@
|
18
|
+
@reflected_host = reflected_host
|
19
|
+
@reflected_port = reflected_port
|
19
20
|
@key = key
|
20
21
|
@host = ""
|
21
22
|
end
|
@@ -31,7 +32,7 @@ class LocalTunnel::Tunnel
|
|
31
32
|
puts " [Error] #{resp['error']}"
|
32
33
|
exit
|
33
34
|
end
|
34
|
-
@
|
35
|
+
@ssh_host = resp['host'].split(':').first
|
35
36
|
@tunnel = resp
|
36
37
|
return resp
|
37
38
|
rescue
|
@@ -40,11 +41,10 @@ class LocalTunnel::Tunnel
|
|
40
41
|
end
|
41
42
|
|
42
43
|
def start_tunnel(mogotest)
|
43
|
-
port = @port
|
44
44
|
tunnel = @tunnel
|
45
|
-
gateway = Net::SSH::Gateway.new(@
|
46
|
-
gateway.open_remote(
|
47
|
-
puts " You're good to go. Any tests you run against '#{mogotest.test_host}' on Mogotest will now access
|
45
|
+
gateway = Net::SSH::Gateway.new(@ssh_host, tunnel['user'])
|
46
|
+
gateway.open_remote(reflected_port.to_i, reflected_host, tunnel['through_port'].to_i) do |rp,rh|
|
47
|
+
puts " You're good to go. Any tests you run against '#{mogotest.test_host}' on Mogotest will now access the site running on #{reflected_host}:#{reflected_port}."
|
48
48
|
begin
|
49
49
|
sleep 1 while true
|
50
50
|
rescue Interrupt
|
data/mogotest.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{mogotest}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.10.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Jeff Lindsay"]
|
9
|
-
s.date = %q{2011-05-
|
9
|
+
s.date = %q{2011-05-24}
|
10
10
|
s.default_executable = %q{mogotest}
|
11
11
|
s.description = %q{Test your local Web servers on Mogotest without poking a hole in your firewall.}
|
12
12
|
s.email = %q{kevin@mogotest.com [Please don't bother Jeff]}
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.homepage = %q{http://mogotest.com}
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
s.rubyforge_project = %q{mogotest}
|
19
|
-
s.rubygems_version = %q{1.
|
19
|
+
s.rubygems_version = %q{1.6.2}
|
20
20
|
s.summary = %q{Test your local Web servers on Mogotest without poking a hole in your firewall.}
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mogotest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 0.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jeff Lindsay
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-24 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
requirements: []
|
137
137
|
|
138
138
|
rubyforge_project: mogotest
|
139
|
-
rubygems_version: 1.
|
139
|
+
rubygems_version: 1.6.2
|
140
140
|
signing_key:
|
141
141
|
specification_version: 3
|
142
142
|
summary: Test your local Web servers on Mogotest without poking a hole in your firewall.
|