riemann-tools 1.9.1 → 1.10.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
  SHA256:
3
- metadata.gz: c30626ff8ae893a3abef2344ada1099ce648fc14163ca8338fe38bd03c8cd0bd
4
- data.tar.gz: 61346e389d5994932ece0dbb9a9a774d8de41ac98b39ca6e18b8a792c9f18470
3
+ metadata.gz: ecfc9ade5a8ea50dcf495633c6427b14d41b78c04ef436c062491f96f97cbc16
4
+ data.tar.gz: 4ef67c8726d662c449e545601d3e7fe29d7104edaff39be294ca26e963f8e176
5
5
  SHA512:
6
- metadata.gz: e82d31bff29ccd83052593ce1ba5d24149a89bd3da70a17d9fba377a85063e51b398a729df56d1ad32381d878bd8de60d53d455c5914a3fafb775a4387317e8b
7
- data.tar.gz: f4382aba3f0c7d47437f7214a884434b747e334369605f87c51316b04ba7eeb8ee5bc5cecb33ad289b6909937c1319fa3f25602db6006a56a8665ba3ba7fe420
6
+ metadata.gz: 1d6b3a8872ffd2f8e73415f1108cb853d04ddf5fcf4fa0a9de81701f993d286f6b9337f3448d54d56d6da4f50f5d2582d29c1d4da18be418dcb5e5b1addd3eab
7
+ data.tar.gz: 8753726be6f187c0d88cbc8cf08eea6df9d4d5d5996e6d0ac44c5fc7bfe5d5dc648e9c191f9d0691f780d6b5e4a60ef75176f3ead1803e97e1a107e67234eb9c
@@ -42,7 +42,7 @@ jobs:
42
42
 
43
43
  # Initializes the CodeQL tools for scanning.
44
44
  - name: Initialize CodeQL
45
- uses: github/codeql-action/init@v2
45
+ uses: github/codeql-action/init@v3
46
46
  with:
47
47
  languages: ${{ matrix.language }}
48
48
  # If you wish to specify custom queries, you can do so here or in a config file.
@@ -56,7 +56,7 @@ jobs:
56
56
  # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
57
57
  # If this step fails, then you should remove it and run the build manually (see below)
58
58
  - name: Autobuild
59
- uses: github/codeql-action/autobuild@v2
59
+ uses: github/codeql-action/autobuild@v3
60
60
 
61
61
  # ℹ️ Command-line programs to run using the OS shell.
62
62
  # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -69,4 +69,4 @@ jobs:
69
69
  # ./location_of_script_within_repo/buildscript.sh
70
70
 
71
71
  - name: Perform CodeQL Analysis
72
- uses: github/codeql-action/analyze@v2
72
+ uses: github/codeql-action/analyze@v3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.10.0](https://github.com/riemann/riemann-tools/tree/v1.10.0) (2024-01-13)
4
+
5
+ [Full Changelog](https://github.com/riemann/riemann-tools/compare/v1.9.1...v1.10.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Add support for options with spaces to `riemann-wrapper` [\#280](https://github.com/riemann/riemann-tools/pull/280) ([smortex](https://github.com/smortex))
10
+
3
11
  ## [v1.9.1](https://github.com/riemann/riemann-tools/tree/v1.9.1) (2023-12-08)
4
12
 
5
13
  [Full Changelog](https://github.com/riemann/riemann-tools/compare/v1.9.0...v1.9.1)
@@ -21,10 +29,6 @@
21
29
 
22
30
  - Fix `riemann-haproxy` with Ruby 3.0+ [\#273](https://github.com/riemann/riemann-tools/pull/273) ([smortex](https://github.com/smortex))
23
31
 
24
- **Merged pull requests:**
25
-
26
- - Bump actions/checkout from 3 to 4 [\#271](https://github.com/riemann/riemann-tools/pull/271) ([dependabot[bot]](https://github.com/apps/dependabot))
27
-
28
32
  ## [v1.8.2](https://github.com/riemann/riemann-tools/tree/v1.8.2) (2023-05-22)
29
33
 
30
34
  [Full Changelog](https://github.com/riemann/riemann-tools/compare/v1.8.1...v1.8.2)
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require 'github_changelog_generator/task'
7
7
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
8
8
  config.user = 'riemann'
9
9
  config.project = 'riemann-tools'
10
- config.exclude_labels = ['skip-changelog']
10
+ config.exclude_labels = %w[dependencies skip-changelog]
11
11
  config.future_release = "v#{Riemann::Tools::VERSION}"
12
12
  end
13
13
 
data/bin/riemann-wrapper CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'strscan'
5
+
4
6
  Process.setproctitle($PROGRAM_NAME)
5
7
 
6
8
  def camelize(subject)
@@ -15,6 +17,42 @@ def constantize(subject)
15
17
  Object.const_get(subject)
16
18
  end
17
19
 
20
+ # Split on blanks unless quoted or escaped:
21
+ # "--foo --bar=bar --baz='baz baz'\ baz" #=> ["--foo", "--bar=bar", "--baz=baz baz baz"]
22
+ def split_options(options)
23
+ res = []
24
+
25
+ return res unless options
26
+
27
+ current = ''
28
+ s = StringScanner.new(options)
29
+ until s.eos?
30
+ if s.scan(/\s+/)
31
+ res << current
32
+ current = ''
33
+ elsif s.scan(/\\./)
34
+ current += s.matched[1]
35
+ elsif s.scan(/['"]/)
36
+ match = s.matched
37
+ loop do
38
+ if s.scan(match)
39
+ break
40
+ elsif s.scan(/\\./)
41
+ current += s.matched[1]
42
+ else
43
+ current += s.getch
44
+ end
45
+ end
46
+ else
47
+ current += s.getch
48
+ end
49
+ end
50
+
51
+ res << current unless current.empty?
52
+
53
+ res
54
+ end
55
+
18
56
  def read_flags(argv)
19
57
  res = []
20
58
 
@@ -80,10 +118,14 @@ if ARGV.size == 1
80
118
  require 'yaml'
81
119
  config = YAML.safe_load(File.read(ARGV[0]))
82
120
 
83
- commandline = config['options']
84
- config['tools'].each { |tool| commandline << " -- #{tool['name']} #{tool['options']}" }
121
+ arguments = split_options(config['options'])
122
+ config['tools'].each do |tool|
123
+ arguments << '--'
124
+ arguments << tool['name']
125
+ arguments += split_options(tool['options'])
126
+ end
85
127
 
86
- ARGV.replace(commandline.split)
128
+ ARGV.replace(arguments)
87
129
  end
88
130
 
89
131
  argv = ARGV.dup
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Riemann
4
4
  module Tools # :nodoc:
5
- VERSION = '1.9.1'
5
+ VERSION = '1.10.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.1
4
+ version: 1.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Kingsbury
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-08 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json