sms-logparser 0.10.3 → 0.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac70f98c406ad07e45f6da1db8370f9951f79c3a
4
- data.tar.gz: 8460bd5b56670c07c94923959d39cd1c1ca82f97
3
+ metadata.gz: c70ac1ba89761a0ba78861dfb7753b1934c955c9
4
+ data.tar.gz: 22df9bbc5c2a711c294c2b1efb14ad3658d68dff
5
5
  SHA512:
6
- metadata.gz: 5cac1b91c12c7ab723fc0b4df8ac6cca670aadb3d22e50b527b9eecf7c62bc4f3fe7d0e241d8765b59169176dfc0bec86386c6d4cdb1c476730e9f46661ce7aa
7
- data.tar.gz: 270c6f2c3779d2a8274f68de91271d0112f6ada9b0ef0cd9548d0c18d1fd3ccbd8ab2cf3b7d210ae8335ae4985609ebcce961903c9bca89c62468d7f1604b3e6
6
+ metadata.gz: 5a4c7bdc1a75906d395947853bd6926590db66a396776f948ca2b46e63124169f82715368a5b37e393cc532f177f4fe0c9d012ec36dac1168f070e96e6bcbb24
7
+ data.tar.gz: b782643cd7eac72eb221419ad792ffa241469a4b4cae89b572e9681b7f7558d3d66f3dc35abe6de173184cf7a3f669ed23ba94152dedb7b34f5fcc8692fe262a
@@ -28,9 +28,8 @@ module SmsLogparser
28
28
  end
29
29
 
30
30
  def self.match?(message)
31
- match = message.match(
32
- /\/content\/.+\/(\w+\.(f4v|flv|mp4|mp3|ts|m3u8)) .+ (200|206)/i
33
- )
31
+ match = message.match(/\/content\/.+\/(\S+) .+ (200|206)/i)
32
+ # ignore detect.mp4 and index.m3u8
34
33
  if match
35
34
  return true unless match[1] =~ /detect.mp4|index.m3u8/i
36
35
  end
@@ -1,3 +1,3 @@
1
1
  module SmsLogparser
2
- VERSION = "0.10.3"
2
+ VERSION = "0.11.0"
3
3
  end
data/spec/parser_spec.rb CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe SmsLogparser::Parser do
4
4
 
5
- %w(f4v flv mp4 mp3 ts m3u8).each do |extension|
5
+ %w(f4v flv mp4 mp3 ts m3u8 jpg js css m4a png sid).each do |extension|
6
6
  it "matches #{extension} files" do
7
7
  SmsLogparser::Parser.match?(
8
8
  "GET /content/2/719/54986/file.#{extension} HTTP/1.1\" 200 6741309 "
@@ -10,14 +10,6 @@ describe SmsLogparser::Parser do
10
10
  end
11
11
  end
12
12
 
13
- %w(jpg js css m4a docx).each do |extension|
14
- it "does not matche #{extension} files" do
15
- SmsLogparser::Parser.match?(
16
- "GET /content/2/719/54986/file.#{extension} HTTP/1.1\" 200 6741309 "
17
- ).must_equal false
18
- end
19
- end
20
-
21
13
  %w(200 206).each do |status|
22
14
  it "does match status code #{status}" do
23
15
  SmsLogparser::Parser.match?(
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms-logparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - niwo