peco_selector 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/peco_selector.rb +3 -2
- data/lib/peco_selector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeb3f824d41626e0fbd5a587e8807f5eedd8b3e8
|
4
|
+
data.tar.gz: 9eb58646aee69a1618d32006c7bacf2f00e4e349
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd312aa1c0d9e2af4ea4bc2ecaff698064e8f51e11fc6b6b8d43d7bbf5426f6631402e478d489dc77809dfb731283e357eb53fd4df29bc2025f08dc598ec73eb
|
7
|
+
data.tar.gz: b1ea515cd879c1d5829b3d754840b3875d51da06244f3ac584eba72e81b528f5f0e6c01b36720e23a0c41c7d06de4a7d61dd675cf1db94f9cb98ed044ed384dd
|
data/lib/peco_selector.rb
CHANGED
@@ -19,6 +19,7 @@ module PecoSelector
|
|
19
19
|
|
20
20
|
Open3.popen3("#{PECO_BIN} --null --prompt #{Shellwords.escape(prompt)}") do |stdin, stdout, stderr, wait_thr|
|
21
21
|
candidates.each do |display, value|
|
22
|
+
value ||= display
|
22
23
|
stdin.puts "#{display}\x00#{value.object_id}"
|
23
24
|
end
|
24
25
|
stdin.close
|
@@ -35,8 +36,8 @@ module PecoSelector
|
|
35
36
|
|
36
37
|
object_ids = stdout_str.strip.split("\n").map(&:to_i)
|
37
38
|
|
38
|
-
candidates.map do |
|
39
|
-
value
|
39
|
+
candidates.map do |display, value|
|
40
|
+
value || display
|
40
41
|
end.select do |value|
|
41
42
|
object_ids.include?(value.object_id)
|
42
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peco_selector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryota Arai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|