devtunnel 1.0.1 → 1.0.2
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.
- checksums.yaml +4 -4
- data/bin/devtunnel +11 -6
- data/lib/devtunnel/account.rb +6 -1
- data/lib/devtunnel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1195729e4e9dbc582040ac56c5b2074920cff32
|
4
|
+
data.tar.gz: 494e925663226207da2edbbc0968930095ea9b18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6b7d4a7766248da03d6ca97f23fd0f073bfb8ad8eebb6d63f0dff06b394c405d18d296e8cedd8b6050ee3751a3ef56e57ab4014bf394d2522ab2e99d4396d93
|
7
|
+
data.tar.gz: c776b1e4802c64bab774c2c22e9ba1baead5137083b3315039ff9963fc57f33d4707730cb60092a54f745339cc2535a8e058be96ad02f7bb536450554853561d
|
data/bin/devtunnel
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
|
3
3
|
require 'devtunnel'
|
4
4
|
require 'commander/import'
|
5
5
|
require 'io/console'
|
@@ -18,6 +18,7 @@ command :signup do |c|
|
|
18
18
|
puts "Register for a free devtunnel account using your email address and a password."
|
19
19
|
email = ask "email address: "
|
20
20
|
account = Devtunnel::Account.signup email
|
21
|
+
|
21
22
|
if account.success?
|
22
23
|
account.write_creds
|
23
24
|
puts "Account created, saving your credentials to #{File.expand_path("~/.devtunnel_auth")}."
|
@@ -51,16 +52,20 @@ command :forward do |c|
|
|
51
52
|
c.summary = ''
|
52
53
|
c.description = ''
|
53
54
|
c.example 'description', 'command example'
|
54
|
-
c.option '--
|
55
|
+
c.option '--port STRING', String, 'File to upload'
|
55
56
|
c.action do |args, options|
|
56
57
|
account = Devtunnel::Account.from_creds
|
57
|
-
unless options.
|
58
|
-
puts "Syntax: devtunnel --
|
58
|
+
unless options.port
|
59
|
+
puts "Syntax: devtunnel --port 8080"
|
59
60
|
exit 0
|
60
61
|
end
|
61
62
|
Devtunnel.api_key = account.api_key
|
62
|
-
|
63
|
-
|
63
|
+
|
64
|
+
fwd = Devtunnel::Account.forward options.port
|
65
|
+
|
66
|
+
puts "forwarding local port #{options.port} to https://devtunnel.madebymarket.com:#{fwd.port}"
|
67
|
+
puts "hit ctrl+c or close your terminal session to end forwarding."
|
68
|
+
`ssh -g -R #{fwd.port}:localhost:#{options.port} #{fwd.user}@devtunnel.madebymarket.com -p 2222 -N`
|
64
69
|
|
65
70
|
end
|
66
71
|
end
|
data/lib/devtunnel/account.rb
CHANGED
@@ -3,7 +3,7 @@ require_relative "api_model"
|
|
3
3
|
module Devtunnel
|
4
4
|
class Account
|
5
5
|
include ApiModel
|
6
|
-
attr_accessor :api_key, :email
|
6
|
+
attr_accessor :api_key, :email, :user, :port
|
7
7
|
|
8
8
|
def self.login(email, password)
|
9
9
|
params = {:basic_username => email, :basic_password => password}
|
@@ -34,5 +34,10 @@ module Devtunnel
|
|
34
34
|
fn = File.expand_path("~/.devtunnel_auth")
|
35
35
|
File.unlink(fn) if File.exist? fn
|
36
36
|
end
|
37
|
+
|
38
|
+
def self.forward port
|
39
|
+
params = {:port => port}
|
40
|
+
Devtunnel::Api.request :post, "/forward", params
|
41
|
+
end
|
37
42
|
end
|
38
43
|
end
|
data/lib/devtunnel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devtunnel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|