canals 0.8.1 → 0.8.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: 640c199a27090fc4120fbccc40a44aa83085136d
4
- data.tar.gz: 86ae906c6ad18823e1a603938a415152d40f5e41
3
+ metadata.gz: 3df35b01f8f9e53a33d3b7f4f382cf5a7be93e44
4
+ data.tar.gz: 54eed2eb3f91b7d9c3c0dff54d58fa19ed066062
5
5
  SHA512:
6
- metadata.gz: bc9893c23409c5c4ac7f0392cc84ffbcf7e111f64fb6de3d3693823604cc238b6bb3f81635b8caab2786c9a058cccc1330ae9fdcbe12adc115239dcb735a70ca
7
- data.tar.gz: b50229b51aced7e8baea9d110bb1eb27aef4c4bdc7f945a8856f264fce9f3048673fe61b252614e7e453a71d4c41cff3e6393042d6c9f9fbc6281b72f4ebfc52
6
+ metadata.gz: 6678efe399cdd797b6972f9db2f156747d0998b196f08259095e05eba1d22715e9348c883693b48b7aed800fb09a27f70ccbd221a5deb661bfe845ce7c0ad06e
7
+ data.tar.gz: 27f72678f52e4cf58cf48ff02c3f6cc6ba3896f265e3f211e7d507bc799ba70f186cbedfbc5d27b8109b5cbd6c2fa2d2bfb8921cbcb1d46be203ae1a1e808b89
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --order random
3
+ --require spec_helper
data/Gemfile CHANGED
@@ -2,7 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
4
  gem 'rake'
5
- gem 'pry'
6
5
  end
7
6
 
8
7
  gemspec
data/README.md CHANGED
@@ -11,3 +11,24 @@ Behind the scenes, Canals creates SSH tunnels using the standard OpenSSH library
11
11
  gem install canals
12
12
  canal setup wizard
13
13
  ```
14
+
15
+ ### SSH tips
16
+ #### Keep Alive
17
+ SSH tunnels tend to die after some time. it's sad but true.
18
+ but we can do something to try and keep them alive as long as possible.
19
+ Edit your `~/.ssh/config` file (and if it doesn't exist, create it)
20
+ and add the following 2 lines:
21
+ ```
22
+ Host *
23
+ ServerAliveInterval 60
24
+ ```
25
+ so in the end:
26
+ ```
27
+ $ cat ~/.ssh/config
28
+ Host *
29
+ ServerAliveInterval 60
30
+
31
+ $ chmod 600 ~/.ssh/config
32
+ $ chown uesr:group ~/.ssh/config
33
+ ```
34
+ (where user:group is your user:group on your system)
@@ -13,7 +13,8 @@ module Canals
13
13
 
14
14
  def tstart(name)
15
15
  pid = Canals.start(name)
16
- say "Created tunnel #{name.inspect} with pid #{pid}"
16
+ tunnel = Canals.repository.get(name)
17
+ say "Created tunnel #{name.inspect} with pid #{pid}. You can access it using '#{tunnel.bind_address}:#{tunnel.local_port}'"
17
18
  pid
18
19
  end
19
20
 
@@ -2,7 +2,6 @@ require 'canals'
2
2
  require 'canals/options'
3
3
  require 'canals/environment'
4
4
  require 'thor'
5
- require 'pry'
6
5
 
7
6
  module Canals
8
7
  module Cli
@@ -23,7 +22,6 @@ module Canals
23
22
 
24
23
  desc 'commands', 'List all the base level commands'
25
24
  def commands(subcommand=nil)
26
- #binding.pry
27
25
  thor_class = Canals::Cli::Application
28
26
  if !subcommand.nil?
29
27
  thor_class = thor_class.subcommand_classes[subcommand]
@@ -14,8 +14,8 @@ module Canals
14
14
  return if session_empty?
15
15
  require 'terminal-table'
16
16
  require 'canals/core_ext/string'
17
- columns = ["pid", "name", "socket"]
18
- rows = Canals.session.map{ |s| columns.map{ |c| s[c.to_sym] } }
17
+ columns = ["pid", "name", "local_port", "socket"]
18
+ rows = Canals.session.map{ |s| columns.map{ |c| s[c.to_sym] || get_session_col_val(s, c) } }
19
19
  table = Terminal::Table.new :headings => columns.map{|c| c.sub("_"," ").titleize }, :rows => rows
20
20
  say table
21
21
  end
@@ -57,6 +57,15 @@ module Canals
57
57
  say "#{command} done.", :green
58
58
  end
59
59
 
60
+ def get_session_col_val(session, key)
61
+ case key
62
+ when "local_port"
63
+ entry = Canals.repository.get(session[:name])
64
+ return entry.local_port if entry
65
+ end
66
+ nil
67
+ end
68
+
60
69
  def session_empty?
61
70
  if Canals.session.empty?
62
71
  say "Canal session is currently empty."
@@ -1,6 +1,6 @@
1
1
  module Canals
2
2
 
3
3
  # Canals gem current version
4
- VERSION = "0.8.1"
4
+ VERSION = "0.8.2"
5
5
 
6
6
  end
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  require 'canals/environment'
3
2
  require 'psych'
4
3
 
@@ -1,4 +1,3 @@
1
- require 'spec_helper'
2
1
  require 'canals/options'
3
2
  require 'psych'
4
3
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ido Abramovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-16 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - ".rspec"
63
64
  - ".rvmrc"
64
65
  - Gemfile
65
66
  - LICENSE