ruby-zoom 4.6.7 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zoom/cache.rb +8 -0
- data/lib/zoom/cache/result.rb +19 -10
- 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: efbedbe98f1dae228a6ea4aa0cbf388515bf9a98
|
4
|
+
data.tar.gz: a79e0cf5f183e9f69202b0c4f246d3e6d7478e15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d47b792e8475366dd2e652c55c550ddc8cfb2508a16145affd20f0041ccfbde357af51e85b98a62e1ee2cde52419ccd01ca77fc937627f860c83b1100a5ebcb
|
7
|
+
data.tar.gz: e8061d000c8be150d0b9a0ce4bd6d86df275610a96deee7a1bec04492d77a669c04c6923bb9d10fcdd74bb7fbd17cbc7dfd8c24e0bb9cde306341476e5f9cfa8
|
data/lib/zoom/cache.rb
CHANGED
@@ -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(" ")
|
data/lib/zoom/cache/result.rb
CHANGED
@@ -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
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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.
|
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-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|