ifilter 0.2.1 → 0.2.2

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: 75be2e647b9ebaf3c9652b9891e1ad4697c0df59
4
- data.tar.gz: 5358032cc2dd7af4e0e80488699e75d8780f80e6
3
+ metadata.gz: 0934f665f7cb1e6e4965d6aba967f88187510dc3
4
+ data.tar.gz: bcec824ea7f1643c85af7f158e1c0d6031051105
5
5
  SHA512:
6
- metadata.gz: f910a4502e01599dd89757f3d6812ed0f966beabdcbc972c188bb475c086d025fda143218b6f4817969fa399be7fa99ae3e5a2d186cf416884be444d5418d06d
7
- data.tar.gz: c520dc8568894a315cfac375978c4d54de9f01606988e9ab04d1fe5bd014d8b4fca0154bcd9f5ab54aa791e8c9cb6a6ca06c7478e4b793fbb1f683166c7f8b8f
6
+ metadata.gz: b2dbaa49a527a3657102c08a5ddd36f0ff21ae3eff802ebcc3c209202e48f3db09ebb6747660ec1fffe7f3c6a4d4e4598acb253fd9a3629b4d5ab6cca1354d29
7
+ data.tar.gz: ae32bbb0278299ca5b5d85ec059d222d86f72d1d4f2d8f93f8ed32bcd4ebd1356cb22f390ad3cb73e89057e0dd344489767798c7aaa3312384f2232bd41d1654
@@ -13,8 +13,8 @@ module Ifilter
13
13
  STDOUT.reopen('/dev/tty')
14
14
  end
15
15
 
16
- ifilter = Client.new(name)
17
- result = ifilter.grep(array)
16
+ client = Client.new(name)
17
+ result = client.execute(array)
18
18
 
19
19
  unless isatty
20
20
  STDOUT.flush
@@ -14,7 +14,7 @@ module Ifilter
14
14
  @window = Window.new(Curses.lines, Curses.cols, 0, 0)
15
15
  end
16
16
 
17
- def grep(array)
17
+ def execute(array)
18
18
  @target = array
19
19
 
20
20
  update_window
@@ -95,12 +95,12 @@ module Ifilter
95
95
  if !@input.size.zero? && match_pos = word =~ @input.to_regexp
96
96
  @window << word[0, match_pos]
97
97
 
98
+ match_string = Regexp.last_match(0)
98
99
  @window.attrset(Curses.color_pair(3))
99
- @window << word[match_pos, @input.size]
100
+ @window << match_string
100
101
  @window.attrunset(Curses.color_pair(3))
101
102
 
102
- @window << word[match_pos + @input.size, (@window.maxx - 1) - (match_pos + @input.size)]
103
- @window.attrset(Curses.color_pair(1))
103
+ @window << word[match_pos + match_string.size, (@window.maxx - 1) - (match_pos + @input.size)]
104
104
  else
105
105
  @window << word[0, @window.maxx - 1]
106
106
  end
@@ -1,3 +1,3 @@
1
1
  module Ifilter
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaihar4
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-10-13 00:00:00.000000000 Z
11
+ date: 2015-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses