forward 0.0.1 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +7 -0
- data/Rakefile +6 -1
- data/bin/forward +6 -0
- data/forward.gemspec +12 -4
- data/forwardhq.crt +112 -0
- data/lib/forward.rb +86 -0
- data/lib/forward/api.rb +45 -0
- data/lib/forward/api/client_log.rb +28 -0
- data/lib/forward/api/public_key.rb +16 -0
- data/lib/forward/api/resource.rb +121 -0
- data/lib/forward/api/tunnel.rb +91 -0
- data/lib/forward/api/user.rb +19 -0
- data/lib/forward/cli.rb +238 -0
- data/lib/forward/client.rb +92 -0
- data/lib/forward/config.rb +163 -0
- data/lib/forward/core_extensions.rb +12 -0
- data/lib/forward/error.rb +10 -0
- data/lib/forward/tunnel.rb +58 -0
- data/lib/forward/version.rb +1 -1
- data/test/api/public_key_test.rb +28 -0
- data/test/api/resource_test.rb +82 -0
- data/test/api/tunnel_test.rb +75 -0
- data/test/api/user_test.rb +28 -0
- data/test/api_test.rb +0 -0
- data/test/cli_test.rb +84 -0
- data/test/client_test.rb +8 -0
- data/test/config_test.rb +102 -0
- data/test/test_helper.rb +40 -0
- data/test/tunnel_test.rb +8 -0
- metadata +156 -9
data/test/test_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.expand_path('../../spec', __FILE__))
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
Bundler.setup
|
6
|
+
|
7
|
+
require 'minitest/autorun'
|
8
|
+
require 'minitest/pride'
|
9
|
+
require 'fakefs'
|
10
|
+
require 'fakeweb'
|
11
|
+
require 'forward'
|
12
|
+
require 'mocha'
|
13
|
+
|
14
|
+
ENV['FORWARD_API_HOST'] = 'http://localhost:3000'
|
15
|
+
|
16
|
+
def dev_null(&block)
|
17
|
+
begin
|
18
|
+
orig_stdout = $stdout.dup
|
19
|
+
$stdout.reopen('/dev/null', 'w')
|
20
|
+
yield
|
21
|
+
ensure
|
22
|
+
$stdout.reopen(orig_stdout)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def stub_api_request(action = :get, path = '/', options = {})
|
27
|
+
uri = "#{Forward::Api.uri.host}:#{Forward::Api.uri.port}#{path}"
|
28
|
+
base_options = {
|
29
|
+
:status => [ 200, 'OK' ],
|
30
|
+
'content-type' => 'application/json'
|
31
|
+
}
|
32
|
+
|
33
|
+
if options.is_a?(Array)
|
34
|
+
options.map! { |o| base_options.merge(o) }
|
35
|
+
else
|
36
|
+
options = base_options.merge(options)
|
37
|
+
end
|
38
|
+
|
39
|
+
FakeWeb.register_uri(action, uri, options)
|
40
|
+
end
|
data/test/tunnel_test.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forward
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,125 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
-
dependencies:
|
14
|
-
|
12
|
+
date: 2012-10-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: json
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.7.3
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.7.3
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: highline
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.6.13
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.6.13
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: net-ssh
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.4.0
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.4.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: minitest
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 3.0.0
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 3.0.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: mocha
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 0.11.4
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.11.4
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: fakeweb
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 1.3.0
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.3.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: fakefs
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.4.0
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.4.0
|
126
|
+
description:
|
15
127
|
email:
|
16
128
|
- travis@50east.co
|
17
|
-
executables:
|
129
|
+
executables:
|
130
|
+
- forward
|
18
131
|
extensions: []
|
19
132
|
extra_rdoc_files: []
|
20
133
|
files:
|
@@ -23,10 +136,34 @@ files:
|
|
23
136
|
- LICENSE
|
24
137
|
- README.md
|
25
138
|
- Rakefile
|
139
|
+
- bin/forward
|
26
140
|
- forward.gemspec
|
141
|
+
- forwardhq.crt
|
27
142
|
- lib/forward.rb
|
143
|
+
- lib/forward/api.rb
|
144
|
+
- lib/forward/api/client_log.rb
|
145
|
+
- lib/forward/api/public_key.rb
|
146
|
+
- lib/forward/api/resource.rb
|
147
|
+
- lib/forward/api/tunnel.rb
|
148
|
+
- lib/forward/api/user.rb
|
149
|
+
- lib/forward/cli.rb
|
150
|
+
- lib/forward/client.rb
|
151
|
+
- lib/forward/config.rb
|
152
|
+
- lib/forward/core_extensions.rb
|
153
|
+
- lib/forward/error.rb
|
154
|
+
- lib/forward/tunnel.rb
|
28
155
|
- lib/forward/version.rb
|
29
|
-
|
156
|
+
- test/api/public_key_test.rb
|
157
|
+
- test/api/resource_test.rb
|
158
|
+
- test/api/tunnel_test.rb
|
159
|
+
- test/api/user_test.rb
|
160
|
+
- test/api_test.rb
|
161
|
+
- test/cli_test.rb
|
162
|
+
- test/client_test.rb
|
163
|
+
- test/config_test.rb
|
164
|
+
- test/test_helper.rb
|
165
|
+
- test/tunnel_test.rb
|
166
|
+
homepage: https://forwardhq.com
|
30
167
|
licenses: []
|
31
168
|
post_install_message:
|
32
169
|
rdoc_options: []
|
@@ -46,8 +183,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
183
|
version: '0'
|
47
184
|
requirements: []
|
48
185
|
rubyforge_project:
|
49
|
-
rubygems_version: 1.8.
|
186
|
+
rubygems_version: 1.8.23
|
50
187
|
signing_key:
|
51
188
|
specification_version: 3
|
52
|
-
summary:
|
53
|
-
test_files:
|
189
|
+
summary: Forward Lets You Share localhost over the Web. Demo a Website Without Hosting.
|
190
|
+
test_files:
|
191
|
+
- test/api/public_key_test.rb
|
192
|
+
- test/api/resource_test.rb
|
193
|
+
- test/api/tunnel_test.rb
|
194
|
+
- test/api/user_test.rb
|
195
|
+
- test/api_test.rb
|
196
|
+
- test/cli_test.rb
|
197
|
+
- test/client_test.rb
|
198
|
+
- test/config_test.rb
|
199
|
+
- test/test_helper.rb
|
200
|
+
- test/tunnel_test.rb
|