systemd-journal 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/systemd/ffi_size_t.rb +19 -10
- data/lib/systemd/journal.rb +1 -1
- data/lib/systemd/journal/version.rb +1 -1
- data/lib/systemd/journal/waitable.rb +3 -1
- data/spec/systemd/journal_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72e715f4febf59e80e5b3ee18156f408e896001c
|
4
|
+
data.tar.gz: 9dc1f0c4921b88568469259e56db12c5db850e78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7528d93f609d6e9abcb39fd52cb1b9572760ac2d09cd8ada74ae1ec18722fd4829a6625996d10757f7d5180e951af8e3e6db5e42dbb21f1665adb32fa4972aeb
|
7
|
+
data.tar.gz: 1466d24d65ab955ecea3b833d054df7b97a20456d26f54d33b1e564d9496bcfc1c5dba8be9c8c624c2789db49dec5b36139aae831527c3b9f93ea73a595480f2
|
data/.travis.yml
CHANGED
data/lib/systemd/ffi_size_t.rb
CHANGED
@@ -2,14 +2,23 @@ require 'ffi'
|
|
2
2
|
|
3
3
|
# @private
|
4
4
|
class FFI::MemoryPointer
|
5
|
-
# monkey patch a read_size_t and write_size_t method onto FFI::MemoryPointer
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
# monkey patch a read_size_t and write_size_t method onto FFI::MemoryPointer.
|
6
|
+
# see https://github.com/ffi/ffi/issues/118
|
7
|
+
def self.monkey_patch_type_i_need!(which)
|
8
|
+
return if self.respond_to?("read_#{which}")
|
9
|
+
|
10
|
+
type = FFI.find_type(which)
|
11
|
+
type, _ = FFI::TypeDefs.find do |(name, t)|
|
12
|
+
method_defined?("read_#{name}") if t == type
|
13
|
+
end
|
14
|
+
|
15
|
+
raise RuntimeError, "Unable to patch in reader/writer for #{which}" if type.nil?
|
16
|
+
|
17
|
+
alias_method "read_#{which}", "read_#{type}"
|
18
|
+
alias_method "write_#{which}", "write_#{type}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
[:size_t, :uint64, :uint32].each do |type|
|
23
|
+
FFI::MemoryPointer.monkey_patch_type_i_need!(type)
|
15
24
|
end
|
data/lib/systemd/journal.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Systemd
|
2
2
|
class Journal
|
3
3
|
module Waitable
|
4
|
+
IS_JRUBY = (RUBY_ENGINE == 'jruby')
|
5
|
+
|
4
6
|
# Block until the journal is changed.
|
5
7
|
# @param timeout_usec [Integer] maximum number of microseconds to wait
|
6
8
|
# or `-1` to wait indefinitely.
|
@@ -14,7 +16,7 @@ module Systemd
|
|
14
16
|
# @return [Symbol] :append new entries were appened to the journal.
|
15
17
|
# @return [Symbol] :invalidate journal files were added/removed/rotated.
|
16
18
|
def wait(timeout_usec = -1, opts = {})
|
17
|
-
if opts[:select]
|
19
|
+
if opts[:select] && !IS_JRUBY
|
18
20
|
wait_select(timeout_usec)
|
19
21
|
else
|
20
22
|
rc = Native.sd_journal_wait(@ptr, timeout_usec)
|
@@ -359,9 +359,16 @@ RSpec.describe Systemd::Journal do
|
|
359
359
|
end
|
360
360
|
|
361
361
|
it 'can use select' do
|
362
|
+
pending "not available on JRUBY" if Systemd::Journal::IS_JRUBY
|
362
363
|
expect(Systemd::Journal::Native).to_not receive(:sd_journal_wait)
|
363
364
|
j.wait(1, select: true)
|
364
365
|
end
|
366
|
+
|
367
|
+
it 'ignores request to use select on JRuby' do
|
368
|
+
pending "not necessary on MRI" unless Systemd::Journal::IS_JRUBY
|
369
|
+
expect(Systemd::Journal::Native).to receive(:sd_journal_wait)
|
370
|
+
j.wait(1, select: true)
|
371
|
+
end
|
365
372
|
end
|
366
373
|
|
367
374
|
describe 'wait_select_reliable?' do
|
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.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Ledbetter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10
|
12
|
+
date: 2014-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|