ruby-zoom 4.6.7 → 4.7.0

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: 3332a6169e32c19e41053bae8c029e6166c0953d
4
- data.tar.gz: dc92280462aee28f417b54aca921dcbcaacab40a
3
+ metadata.gz: efbedbe98f1dae228a6ea4aa0cbf388515bf9a98
4
+ data.tar.gz: a79e0cf5f183e9f69202b0c4f246d3e6d7478e15
5
5
  SHA512:
6
- metadata.gz: c5e8348b6c907b93567b9ee7b7c230428abf20576400734b6fa4c9fb80011ca7fd912ec2301b6175350be658c44b73aa5025363ff9e4fa10bd090b6baba953e2
7
- data.tar.gz: 35f1115514f57da40d91fa8240ec224cf32bfc05c0e5e79d0f1dca205d83de92108215ef1df54631e3917c03e0e22e566ccff9f5996e93e71200d89a58f43c75
6
+ metadata.gz: 8d47b792e8475366dd2e652c55c550ddc8cfb2508a16145affd20f0041ccfbde357af51e85b98a62e1ee2cde52419ccd01ca77fc937627f860c83b1100a5ebcb
7
+ data.tar.gz: e8061d000c8be150d0b9a0ce4bd6d86df275610a96deee7a1bec04492d77a669c04c6923bb9d10fcdd74bb7fbd17cbc7dfd8c24e0bb9cde306341476e5f9cfa8
@@ -189,6 +189,14 @@ class Zoom::Cache
189
189
  )
190
190
  ].join(" ")
191
191
  else
192
+ if (result.filename)
193
+ if (result.filename != curr_filename)
194
+ puts if (curr_filename)
195
+ puts config.hilight_filename(result.filename)
196
+ curr_filename = result.filename
197
+ end
198
+ end
199
+
192
200
  tag = result.tag
193
201
  line = result.contents
194
202
  puts [config.hilight_tag("[#{tag}]"), line].join(" ")
@@ -11,23 +11,32 @@ class Zoom::Cache::Result
11
11
 
12
12
  def initialize(tag, contents, cache)
13
13
  @cache = cache
14
- @contents = contents
14
+ @contents = contents.unpack("C*").pack("U*").gsub(
15
+ /([\u0080-\u00ff]+)/,
16
+ "\\1".dump[1..-2]
17
+ )
15
18
  @filename = nil
16
19
  @grep_like = false
17
20
  @lineno = nil
18
21
  @match = nil
19
22
  @tag = tag
20
23
 
21
- @contents.unpack("C*").pack("U*").gsub(
22
- /([\u0080-\u00ff]+)/,
23
- "\\1".dump[1..-2]
24
- ).match(/^([^:]+):(\d+)[:-](.*)/) do |m|
25
- next if (m.nil?)
24
+ case @contents
25
+ when /^Binary file (.+) matches\.$/
26
+ @contents.match(/^Binary file (.+) matches\.$/) do |m|
27
+ next if (m.nil?)
28
+ @filename = "Binary file"
29
+ @contents = m[1]
30
+ end
31
+ when /^([^:]+):(\d+)[:-](.*)$/
32
+ @contents.match(/^([^:]+):(\d+)[:-](.*)$/) do |m|
33
+ next if (m.nil?)
26
34
 
27
- @grep_like = true
28
- @filename = m[1]
29
- @lineno = m[2]
30
- @match = m[3]
35
+ @grep_like = true
36
+ @filename = m[1]
37
+ @lineno = m[2]
38
+ @match = m[3]
39
+ end
31
40
  end
32
41
  end
33
42
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-zoom
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.7
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-12 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest