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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1b02871ed9492ae5b9092a09cec914ae1f7f406
4
- data.tar.gz: 6a3f8b5a1a07c2f087f11c26abedf5996241af39
3
+ metadata.gz: f1195729e4e9dbc582040ac56c5b2074920cff32
4
+ data.tar.gz: 494e925663226207da2edbbc0968930095ea9b18
5
5
  SHA512:
6
- metadata.gz: d780e315ef9edbed2f3c9b1533fd2ccd45536fcd075280d0c11c6642fac7b12a049c66b88e07050c96b1b8ae44d8296f881f821d131e3e0874579aacfa851ca0
7
- data.tar.gz: f46d79271f87c037ae113082991447017bc48f7ce0b7827083a09fc9e631dc533c76fc852b23e8fb3c35c7b458ef0fed407164c3905761e62fb1a85a0ede9e0f
6
+ metadata.gz: d6b7d4a7766248da03d6ca97f23fd0f073bfb8ad8eebb6d63f0dff06b394c405d18d296e8cedd8b6050ee3751a3ef56e57ab4014bf394d2522ab2e99d4396d93
7
+ data.tar.gz: c776b1e4802c64bab774c2c22e9ba1baead5137083b3315039ff9963fc57f33d4707730cb60092a54f745339cc2535a8e058be96ad02f7bb536450554853561d
@@ -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 '--file STRING', String, 'File to upload'
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.file
58
- puts "Syntax: devtunnel --file /your/file.pdf"
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
- puts "forwarding port. Other people can connect at: xyz"
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Devtunnel
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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-18 00:00:00.000000000 Z
11
+ date: 2013-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander