prometheus_parser 0.2.0 → 0.2.2

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: eae0090340e5e75bc4059d47898962094be94992045a40d052d64b7f2a597529
4
+ data.tar.gz: 8d784b2bfeeafc754ce3e4ca6e94c6226244bd95d78d18c22c38be6477d59f4e
5
5
  SHA512:
6
- metadata.gz: 47689e67c44bca69fa26c8b5373d331e567fed1ad21d2094c80754eba0ef2dbd2febbea024b3edd0fbadf00c353eab0984a94ddeabe1f240ff65a9c1dacbca15
7
- data.tar.gz: e43782220d2c0886088e7ed08f4b4574af380529a7f1fbf2e0cee4daca0641010e26a3178d2e1f4e12f860d4ae9ccdc0e1a86e26e6cbd0f2949732c4778da33c
6
+ metadata.gz: 800a596c7ac13a61456dd3fa1dac58ffbbdf93c0803ce219adf7bad3da3e70f93123372eb7d9752d96b439c7a89e6069a729e4ff2d9f7df3db03f3d966d74f65
7
+ data.tar.gz: c504a7427741e0615178a0699e732e4094301260ae24987e17ccdcb8bd7a3b0d0f00a17cbfdd8c8fd82e16cc0ce6dcbd116af62b79a5a7f684871a52ac2f5a88
@@ -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 ]
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ bundler-cache: true
15
+ ruby-version: ${{ matrix.ruby }}
16
+ - run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ coverage
2
+ Gemfile.lock
3
+ .ruby-version
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :development, :test do
4
+ gem "bundler"
5
+ gem "minitest"
6
+ gem "minitest-focus"
7
+ gem "minitest-hooks"
8
+ gem "minitest-line"
9
+ gem "minitest-reporters"
10
+ gem "rake"
11
+ gem "simplecov", require: false
12
+ gem "simplecov-csv"
13
+ gem "simplecov-lcov"
14
+ end
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/setup"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "spec"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["spec/**/*_spec.rb"]
8
+ end
9
+
10
+ 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 = /\s*"([^"\\]*(\\.[^"\\]*)*)"\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,13 +1,13 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "prometheus_parser"
3
- s.version = "0.2.0"
3
+ s.version = "0.2.2"
4
4
  s.summary = "Parse prometheus metrics"
5
5
  s.authors = ["Magnus Landerblom"]
6
6
  s.email = "mange@84codes.com"
7
7
  s.files = Dir.chdir(File.expand_path(__dir__)) do
8
8
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
9
9
  end
10
- s.homepage =
10
+ s.homepage =
11
11
  "https://rubygems.org/gems/prometheus_parser"
12
- s.license = "MIT"
12
+ s.license = "MIT"
13
13
  end
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.2
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-05-11 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: mange@84codes.com
@@ -16,8 +16,12 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - ".github/workflows/ci.yml"
20
+ - ".gitignore"
21
+ - Gemfile
19
22
  - LICENSE
20
23
  - README.md
24
+ - Rakefile
21
25
  - lib/prometheus_parser.rb
22
26
  - prometheus_parser.gemspec
23
27
  homepage: https://rubygems.org/gems/prometheus_parser
@@ -39,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
43
  - !ruby/object:Gem::Version
40
44
  version: '0'
41
45
  requirements: []
42
- rubygems_version: 3.4.12
46
+ rubygems_version: 3.4.10
43
47
  signing_key:
44
48
  specification_version: 4
45
49
  summary: Parse prometheus metrics