teamocil 1.2 → 1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1c86cb621b8cdae9e6c88da35691a7b609ed820
4
- data.tar.gz: 23f172c3824cd34f2e1dcf87ae1e828005b0dd27
3
+ metadata.gz: 430c52e4f910460b68c482b05474b0375999be67
4
+ data.tar.gz: 700961c611c6c392e0a5c1e7687fd7c8293c9e15
5
5
  SHA512:
6
- metadata.gz: 8b5692ccafb09e0eb382f39af977a976a73774fb57be39e906e55f8fe1aef6ba691c1a0f2a68c184bd273a9312a2e143fb8054d92cd6c3da16c1d0a3f4e20116
7
- data.tar.gz: 05621fd704bbf8dcf9d3d4a5103a308bdc95086b23a3fcd2dcd92121d5af8524ec8e105ec3af0e283f1e75782169f9cb3625dff6905fc639da9373a8c528d42d
6
+ metadata.gz: 7c6247841e7654ae24bd3301753f623228d43484bbd8f4a6086528f5b6db77405442c0cc1dca68aedb181a84f7e1e947d51d8ac7e23ef42d7642cc7765f367e1
7
+ data.tar.gz: a9a655929c336f54b2e7336a448c669947d80f48c861d30b0edd74fd087a85936ea7c9f72a2d913a71549541e43a3deaed4dd23bf2c98697bde7167a90d121ef
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2014 Rémi Prévost
1
+ Copyright (c) 2011-2015 Rémi Prévost
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -243,6 +243,6 @@ folks did:
243
243
 
244
244
  ## License
245
245
 
246
- Teamocil is © 2011-2014 [Rémi Prévost](http://exomel.com) and may be freely
246
+ Teamocil is © 2011-2015 [Rémi Prévost](http://exomel.com) and may be freely
247
247
  distributed under the [MIT license](https://github.com/remiprev/teamocil/blob/master/LICENSE.md).
248
248
  See the `LICENSE.md` file for more information.
@@ -1,8 +1,8 @@
1
1
  module Teamocil
2
2
  module Command
3
- class SelectLayout < ClosedStruct.new(:layout)
3
+ class SelectLayout < ClosedStruct.new(:layout, :name)
4
4
  def to_s
5
- "select-layout '#{layout}'"
5
+ "select-layout -t '#{name}' '#{layout}'"
6
6
  end
7
7
  end
8
8
  end
@@ -2,7 +2,7 @@ module Teamocil
2
2
  module Command
3
3
  class SendKeysToPane < ClosedStruct.new(:index, :keys)
4
4
  def to_s
5
- "send-keys -t #{index} '#{keys}'"
5
+ "send-keys -t '#{index}' '#{keys}'"
6
6
  end
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
1
  module Teamocil
2
2
  module Command
3
- class SplitWindow < ClosedStruct.new(:root)
3
+ class SplitWindow < ClosedStruct.new(:root, :name)
4
4
  def to_s
5
- "split-window #{options.join(' ')}"
5
+ "split-window -t '#{name}' #{options.join(' ')}"
6
6
  end
7
7
 
8
8
  def options
@@ -1,17 +1,17 @@
1
1
  module Teamocil
2
2
  module Tmux
3
- class Pane < ClosedStruct.new(:index, :root, :commands, :focus, :layout)
3
+ class Pane < ClosedStruct.new(:index, :root, :commands, :focus, :layout, :name)
4
4
  def as_tmux
5
5
  [].tap do |tmux|
6
- tmux << Teamocil::Command::SplitWindow.new(root: root) unless first?
6
+ tmux << Teamocil::Command::SplitWindow.new(root: root, name: name) unless first?
7
7
  tmux << Teamocil::Command::SendKeysToPane.new(index: internal_index, keys: commands.join('; ')) if commands
8
8
  tmux << Teamocil::Command::SendKeysToPane.new(index: internal_index, keys: 'Enter')
9
- tmux << Teamocil::Command::SelectLayout.new(layout: layout) if layout
9
+ tmux << Teamocil::Command::SelectLayout.new(layout: layout, name: name) if layout
10
10
  end
11
11
  end
12
12
 
13
13
  def internal_index
14
- index + self.class.pane_base_index
14
+ "#{name}.#{index + self.class.pane_base_index}"
15
15
  end
16
16
 
17
17
  def self.pane_base_index
@@ -15,12 +15,15 @@ module Teamocil
15
15
  # Panes need to know their position
16
16
  pane.merge! index: index
17
17
 
18
- # Panes need know the window root directory
18
+ # Panes need to know the window root directory
19
19
  pane.merge! root: root
20
20
 
21
- # Panes need know the window layout
21
+ # Panes need to know the window layout
22
22
  pane.merge! layout: layout
23
23
 
24
+ # Panes need to know the window name
25
+ pane.merge! name: name
26
+
24
27
  Teamocil::Tmux::Pane.new(pane)
25
28
  end
26
29
  end
@@ -46,6 +49,7 @@ module Teamocil
46
49
  # Set the focus on the right pane or the first one
47
50
  focused_pane = panes.find(&:focus)
48
51
  focused_index = focused_pane ? focused_pane.internal_index : Teamocil::Tmux::Pane.pane_base_index
52
+ focused_index = "#{name}.#{focused_index}"
49
53
  tmux << Teamocil::Command::SelectPane.new(index: focused_index)
50
54
  end.flatten
51
55
  end
@@ -1,3 +1,3 @@
1
1
  module Teamocil
2
- VERSION = '1.2'
2
+ VERSION = '1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamocil
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.2'
4
+ version: '1.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rémi Prévost
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-16 00:00:00.000000000 Z
11
+ date: 2015-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.2.2
138
+ rubygems_version: 2.4.5
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Teamocil is a simple tool used to automatically create windows and panes