croque 0.2.0 → 0.3.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: 3ab113d4a608bb3845958d8473d9f16bb907215b
4
- data.tar.gz: a13e14c6925aadf4ffaa87bde6debfcb2dbd8641
3
+ metadata.gz: 105dff789e0bec3468751ee49d38917de7250566
4
+ data.tar.gz: ad5c0db9cd6d132979a8b4c05f88a78ac6b39987
5
5
  SHA512:
6
- metadata.gz: 8b8ed926eed351b8a48f88896ec7f444535db5b1b486684ac3cf78825fa0b9c93ad3bc0352ab620a728542c61d57505068f48c73cb3b52744543389599696941
7
- data.tar.gz: d9aef0bee5b2e9603985098f9cfbd01e48b3a13648f9c024b0fe374c7591e14423eb56d22074a5d318e74e85429c485fe0f8e5c9abc4ea8e0acd301f39681dce
6
+ metadata.gz: 8f576eb07dfc939e867e7a20027bafb2c5f5a5f453865c2ad7d16ea2e1fc7c67ec1f934df0107d7683017a2bd7a675effda05b330e9f6d72ae013cf37e959513
7
+ data.tar.gz: ab87fec1e04d37ce03a0c583f28c9726af110f2706bfa72e2c4a57741dd0c632892c5df5e57c91b4b6093f8730f4e0c90458f11dd36631bdebec8f3bb43d5832
data/README.md CHANGED
@@ -32,6 +32,7 @@ Croque.configure do |config|
32
32
  config.start_matcher = /\-\- : Started/
33
33
  config.end_matcher = /\-\- : Completed/
34
34
  config.lower_time = 1000 # ms
35
+ config.except_path_matcher = /\/assets\//
35
36
  end
36
37
  ```
37
38
 
@@ -19,7 +19,7 @@ module Croque
19
19
  include ActiveSupport::Configurable
20
20
  config_accessor :root_path, :log_dir_path, :store_path,
21
21
  :log_file_matcher, :hour_matcher, :matcher, :severity_matcher,
22
- :start_matcher, :end_matcher, :lower_time
22
+ :start_matcher, :end_matcher, :lower_time, :except_path_matcher
23
23
  end
24
24
 
25
25
  configure do |config|
@@ -33,6 +33,7 @@ module Croque
33
33
  config.start_matcher = /\-\- : Started/
34
34
  config.end_matcher = /\-\- : Completed/
35
35
  config.lower_time = 1000 # ms
36
+ config.except_path_matcher = /\/assets\//
36
37
  end
37
38
 
38
39
  class << self
@@ -153,6 +153,10 @@ module Croque
153
153
  Croque.config.end_matcher
154
154
  end
155
155
 
156
+ def except_path_matcher
157
+ Croque.config.except_path_matcher
158
+ end
159
+
156
160
  def convert_matcher(matcher:, date: nil, hour: nil, severity: nil)
157
161
  # Regexp => String
158
162
  matcher = matcher.source
@@ -265,7 +269,7 @@ module Croque
265
269
  def get_start_indexes(lines)
266
270
  # map index only matched line
267
271
  lines.map.with_index do |line, index|
268
- index if line.match(start_matcher)
272
+ index if line.match(start_matcher) && !line.match(except_path_matcher)
269
273
  end.compact
270
274
  end
271
275
 
@@ -1,3 +1,3 @@
1
1
  module Croque
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: croque
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuya Okuhara