ifilter 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/lib/ifilter/client.rb +3 -3
- data/lib/ifilter/input.rb +2 -2
- data/lib/ifilter/monospaced_string.rb +1 -1
- data/lib/ifilter/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd5b9e238a172630648a09b8f877f01e34ed7dcb
|
4
|
+
data.tar.gz: e2bd0c6f2b356090160235e53ccc673efc5119b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3b909015cdcfb9bd667004e61be6b3dbcf98a91a6aef17abcfd4a848cf1157f2bf0fe0915f2b1b19c6a1e04a1c91345f31b64c206fdb5e03d4611847c0a4f38
|
7
|
+
data.tar.gz: e9e9f8032730b9f5122a1cb60c8b79e1fdf72d61e3858eacf170b9c66f496ba9cbba418c22c9307d16dfeec7465ef1ef39b9c47039d42c2a762adef97c3028b0
|
data/README.md
CHANGED
@@ -32,9 +32,9 @@ Or install it yourself as:
|
|
32
32
|
$ ps aux | ifilter
|
33
33
|
```
|
34
34
|
|
35
|
-
![execute](http://kaihar4.com/images/github.com/kaihar4/ifilter/execute.gif)
|
35
|
+
![execute](http://file.kaihar4.com/images/github.com/kaihar4/ifilter/execute.gif)
|
36
36
|
|
37
|
-
### Module
|
37
|
+
### Module/Class
|
38
38
|
|
39
39
|
```ruby
|
40
40
|
# test.rb
|
@@ -44,7 +44,21 @@ array = ['foo', 'bar', 'hoge', 'fuga']
|
|
44
44
|
puts Ifilter.filtering(array)
|
45
45
|
```
|
46
46
|
|
47
|
-
![module](http://kaihar4.com/images/github.com/kaihar4/ifilter/module.gif)
|
47
|
+
![module](http://file.kaihar4.com/images/github.com/kaihar4/ifilter/module.gif)
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
# test2.rb
|
51
|
+
require 'ifilter'
|
52
|
+
|
53
|
+
array = ['Small', 'Medium', 'Large']
|
54
|
+
|
55
|
+
client = Ifilter::Client.new('Please choose a size')
|
56
|
+
result = client.execute(array)
|
57
|
+
|
58
|
+
puts result
|
59
|
+
```
|
60
|
+
|
61
|
+
![class](http://file.kaihar4.com/images/github.com/kaihar4/ifilter/class.gif)
|
48
62
|
|
49
63
|
## Development
|
50
64
|
|
data/lib/ifilter/client.rb
CHANGED
@@ -30,7 +30,7 @@ module Ifilter
|
|
30
30
|
@filtered_result = nil
|
31
31
|
@page_number = 1
|
32
32
|
|
33
|
-
elsif key == 127 # <BS>
|
33
|
+
elsif key == 127 || key == 263 # <BS>
|
34
34
|
@input.backspace!
|
35
35
|
@filtered_result = nil
|
36
36
|
@page_number = 1
|
@@ -102,7 +102,7 @@ module Ifilter
|
|
102
102
|
@window << match_string
|
103
103
|
@window.attrunset(Curses.color_pair(3))
|
104
104
|
|
105
|
-
@window << word[match_pos + match_string.
|
105
|
+
@window << word[match_pos + match_string.monospaced_size, (@window.maxx - 1) - (match_pos + @input.monospaced_size)]
|
106
106
|
else
|
107
107
|
@window << word[0, @window.maxx - 1]
|
108
108
|
end
|
@@ -116,7 +116,7 @@ module Ifilter
|
|
116
116
|
@window.setpos(0, @window.maxx)
|
117
117
|
|
118
118
|
word = "[#{@page_number}/#{max_page_number.zero? ? 1 : max_page_number}]"
|
119
|
-
@window << (' ' * (@window.maxx - @prompt.
|
119
|
+
@window << (' ' * (@window.maxx - @prompt.monospaced_size - @input.monospaced_size - word.monospaced_size)) + word
|
120
120
|
end
|
121
121
|
|
122
122
|
def up_cursor_position
|
data/lib/ifilter/input.rb
CHANGED
data/lib/ifilter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ifilter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kaihar4
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: curses
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.5.1
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Interactive Filter
|