utils 0.0.76 → 0.0.77

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: 1d72fc99d997951800d70adeb0ab246f767d0600
4
- data.tar.gz: ce9c4e2b738446cbb69b910786150e592cdbac07
3
+ metadata.gz: 3a685e5113f973b6f044465d5535dfc1b3db973f
4
+ data.tar.gz: 8d4ef8c6eb7cd1d8aabb937a7868b343858f80e6
5
5
  SHA512:
6
- metadata.gz: 4ef11e212f2cfb1656330f769afdd629f4b265f29dc54cb89d3e9551d23f7439c0fe1547da8ce434bc371633c289f6deb58bf0f45b015d3716e7b06f1524149a
7
- data.tar.gz: 901123e44de2885133571f1e907fb17a26fbe1e2158d5bc91eb67c783ca3b9eee955c012c0ca8a0a532dd3a34c0cd4c84357c1a743dd3f5f34f95eb28faa128d
6
+ metadata.gz: faa4c6848850fe2013f5e4671efb653edf8806771b8e0db2121e51cfa1bb318b43c90b66e6c934b054996e5f6d837b1a3d1bd723c5b315e8a2178eefe8f0f431
7
+ data.tar.gz: 419d806822b4c2dd30aa088ed96a94b78e20a47170343671bb4306497a871a42c59a899affe293a3c5db1ab177929881cf9e7ba98eaec4db5dbc173be7818e9c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.76
1
+ 0.0.77
data/lib/utils/editor.rb CHANGED
@@ -115,6 +115,7 @@ module Utils
115
115
  end
116
116
 
117
117
  def edit(*filenames)
118
+ ensure_running
118
119
  if filenames.size == 1 and
119
120
  source_location = filenames.first.source_location
120
121
  then
@@ -171,7 +172,14 @@ module Utils
171
172
  sleep pause_duration
172
173
  edit_remote_send('<ESC>:bw<CR>')
173
174
  else
174
- # TODO use tmux to switch to editor pane?
175
+ switch_to_index =
176
+ `tmux list-panes -F '\#{pane_pid} \#{pane_index}'`.lines.find { |l|
177
+ pid, index = l.split(' ')
178
+ if `ps -eo ppid,command|grep ^#{pid}` =~ %r(/edit )
179
+ break index.to_i
180
+ end
181
+ }
182
+ switch_to_index and system "tmux select-pane -t #{switch_to_index}"
175
183
  end
176
184
  end
177
185
 
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.0.76'
3
+ VERSION = '0.0.77'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/utils.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "utils"
5
- s.version = "0.0.76"
5
+ s.version = "0.0.77"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Florian Frank"]
9
- s.date = "2013-05-13"
9
+ s.date = "2013-05-14"
10
10
  s.description = "This ruby gem provides some useful command line utilities"
11
11
  s.email = "flori@ping.de"
12
12
  s.executables = ["chroot-exec", "chroot-libs", "classify", "create_tags", "discover", "edit", "edit_wait", "enum", "errf", "git-empty", "irb_connect", "myex", "number_files", "on_change", "path", "probe", "remote_copy", "same_files", "search", "sedit", "ssh-tunnel", "strip_spaces", "unquarantine_apps", "untest", "utils-install-config", "utils-utilsrc", "vacuum_firefox_sqlite", "xmp"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.76
4
+ version: 0.0.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-13 00:00:00.000000000 Z
11
+ date: 2013-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar