ruby-zoom 4.5.6 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/zoom.rb +1 -1
  3. data/lib/zoom/cache.rb +14 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13309634343d322e2a7a1f337ca36ccdd9364a71
4
- data.tar.gz: 7a92ddabed36807f0431c5b5038afd26c5448a3e
3
+ metadata.gz: 1fd4d6b5b0341f88d88fd5b431f057eb25810bea
4
+ data.tar.gz: e9f77f2c335bd1f2b32af8516bf479de9864d6ab
5
5
  SHA512:
6
- metadata.gz: 1ab81d532780f4d669ce66432d524244258f0a5700d2ed0c00a4e6ae4dae568683bfd8b92cb26c0b1fa8fa04813c3160850033ddc270fd9121c02ad319eaccbe
7
- data.tar.gz: c172029ce54ab7be4faae52d4c37672060be79203a11fd17c1dde06ba99ad6fe9fdc01261d3bc61dc28bb46c536d26dd44b108aab2a805b4c2ab2c25b15c870e
6
+ metadata.gz: 4a1aa7198c296b2a90e8152a82de931bb241db5ee89c4a3a61c92c667e429d3946d8c356739e7b8163b44a4571474027381f25380c8ed88d0b85884450aae4b6
7
+ data.tar.gz: 795b7d05d0ed37f01f322ea2f9908e1df565002a9259b3340168e2a1977f7314a0e9b5669ee94b4854f54aac62e374799ba640111cd85d1b5cb04427afd025ef
data/lib/zoom.rb CHANGED
@@ -65,7 +65,7 @@ class Zoom
65
65
  @cache.header(header)
66
66
 
67
67
  # Execute profile
68
- @cache.write(profile.exe(header))
68
+ @cache.write(profile.exe(header), header["pattern"])
69
69
 
70
70
  # Display results from cache
71
71
  @cache.shortcut(@config) if (shortcut)
data/lib/zoom/cache.rb CHANGED
@@ -196,7 +196,7 @@ class Zoom::Cache
196
196
  end
197
197
  end
198
198
 
199
- def write(str)
199
+ def write(str, pattern = nil)
200
200
  return if (str.nil?)
201
201
 
202
202
  if (!str.valid_encoding?)
@@ -208,7 +208,19 @@ class Zoom::Cache
208
208
  end
209
209
 
210
210
  File.open(@cache_file, "a") do |f|
211
- f.write(str.gsub(/\r/, "^M"))
211
+ str.gsub(/\r/, "^M").split("\n").each do |line|
212
+ if (pattern && line.match(/^[^:]+:[0-9]+:.+$/))
213
+ line.match(/^([^:]+:[0-9]+:)(.+)$/) do |m|
214
+ m[2].scan(
215
+ /(.{0,128}#{pattern}.{0,128})/i
216
+ ) do |n|
217
+ f.write("#{m[1]}#{n[0]}\n")
218
+ end
219
+ end
220
+ else
221
+ f.write("#{line}\n")
222
+ end
223
+ end
212
224
  end
213
225
  end
214
226
  end
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.5.6
4
+ version: 4.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Whittaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-17 00:00:00.000000000 Z
11
+ date: 2016-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest