utils 0.0.81 → 0.0.82

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: a7dab50374f65fbfebaa369f874bae1b77cbf3f3
4
- data.tar.gz: 5050f28d2580d785dc911b68f8039e535acaa780
3
+ metadata.gz: 85ce1623a7e47439352723aa155771aa01fb6736
4
+ data.tar.gz: ec9ce26f04a73b26c0411b78c210f4d7b3ecabc3
5
5
  SHA512:
6
- metadata.gz: e2fb669ebfaa45d554cca794eb4d565cbcc920401ec6c2f53dde49fb0cad31ec1c51faf8614968d0b5021b1b8c83d64ee0f5f75138076ad53235d086792f8372
7
- data.tar.gz: 39bb05ab6ce216b69d78246f22e8a36d8356a9c6d5fb81a29bd0655a949ecdff9b2e819635f0c3bd692e57ce8bbd2a9982dbd925e003607cd98415241421d486
6
+ metadata.gz: 255e2546e728afe76ca1a25be1e0241875855341b388b32d8b6b841574393744994983f3b183ab3d8d4f6ba3640aebbcb90f12c8b4dc882b1c7a9ae992e4e092
7
+ data.tar.gz: 28471e78f74c2023c990cd92fee399b80fe0690a80044e384056443d0fc89a8f8f9c89a58f24de92b4095243f08df327a89b8d322e2815cf65ef804928d50b4a
data/Rakefile CHANGED
@@ -18,6 +18,7 @@ GemHadar do
18
18
  dependency 'tins', '~>0.6'
19
19
  dependency 'term-ansicolor', '~>1.0'
20
20
  dependency 'dslkit', '~>0.2.10'
21
+ dependency 'pstree'
21
22
  dependency 'pry-editline'
22
23
 
23
24
  install_library do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.81
1
+ 0.0.82
@@ -2,6 +2,7 @@ require 'tins/xt/full'
2
2
  require 'tins/deep_const_get'
3
3
  require 'fileutils'
4
4
  require 'rbconfig'
5
+ require 'pstree'
5
6
 
6
7
  module Utils
7
8
  class Editor
@@ -168,11 +169,12 @@ module Utils
168
169
  sleep pause_duration
169
170
  edit_remote_send('<ESC>:bw<CR>')
170
171
  else
172
+ pstree = PSTree.new
171
173
  switch_to_index =
172
174
  `tmux list-panes -F '\#{pane_pid} \#{pane_index}'`.lines.find { |l|
173
175
  pid, index = l.split(' ')
174
- pid.to_i == $$ and next
175
- if `ps -eo ppid,command|grep -v ' grep'|grep ^#{pid}` =~ %r(/edit( |$))
176
+ pid = pid.to_i
177
+ if pstree.find { |ps| ps.pid != $$ && ps.ppid == pid && ps.cmd =~ %r(/edit( |$)) }
176
178
  break index.to_i
177
179
  end
178
180
  }
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.0.81'
3
+ VERSION = '0.0.82'
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:
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "utils"
5
- s.version = "0.0.81"
5
+ s.version = "0.0.82"
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-14"
9
+ s.date = "2013-05-15"
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"]
@@ -26,12 +26,14 @@ Gem::Specification.new do |s|
26
26
  s.add_runtime_dependency(%q<tins>, ["~> 0.6"])
27
27
  s.add_runtime_dependency(%q<term-ansicolor>, ["~> 1.0"])
28
28
  s.add_runtime_dependency(%q<dslkit>, ["~> 0.2.10"])
29
+ s.add_runtime_dependency(%q<pstree>, [">= 0"])
29
30
  s.add_runtime_dependency(%q<pry-editline>, [">= 0"])
30
31
  else
31
32
  s.add_dependency(%q<gem_hadar>, ["~> 0.1.8"])
32
33
  s.add_dependency(%q<tins>, ["~> 0.6"])
33
34
  s.add_dependency(%q<term-ansicolor>, ["~> 1.0"])
34
35
  s.add_dependency(%q<dslkit>, ["~> 0.2.10"])
36
+ s.add_dependency(%q<pstree>, [">= 0"])
35
37
  s.add_dependency(%q<pry-editline>, [">= 0"])
36
38
  end
37
39
  else
@@ -39,6 +41,7 @@ Gem::Specification.new do |s|
39
41
  s.add_dependency(%q<tins>, ["~> 0.6"])
40
42
  s.add_dependency(%q<term-ansicolor>, ["~> 1.0"])
41
43
  s.add_dependency(%q<dslkit>, ["~> 0.2.10"])
44
+ s.add_dependency(%q<pstree>, [">= 0"])
42
45
  s.add_dependency(%q<pry-editline>, [">= 0"])
43
46
  end
44
47
  end
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.81
4
+ version: 0.0.82
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-14 00:00:00.000000000 Z
11
+ date: 2013-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ~>
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.2.10
69
+ - !ruby/object:Gem::Dependency
70
+ name: pstree
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: pry-editline
71
85
  requirement: !ruby/object:Gem::Requirement