systemd-journal 1.3.0 → 1.3.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
  SHA1:
3
- metadata.gz: c3e6b1c29dbf1ebfb965fb46cc8b4d6a74b99c0c
4
- data.tar.gz: 82a5ec063e3d282c9c87ae670ca09ed009d0a3de
3
+ metadata.gz: 2f31e11d5777f97a69cae351bd6f65c90fdd2cd6
4
+ data.tar.gz: 14cccb03b8856fea50433a58648267947113797d
5
5
  SHA512:
6
- metadata.gz: ce52fb6b99913e16cbf5d44f2f076e24d3fc36bfe95427f345faca78ba1895f14d9c46d26e4d74ee396c47250161220244be9d3f5e573b5fffdf9e1274d0ae08
7
- data.tar.gz: 4a231f9e05a15535a95d713f10aa3c822989358666679d15756e5e1d30abc2391c77c5d814406b8430dbad581691baf3e10291a539d33005397f5df30b8e6770
6
+ metadata.gz: 2c51128c4f6c947e6c0d84142ea73af1013bb66211b6ef0dbc3ab4b7c211897fc504afef3b8021f2294d85c5d75f2c539253e8f8cecc5e389bae19a18bfa7daf
7
+ data.tar.gz: 6fa32204f49f3e4df4c82ae06a1ee5a20afda7744f087ee289c48ae92b8dfd72989dbc25db870734715ba1889feaef3b2bcb29fe453a96834890b5444097aad2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  module Systemd
2
2
  class Journal
3
3
  # The version of the systemd-journal gem.
4
- VERSION = '1.3.0'
4
+ VERSION = '1.3.1'
5
5
  end
6
6
  end
@@ -74,7 +74,8 @@ module Systemd
74
74
  # @param [Hash] contents the set of key-value pairs defining the event.
75
75
  def message(contents)
76
76
  items = contents.flat_map do |k, v|
77
- [:string, "#{k.to_s.upcase}=#{v}"]
77
+ value = v.to_s.gsub('%', '%%')
78
+ [:string, "#{k.to_s.upcase}=#{value}"]
78
79
  end
79
80
  # add a null pointer to terminate the varargs
80
81
  items += [:string, nil]
@@ -410,4 +410,14 @@ RSpec.describe Systemd::Journal do
410
410
  expect([true, false]).to include(j.wait_select_reliable?)
411
411
  end
412
412
  end
413
+
414
+ describe 'message' do
415
+ it 'escapes percent signs in messages' do
416
+ expect(Systemd::Journal::Native).to receive(:sd_journal_send)
417
+ .with(:string, 'MESSAGE=hello %% world %%', :string, nil)
418
+ .and_return(0)
419
+
420
+ Systemd::Journal.message(message: 'hello % world %')
421
+ end
422
+ end
413
423
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: systemd-journal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Ledbetter
@@ -31,7 +31,7 @@ cert_chain:
31
31
  LnHNrDPklxqI1pnkXyKU9OrcCVuFnKY6te48kWZ8ZN/WhegL1fbNtLuvgoS2WuUJ
32
32
  5MDu0m5ogQUz8Ijw
33
33
  -----END CERTIFICATE-----
34
- date: 2017-08-08 00:00:00.000000000 Z
34
+ date: 2017-10-06 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: ffi
metadata.gz.sig CHANGED
Binary file