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 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 'json', '~> 1.7.7'
18
- gem.add_dependency 'highline', '~> 1.6.18'
19
- gem.add_dependency 'net-ssh', '~> 2.6.7'
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 'minitest', '~> 3.0.0'
22
- gem.add_development_dependency 'mocha', '~> 0.11.4'
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.0'
25
+ gem.add_development_dependency 'fakefs', '~> 0.4.3'
25
26
  end
@@ -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)
@@ -32,6 +32,7 @@ module Forward
32
32
  # Returns a Hash of options.
33
33
  def ssh_options
34
34
  {
35
+ :config => false,
35
36
  :port => Forward.ssh_port,
36
37
  :keys_only => true,
37
38
  :keys => [],
@@ -1,3 +1,3 @@
1
1
  module Forward
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  end
data/test/test_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- $LOAD_PATH.unshift(File.expand_path('../../spec', __FILE__))
1
+ $LOAD_PATH.unshift(File.expand_path('../../test', __FILE__))
2
2
 
3
3
  require 'rubygems'
4
4
  require 'yaml'
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
- version: 0.3.2
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
- date: 2013-04-24 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.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
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
26
+ requirements:
27
27
  - - ~>
28
- - !ruby/object:Gem::Version
29
- version: 1.7.7
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.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
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
41
  none: false
42
- requirements:
42
+ requirements:
43
43
  - - ~>
44
- - !ruby/object:Gem::Version
45
- version: 1.6.18
46
- - !ruby/object:Gem::Dependency
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
- requirement: !ruby/object:Gem::Requirement
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
- version: 2.6.7
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
- version_requirements: !ruby/object:Gem::Requirement
72
+ requirement: &id004 !ruby/object:Gem::Requirement
57
73
  none: false
58
- requirements:
74
+ requirements:
59
75
  - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 2.6.7
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
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
- version_requirements: !ruby/object:Gem::Requirement
88
+ requirement: &id005 !ruby/object:Gem::Requirement
73
89
  none: false
74
- requirements:
90
+ requirements:
75
91
  - - ~>
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
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
- version_requirements: !ruby/object:Gem::Requirement
104
+ requirement: &id006 !ruby/object:Gem::Requirement
89
105
  none: false
90
- requirements:
106
+ requirements:
91
107
  - - ~>
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
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
- version_requirements: !ruby/object:Gem::Requirement
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
- version_requirements: !ruby/object:Gem::Requirement
136
+ requirement: &id008 !ruby/object:Gem::Requirement
121
137
  none: false
122
- requirements:
138
+ requirements:
123
139
  - - ~>
124
- - !ruby/object:Gem::Version
125
- version: 0.4.0
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
- files:
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
- require_paths:
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
- version: '0'
178
- required_rubygems_version: !ruby/object:Gem::Requirement
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
- version: '0'
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.8.23
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