forward 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/forward.gemspec +7 -6
- data/lib/forward/api/resource.rb +2 -2
- data/lib/forward/cli.rb +14 -1
- data/lib/forward/client.rb +1 -0
- data/lib/forward/version.rb +1 -1
- data/test/test_helper.rb +1 -1
- metadata +138 -103
data/forward.gemspec
CHANGED
@@ -14,12 +14,13 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.require_paths = ['lib']
|
15
15
|
gem.version = Forward::VERSION
|
16
16
|
|
17
|
-
gem.add_dependency '
|
18
|
-
gem.add_dependency 'highline', '~> 1.6.
|
19
|
-
gem.add_dependency 'net-ssh', '~> 2.
|
17
|
+
gem.add_dependency 'json_pure', '~> 1.8.1'
|
18
|
+
gem.add_dependency 'highline', '~> 1.6.21'
|
19
|
+
gem.add_dependency 'net-ssh', '~> 2.8.0'
|
20
20
|
|
21
|
-
gem.add_development_dependency '
|
22
|
-
gem.add_development_dependency '
|
21
|
+
gem.add_development_dependency 'rake', '~> 10.1.1'
|
22
|
+
gem.add_development_dependency 'minitest', '~> 5.3.0'
|
23
|
+
gem.add_development_dependency 'mocha', '~> 0.14.0'
|
23
24
|
gem.add_development_dependency 'fakeweb', '~> 1.3.0'
|
24
|
-
gem.add_development_dependency 'fakefs', '~> 0.4.
|
25
|
+
gem.add_development_dependency 'fakefs', '~> 0.4.3'
|
25
26
|
end
|
data/lib/forward/api/resource.rb
CHANGED
@@ -89,7 +89,7 @@ module Forward
|
|
89
89
|
|
90
90
|
if json.is_a? Hash
|
91
91
|
json.symbolize_keys!
|
92
|
-
raise ResourceError.new(code, @action, json) if code != 200
|
92
|
+
raise ResourceError.new(code, @action, json) if code != 200
|
93
93
|
end
|
94
94
|
|
95
95
|
json
|
@@ -98,7 +98,7 @@ module Forward
|
|
98
98
|
# def self.dispatch_error(error)
|
99
99
|
# Forward.log.debug("Dispatching ResourceError: action: #{error.action} errors: #{error.errors.inspect}")
|
100
100
|
# method = :"#{error.action}_error"
|
101
|
-
#
|
101
|
+
#
|
102
102
|
# if respond_to? method
|
103
103
|
# send(method, error.errors)
|
104
104
|
# else
|
data/lib/forward/cli.rb
CHANGED
@@ -67,6 +67,10 @@ module Forward
|
|
67
67
|
options[:cname] = cname.downcase
|
68
68
|
end
|
69
69
|
|
70
|
+
opts.on('--logout', 'Remove credentials to allow logging in as another user.' ) do
|
71
|
+
logout
|
72
|
+
end
|
73
|
+
|
70
74
|
opts.on( '-h', '--help', 'Display this help.' ) do
|
71
75
|
puts opts
|
72
76
|
exit
|
@@ -194,7 +198,7 @@ module Forward
|
|
194
198
|
exit_with_error("`#{cname}' is an invalid domain format") unless cname =~ CNAME_REGEX
|
195
199
|
end
|
196
200
|
|
197
|
-
# Checks to make sure the subdomain prefix is in the correct format
|
201
|
+
# Checks to make sure the subdomain prefix is in the correct format
|
198
202
|
# and exits with an error message if it isn't.
|
199
203
|
#
|
200
204
|
# prefix - subdomain prefix String
|
@@ -227,6 +231,15 @@ module Forward
|
|
227
231
|
{ :email => email, :password => password }
|
228
232
|
end
|
229
233
|
|
234
|
+
# Remove .forward file and SSH key (log a user out)
|
235
|
+
def self.logout
|
236
|
+
FileUtils.rm_f(Config.config_path)
|
237
|
+
FileUtils.rm_f(Config.key_path)
|
238
|
+
|
239
|
+
puts "You've been logged out. You'll be asked to log back in when you create a new tunnel."
|
240
|
+
exit
|
241
|
+
end
|
242
|
+
|
230
243
|
# Parses various options and arguments, validates everything to ensure
|
231
244
|
# we're safe to proceed, and finally passes options to the Client.
|
232
245
|
def self.run(args)
|
data/lib/forward/client.rb
CHANGED
data/lib/forward/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,136 +1,161 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: forward
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 3
|
9
|
+
- 3
|
10
|
+
version: 0.3.3
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- blahed
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 1.7.7
|
22
|
-
type: :runtime
|
17
|
+
|
18
|
+
date: 2014-03-12 00:00:00 -04:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: json_pure
|
23
23
|
prerelease: false
|
24
|
-
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
|
-
requirements:
|
26
|
+
requirements:
|
27
27
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 1.6.18
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 53
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 8
|
33
|
+
- 1
|
34
|
+
version: 1.8.1
|
38
35
|
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: highline
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
|
-
requirements:
|
42
|
+
requirements:
|
43
43
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 37
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 6
|
49
|
+
- 21
|
50
|
+
version: 1.6.21
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
47
54
|
name: net-ssh
|
48
|
-
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
49
57
|
none: false
|
50
|
-
requirements:
|
58
|
+
requirements:
|
51
59
|
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 47
|
62
|
+
segments:
|
63
|
+
- 2
|
64
|
+
- 8
|
65
|
+
- 0
|
66
|
+
version: 2.8.0
|
54
67
|
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
55
71
|
prerelease: false
|
56
|
-
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
57
73
|
none: false
|
58
|
-
requirements:
|
74
|
+
requirements:
|
59
75
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: 3.0.0
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 73
|
78
|
+
segments:
|
79
|
+
- 10
|
80
|
+
- 1
|
81
|
+
- 1
|
82
|
+
version: 10.1.1
|
70
83
|
type: :development
|
84
|
+
version_requirements: *id004
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: minitest
|
71
87
|
prerelease: false
|
72
|
-
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
73
89
|
none: false
|
74
|
-
requirements:
|
90
|
+
requirements:
|
75
91
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: 0.11.4
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
hash: 59
|
94
|
+
segments:
|
95
|
+
- 5
|
96
|
+
- 3
|
97
|
+
- 0
|
98
|
+
version: 5.3.0
|
86
99
|
type: :development
|
100
|
+
version_requirements: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: mocha
|
87
103
|
prerelease: false
|
88
|
-
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
105
|
none: false
|
90
|
-
requirements:
|
106
|
+
requirements:
|
91
107
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
- - ~>
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: 1.3.0
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
hash: 39
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
- 14
|
113
|
+
- 0
|
114
|
+
version: 0.14.0
|
102
115
|
type: :development
|
116
|
+
version_requirements: *id006
|
117
|
+
- !ruby/object:Gem::Dependency
|
118
|
+
name: fakeweb
|
103
119
|
prerelease: false
|
104
|
-
|
120
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
121
|
none: false
|
106
|
-
requirements:
|
122
|
+
requirements:
|
107
123
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
hash: 27
|
126
|
+
segments:
|
127
|
+
- 1
|
128
|
+
- 3
|
129
|
+
- 0
|
109
130
|
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
131
|
type: :development
|
132
|
+
version_requirements: *id007
|
133
|
+
- !ruby/object:Gem::Dependency
|
134
|
+
name: fakefs
|
119
135
|
prerelease: false
|
120
|
-
|
136
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
121
137
|
none: false
|
122
|
-
requirements:
|
138
|
+
requirements:
|
123
139
|
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
hash: 9
|
142
|
+
segments:
|
143
|
+
- 0
|
144
|
+
- 4
|
145
|
+
- 3
|
146
|
+
version: 0.4.3
|
147
|
+
type: :development
|
148
|
+
version_requirements: *id008
|
126
149
|
description:
|
127
|
-
email:
|
150
|
+
email:
|
128
151
|
- travis@50east.co
|
129
|
-
executables:
|
152
|
+
executables:
|
130
153
|
- forward
|
131
154
|
extensions: []
|
155
|
+
|
132
156
|
extra_rdoc_files: []
|
133
|
-
|
157
|
+
|
158
|
+
files:
|
134
159
|
- .gitignore
|
135
160
|
- Gemfile
|
136
161
|
- LICENSE
|
@@ -163,31 +188,41 @@ files:
|
|
163
188
|
- test/config_test.rb
|
164
189
|
- test/test_helper.rb
|
165
190
|
- test/tunnel_test.rb
|
191
|
+
has_rdoc: true
|
166
192
|
homepage: https://forwardhq.com
|
167
193
|
licenses: []
|
194
|
+
|
168
195
|
post_install_message:
|
169
196
|
rdoc_options: []
|
170
|
-
|
197
|
+
|
198
|
+
require_paths:
|
171
199
|
- lib
|
172
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
200
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
173
201
|
none: false
|
174
|
-
requirements:
|
175
|
-
- -
|
176
|
-
- !ruby/object:Gem::Version
|
177
|
-
|
178
|
-
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
hash: 3
|
206
|
+
segments:
|
207
|
+
- 0
|
208
|
+
version: "0"
|
209
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
210
|
none: false
|
180
|
-
requirements:
|
181
|
-
- -
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
211
|
+
requirements:
|
212
|
+
- - ">="
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
hash: 3
|
215
|
+
segments:
|
216
|
+
- 0
|
217
|
+
version: "0"
|
184
218
|
requirements: []
|
219
|
+
|
185
220
|
rubyforge_project:
|
186
|
-
rubygems_version: 1.
|
221
|
+
rubygems_version: 1.6.2
|
187
222
|
signing_key:
|
188
223
|
specification_version: 3
|
189
224
|
summary: Forward Lets You Share localhost over the Web. Demo a Website Without Hosting.
|
190
|
-
test_files:
|
225
|
+
test_files:
|
191
226
|
- test/api/resource_test.rb
|
192
227
|
- test/api/tunnel_key_test.rb
|
193
228
|
- test/api/tunnel_test.rb
|