i2cssh 1.8.1 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/i2cssh.gemspec +1 -1
  3. data/lib/i2cssh.rb +17 -6
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.1
1
+ 1.9.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "i2cssh"
8
- s.version = "1.8.1"
8
+ s.version = "1.9.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"]
@@ -14,6 +14,9 @@ class I2Cssh
14
14
 
15
15
  @sys_events = Appscript.app.by_name('System Events')
16
16
  @iterm = Appscript.app.by_name(app_name)
17
+
18
+ @pane_menu = @sys_events.processes[app_name].menu_bars[1].menu_bar_items["Window"].menus["Window"].menu_items["Select Split Pane"].menus["Select Split Pane"]
19
+ @shell_menu = @sys_events.processes[app_name].menu_bars[1].menu_bar_items["Shell"].menus["Shell"]
17
20
  @term = @iterm.make(:new => :terminal)
18
21
 
19
22
  @profile = i2_options[:profile] || "Default"
@@ -52,24 +55,32 @@ class I2Cssh
52
55
  end
53
56
 
54
57
  def split_session
58
+ left = @pane_menu.menu_items["Select Pane Left"]
59
+ right = @pane_menu.menu_items["Select Pane Right"]
60
+ up = @pane_menu.menu_items["Select Pane Above"]
61
+ down = @pane_menu.menu_items["Select Pane Below"]
62
+
63
+ split_vert = @shell_menu.menu_items["Split Vertically with Current Profile"]
64
+ split_hori = @shell_menu.menu_items["Split Horizontally with Current Profile"]
65
+
55
66
  splitmap = {
56
- :column => {0 => "d", 1 => 123, 2 => "D", 3=> 124, :x => @columns, :y => @rows},
57
- :row => {0 => "D", 1=> 126, 2 => "d", 3=> 125, :x => @rows, :y => @columns}
67
+ :column => {0 => split_vert, 1 => left, 2 => split_hori, 3=> right, :x => @columns, :y => @rows},
68
+ :row => {0 => split_hori, 1=> up, 2 => split_vert, 3=> down, :x => @rows, :y => @columns}
58
69
  }
59
70
  splitconfig = splitmap[@i2_options[:direction]]
60
71
 
61
72
  first = true
62
73
  2.upto splitconfig[:x] do
63
- @sys_events.keystroke splitconfig[0], :using => :command_down
74
+ splitconfig[0].click
64
75
  end
65
76
  2.upto splitconfig[:y] do
66
77
  1.upto splitconfig[:x] do
67
- @sys_events.key_code splitconfig[1], :using => [:command_down, :option_down] unless first
78
+ splitconfig[1].click
68
79
  first = false
69
80
  end
70
81
  splitconfig[:x].times do |x|
71
- @sys_events.keystroke splitconfig[2], :using => :command_down
72
- @sys_events.key_code splitconfig[3], :using => [:command_down, :option_down] unless @columns - 1 == x
82
+ splitconfig[2].click
83
+ splitconfig[3].click
73
84
  end
74
85
  end
75
86
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i2cssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 8
9
- - 1
10
- version: 1.8.1
8
+ - 9
9
+ - 0
10
+ version: 1.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wouter de Bie