i2cssh 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/i2cssh.gemspec +2 -2
  4. data/lib/i2cssh.rb +29 -20
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7579f29eb10250543d261aab81dc8372cd3a6c44
4
- data.tar.gz: 2e47fdc962871fbc25b03db27ea2dd9af78dd72d
3
+ metadata.gz: 9ae84134f38887618471a3f0a1f987c529011752
4
+ data.tar.gz: 72a055afdc9d135cb535004b023f0e0bb9bd82e4
5
5
  SHA512:
6
- metadata.gz: 657996cafa0e2905cc45b5e29ecbcf79951bfd912bf52fb749275db7a97024f3cab2c8230fcb5262fce8c9881339c6a1bd3ed640a14ec40f2a577e33b9fbdb14
7
- data.tar.gz: fac50569cbb9bb57701f0a8e946357dab43aaf43cf60c8d6078a1765be192f2ac880c188ffa22fd50d55dedc2bfe5094c39143645713231aa86cc336cc16d924
6
+ metadata.gz: 25e039871f95ea23c6fe50c7c68ee7c6b83504922be105e938e53d408e0e98ecdafb18cf06cfc9b29b32589cbccbbe1cba97b9419b9cc9a46a0652d9c12bdaa5
7
+ data.tar.gz: c61cd58abd6b314df8732ae3ab97450e5bfd13ebf0d5623b7c4f27433af02763e2d1e8dab140ec6996ed50556eae609a6fc22e410a9fa7c35dd44e3f7e936bbb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.10.0
1
+ 1.11.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "i2cssh"
8
- s.version = "1.10.0"
8
+ s.version = "1.11.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wouter de Bie"]
12
- s.date = "2014-02-12"
12
+ s.date = "2014-02-23"
13
13
  s.description = "csshX like cluster ssh using iTerm2 panes"
14
14
  s.email = "wouter@evenflow.se"
15
15
  s.executables = ["i2cssh"]
@@ -25,18 +25,22 @@ class I2Cssh
25
25
  session.exec :command => "/bin/bash -l"
26
26
 
27
27
  compute_geometry
28
+ maximize(app_name) if i2_options[:fullscreen]
28
29
  split_session
29
- maximize if i2_options[:fullscreen]
30
-
31
30
  start_ssh
32
31
  enable_broadcast if i2_options[:broadcast]
33
32
  end
34
33
 
35
34
  private
36
- def maximize
37
- fullscreen_bounds = Appscript.app.by_name('Finder').desktop.window.bounds
38
- window = @iterm.windows.get.sort_by{|x| x.id_.get}.last
39
- window.bounds.set fullscreen_bounds.get
35
+ def maximize(app_name)
36
+ begin
37
+ # OSX >= 10.8 has different behavior for full screen. First try out old behavior.
38
+ fullscreen_bounds = Appscript.app.by_name('Finder').desktop.window.bounds
39
+ window = @iterm.windows.get.sort_by{|x| x.id_.get}.last
40
+ window.bounds.set fullscreen_bounds.get
41
+ rescue
42
+ @sys_events.processes[app_name].windows.first.attributes["AXFullScreen"].value.set(true)
43
+ end
40
44
  end
41
45
 
42
46
  def compute_geometry
@@ -45,12 +49,17 @@ class I2Cssh
45
49
  @columns = @i2_options[:columns]
46
50
 
47
51
  if @rows then
48
- @columns = (count / @rows.to_f).ceil
52
+ @columns = (count / @rows.to_f).ceil
49
53
  elsif @columns then
50
- @rows = (count / @columns.to_f).ceil
54
+ @rows = (count / @columns.to_f).ceil
51
55
  else
52
- @columns = Math.sqrt(count).ceil
53
- @rows = (count / @columns.to_f).ceil
56
+ @columns = Math.sqrt(count).ceil
57
+ @rows = (count / @columns.to_f).ceil
58
+ end
59
+ # Quick hack: iTerms default window only supports up to 11 rows and 22 columns
60
+ # If we surpass either one, we resort to full screen.
61
+ if @rows > 11 or @columns > 22 then
62
+ @i2_options[:fullscreen] = true
54
63
  end
55
64
  end
56
65
 
@@ -79,17 +88,17 @@ class I2Cssh
79
88
 
80
89
  first = true
81
90
  2.upto splitconfig[:x] do
82
- splitconfig[0].click
91
+ splitconfig[0].click
83
92
  end
84
93
  2.upto splitconfig[:y] do
85
- 1.upto splitconfig[:x] do
86
- splitconfig[1].click
87
- first = false
88
- end
89
- splitconfig[:x].times do |x|
90
- splitconfig[2].click
91
- splitconfig[3].click
92
- end
94
+ 1.upto splitconfig[:x] do
95
+ splitconfig[1].click
96
+ first = false
97
+ end
98
+ splitconfig[:x].times do |x|
99
+ splitconfig[2].click
100
+ splitconfig[3].click
101
+ end
93
102
  end
94
103
  end
95
104
 
@@ -103,7 +112,7 @@ class I2Cssh
103
112
  1.upto(@rows*@columns) do |i|
104
113
  server = @servers[i-1]
105
114
  if server then
106
- ssh_env = ""
115
+ send_env = ""
107
116
 
108
117
  if @i2_options[:rank] then
109
118
  @ssh_environment['LC_RANK'] = i-1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i2cssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wouter de Bie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-12 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler