prometheus_parser 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +16 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +18 -0
- data/Gemfile.lock +52 -0
- data/Rakefile +11 -0
- data/lib/prometheus_parser.rb +2 -2
- data/prometheus_parser.gemspec +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 918535ab98dcacc892e9c56c11296c9d7de44b918d4c7eea687b0a59a87b4796
|
4
|
+
data.tar.gz: 4079579c7abfc31b4586c452e48bbabe6ac4664e4f966668170989ea13a107b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 217e941af321f0a589bd024d207d071936660422976093c09936e60689636ca1a7add224aa67ba314edda6499ca4807a250812672e3be16c1343165ecf3a646f
|
7
|
+
data.tar.gz: 2f81966025c9c6604627bc45ea4500bbc56cf1e0c1d0ce7d84ed1794b6074e7d1549bffe154110c5e2f390194831a05250a25181d2fd44a5cc7d93c318bbbd75
|
@@ -0,0 +1,16 @@
|
|
1
|
+
on: [push,pull_request]
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
ruby: [ 3.2.2 ]
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: ${{ matrix.ruby }}
|
15
|
+
- run: bundle install
|
16
|
+
- run: bundle exec rake
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
coverage
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
ruby File.read(".ruby-version").strip
|
4
|
+
|
5
|
+
gem "dotenv"
|
6
|
+
|
7
|
+
group :development, :test do
|
8
|
+
gem "bundler"
|
9
|
+
gem "minitest"
|
10
|
+
gem "minitest-focus"
|
11
|
+
gem "minitest-hooks"
|
12
|
+
gem "minitest-line"
|
13
|
+
gem "minitest-reporters"
|
14
|
+
gem "rake"
|
15
|
+
gem "simplecov", require: false
|
16
|
+
gem "simplecov-csv"
|
17
|
+
gem "simplecov-lcov"
|
18
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
ansi (1.5.0)
|
5
|
+
builder (3.2.4)
|
6
|
+
docile (1.4.0)
|
7
|
+
dotenv (2.8.1)
|
8
|
+
minitest (5.18.0)
|
9
|
+
minitest-focus (1.3.1)
|
10
|
+
minitest (>= 4, < 6)
|
11
|
+
minitest-hooks (1.5.0)
|
12
|
+
minitest (> 5.3)
|
13
|
+
minitest-line (0.6.5)
|
14
|
+
minitest (~> 5.0)
|
15
|
+
minitest-reporters (1.6.0)
|
16
|
+
ansi
|
17
|
+
builder
|
18
|
+
minitest (>= 5.0)
|
19
|
+
ruby-progressbar
|
20
|
+
rake (13.0.6)
|
21
|
+
ruby-progressbar (1.13.0)
|
22
|
+
simplecov (0.22.0)
|
23
|
+
docile (~> 1.1)
|
24
|
+
simplecov-html (~> 0.11)
|
25
|
+
simplecov_json_formatter (~> 0.1)
|
26
|
+
simplecov-csv (0.1.3)
|
27
|
+
simplecov
|
28
|
+
simplecov-html (0.12.3)
|
29
|
+
simplecov-lcov (0.8.0)
|
30
|
+
simplecov_json_formatter (0.1.4)
|
31
|
+
|
32
|
+
PLATFORMS
|
33
|
+
arm64-darwin-22
|
34
|
+
|
35
|
+
DEPENDENCIES
|
36
|
+
bundler
|
37
|
+
dotenv
|
38
|
+
minitest
|
39
|
+
minitest-focus
|
40
|
+
minitest-hooks
|
41
|
+
minitest-line
|
42
|
+
minitest-reporters
|
43
|
+
rake
|
44
|
+
simplecov
|
45
|
+
simplecov-csv
|
46
|
+
simplecov-lcov
|
47
|
+
|
48
|
+
RUBY VERSION
|
49
|
+
ruby 3.2.2p53
|
50
|
+
|
51
|
+
BUNDLED WITH
|
52
|
+
2.4.11
|
data/Rakefile
ADDED
data/lib/prometheus_parser.rb
CHANGED
@@ -8,13 +8,13 @@ class PrometheusParser
|
|
8
8
|
KEY_RE = /[\w:]+/
|
9
9
|
VALUE_RE = /-?\d+\.?\d*E?-?\d*|NaN/
|
10
10
|
ATTR_KEY_RE = /[ \w-]+/
|
11
|
-
ATTR_VALUE_RE = %r{\s*"([\\"'\sa-zA-Z0-9\-_
|
11
|
+
ATTR_VALUE_RE = %r{\s*"([\\"'\sa-zA-Z0-9\-_/.+~@;=]*)"\s*} # /\s*"(\S*)"\s*/
|
12
12
|
|
13
13
|
def self.parse(raw)
|
14
14
|
s = StringScanner.new(raw)
|
15
15
|
res = []
|
16
16
|
until s.eos?
|
17
|
-
if s.peek(1) == "#" # Skip comment lines
|
17
|
+
if s.peek(1) == "#" || s.peek(1) == "\n" # Skip comment and empty lines
|
18
18
|
s.scan(/.*\n/)
|
19
19
|
next
|
20
20
|
end
|
data/prometheus_parser.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Landerblom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: mange@84codes.com
|
@@ -16,8 +16,14 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".github/workflows/ci.yml"
|
20
|
+
- ".gitignore"
|
21
|
+
- ".ruby-version"
|
22
|
+
- Gemfile
|
23
|
+
- Gemfile.lock
|
19
24
|
- LICENSE
|
20
25
|
- README.md
|
26
|
+
- Rakefile
|
21
27
|
- lib/prometheus_parser.rb
|
22
28
|
- prometheus_parser.gemspec
|
23
29
|
homepage: https://rubygems.org/gems/prometheus_parser
|
@@ -39,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: '0'
|
41
47
|
requirements: []
|
42
|
-
rubygems_version: 3.4.
|
48
|
+
rubygems_version: 3.4.10
|
43
49
|
signing_key:
|
44
50
|
specification_version: 4
|
45
51
|
summary: Parse prometheus metrics
|