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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0b6145adbbe13d187316a71bf2423781ec564123cba468ddbac99f365fe87d5
4
- data.tar.gz: 1414a241450009f9d05898d06a30a50fb53a1114256f613fcfd11d6374586ea7
3
+ metadata.gz: 918535ab98dcacc892e9c56c11296c9d7de44b918d4c7eea687b0a59a87b4796
4
+ data.tar.gz: 4079579c7abfc31b4586c452e48bbabe6ac4664e4f966668170989ea13a107b3
5
5
  SHA512:
6
- metadata.gz: 47689e67c44bca69fa26c8b5373d331e567fed1ad21d2094c80754eba0ef2dbd2febbea024b3edd0fbadf00c353eab0984a94ddeabe1f240ff65a9c1dacbca15
7
- data.tar.gz: e43782220d2c0886088e7ed08f4b4574af380529a7f1fbf2e0cee4daca0641010e26a3178d2e1f4e12f860d4ae9ccdc0e1a86e26e6cbd0f2949732c4778da33c
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
@@ -0,0 +1,11 @@
1
+ require "bundler/setup"
2
+ require "rake/testtask"
3
+ require "dotenv/load"
4
+
5
+ Rake::TestTask.new(:test) do |t|
6
+ t.libs << "spec"
7
+ t.libs << "lib"
8
+ t.test_files = FileList["spec/**/*_spec.rb"]
9
+ end
10
+
11
+ task default: :test
@@ -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\-_/.+~]*)"\s*} # /\s*"(\S*)"\s*/
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "prometheus_parser"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
  s.summary = "Parse prometheus metrics"
5
5
  s.authors = ["Magnus Landerblom"]
6
6
  s.email = "mange@84codes.com"
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.0
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-21 00:00:00.000000000 Z
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.12
48
+ rubygems_version: 3.4.10
43
49
  signing_key:
44
50
  specification_version: 4
45
51
  summary: Parse prometheus metrics