codemonitor 0.6.0 → 0.6.1
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/engines/custom/extractor.rb +25 -1
- data/lib/codemonitor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8376539752d3392f7d8488ba82d5006143456cb0d42293b5c44a8aee5973185
|
4
|
+
data.tar.gz: 703466cb760fa112f0d07ccf1e8c0c891002532ee17d616730876594b7f118a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7560f2f13f6cd781e24f93640adadb8cba58cca68d66b83e354ac4fac8da7f93b03b7672b905769790fbf2843a36c434c3ec385fc4000a08f79d49fb03e1dbda
|
7
|
+
data.tar.gz: b316ad47b929584ee345f37210362c16b720b204ad016c9d561fd7c7b645a5c891e85c8b2e98019e60a4f3e53cc0d827ba498f1adb8ec8c641dcc0dcccb25437
|
data/engines/custom/extractor.rb
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
module Engines
|
4
4
|
module Custom
|
5
5
|
class Extractor
|
6
|
+
def initialize
|
7
|
+
@filenames = ENV.fetch('CODEMONITOR_CUSTOMS', nil)
|
8
|
+
end
|
9
|
+
|
6
10
|
def call(provider)
|
7
11
|
provider.emit(metrics)
|
8
12
|
end
|
@@ -14,7 +18,27 @@ module Engines
|
|
14
18
|
private
|
15
19
|
|
16
20
|
def custom_files
|
17
|
-
Dir.glob('./.codemonitor/*.rb')
|
21
|
+
return Dir.glob('./.codemonitor/*.rb') if @filenames.nil?
|
22
|
+
|
23
|
+
raise 'Forbidden access to parent folder' unless @filenames.match(/\.\./).nil?
|
24
|
+
|
25
|
+
includes = @filenames.split(',').reject do |filename|
|
26
|
+
filename.start_with?('-')
|
27
|
+
end.map do |filename|
|
28
|
+
"./.codemonitor/#{filename}.rb"
|
29
|
+
end
|
30
|
+
|
31
|
+
excludes = @filenames.split(',').filter do |filename|
|
32
|
+
filename.start_with?('-')
|
33
|
+
end.map do |filename|
|
34
|
+
"./.codemonitor/#{filename.gsub(/^-/, '')}.rb"
|
35
|
+
end
|
36
|
+
|
37
|
+
raise 'Mixed included and excluded custom paths is not allowed' if includes.size > 0 && excludes.size > 0
|
38
|
+
|
39
|
+
return Dir.glob(includes) if includes.size > 0
|
40
|
+
|
41
|
+
Dir.glob('./.codemonitor/*.rb') - Dir.glob(excludes)
|
18
42
|
end
|
19
43
|
|
20
44
|
def metrics
|
data/lib/codemonitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codemonitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ferran Basora
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dogapi
|
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
requirements: []
|
172
|
-
rubygems_version: 3.
|
172
|
+
rubygems_version: 3.3.5
|
173
173
|
signing_key:
|
174
174
|
specification_version: 4
|
175
175
|
summary: Collect many metrics your code is generating
|