shaft 0.8.5 → 0.8.8

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.
Files changed (4) hide show
  1. data/README.md +1 -0
  2. data/bin/shaft +6 -2
  3. data/lib/shaft/version.rb +1 -1
  4. metadata +2 -2
data/README.md CHANGED
@@ -50,6 +50,7 @@ An example configuration would be:
50
50
  port: 22
51
51
  username: user
52
52
  host: remote-host
53
+ reverse: false
53
54
  bind:
54
55
  client-port: 9999
55
56
  host: host
data/bin/shaft CHANGED
@@ -67,14 +67,18 @@ class ShaftCLI < Thor
67
67
  return
68
68
  end
69
69
 
70
- used = local_port_used?(c['bind']['client-port'])
70
+ used = c['reverse'] ? false : local_port_used?(c['bind']['client-port'])
71
+ if c['reverse']
72
+ say "Reverse tunnel, skipping port check."
73
+ end
71
74
  if used
72
75
  error "Local port #{port} is used by:\n#{used}"
73
76
  return
74
77
  end
75
78
 
76
79
  say "Starting tunnel '#{name}'..."
77
- pid = Process.spawn("ssh -N -p #{port} #{host} -L #{bind}")
80
+ flag = c['reverse'] ? 'R' : 'L'
81
+ pid = Process.spawn("ssh -N -p #{port} #{host} -#{flag} #{bind}")
78
82
  Process.detach pid
79
83
  say "Started with pid #{pid}."
80
84
 
@@ -1,3 +1,3 @@
1
1
  module Shaft
2
- VERSION = "0.8.5"
2
+ VERSION = "0.8.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaft
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-28 00:00:00.000000000 Z
12
+ date: 2013-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor