apple-system-logger 0.1.2 → 0.1.3
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +6 -0
- data/Gemfile +2 -7
- data/README.md +7 -2
- data/Rakefile +14 -5
- data/apple-system-logger.gemspec +10 -7
- data/lib/apple/system/logger/constants.rb +11 -9
- data/lib/apple/system/logger/functions.rb +15 -13
- data/lib/apple/system/logger.rb +23 -24
- data/lib/apple-system-logger.rb +2 -0
- data/spec/apple-system-logger_spec.rb +41 -35
- data.tar.gz.sig +0 -0
- metadata +33 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 47eaba8480a9a1a1645cb05b1097fae01083b9d9f10052ee2818472739b8eaff
|
|
4
|
+
data.tar.gz: 8d726f6fbeb7764af96d897cc925b7c609dce96b327e26140e514e8df381bcae
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9a98f320a286f69bf5eab1813c70e5f6c635be8117b3bc5a8f8fc37c78fc1111ed54d86795e0b44ed57ffca2ee72b6d5c76a5d5cebabd5885081714fa2619510
|
|
7
|
+
data.tar.gz: 0b53d9d699d57e1c36482eb2134b4b6c2aff8078a39e67c2a0d9682754b898f228251b583e112929a1d41daa70d464ad272afe80fb5fa106d5fee5f81c00b473
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## 0.1.3 - 28-Dec-2025
|
|
2
|
+
* Fixed the missing message parameter for the error and fatal methods.
|
|
3
|
+
* Added stricter enforcement for search keys.
|
|
4
|
+
* The constructor was modified internally for proper initialization.
|
|
5
|
+
* Some rubocop cleanup, spec updates, and workflow action tweaks.
|
|
6
|
+
|
|
1
7
|
## 0.1.2 - 28-Oct-2020
|
|
2
8
|
* Added the :stderr option.
|
|
3
9
|
* Added a Gemfile.
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
[](https://github.com/djberg96/apple-system-logger/actions/workflows/ruby.yml)
|
|
2
|
+
|
|
1
3
|
## apple-system-logger
|
|
2
4
|
A Ruby interface for the Apple system logger.
|
|
3
5
|
|
|
4
6
|
## Installation
|
|
5
7
|
gem install apple-system-logger
|
|
6
8
|
|
|
9
|
+
## Adding the trusted cert
|
|
10
|
+
`gem cert --add <(curl -Ls https://raw.githubusercontent.com/djberg96/apple-system-logger/main/certs/djberg96_pub.pem)`
|
|
11
|
+
|
|
7
12
|
## Synopsis
|
|
8
|
-
```
|
|
13
|
+
```ruby
|
|
9
14
|
require 'apple-system-logger'
|
|
10
15
|
|
|
11
16
|
# With defaults
|
|
@@ -40,7 +45,7 @@ because the API does not explicitly forbid other file descriptors, nor
|
|
|
40
45
|
does it raise an error.
|
|
41
46
|
|
|
42
47
|
## Copyright
|
|
43
|
-
(C) 2020 Daniel J. Berger, All Rights Reserved
|
|
48
|
+
(C) 2020-2025 Daniel J. Berger, All Rights Reserved
|
|
44
49
|
|
|
45
50
|
## Warranty
|
|
46
51
|
This package is provided "as is" and without any express or
|
data/Rakefile
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
require 'rake'
|
|
2
2
|
require 'rake/clean'
|
|
3
|
-
require 'rbconfig'
|
|
4
3
|
require 'rspec/core/rake_task'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
4
|
+
require 'rubocop/rake_task'
|
|
8
5
|
|
|
9
6
|
CLEAN.include('**/*.gem', '**/*.rbc', '**/*.rbx', '**/*.lock')
|
|
10
7
|
|
|
@@ -12,7 +9,7 @@ namespace 'gem' do
|
|
|
12
9
|
desc "Create the apple-system-logger gem"
|
|
13
10
|
task :create => [:clean] do
|
|
14
11
|
require 'rubygems/package'
|
|
15
|
-
spec =
|
|
12
|
+
spec = Gem::Specification.load('apple-system-logger.gemspec')
|
|
16
13
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
|
17
14
|
Gem::Package.build(spec)
|
|
18
15
|
end
|
|
@@ -24,4 +21,16 @@ namespace 'gem' do
|
|
|
24
21
|
end
|
|
25
22
|
end
|
|
26
23
|
|
|
24
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
|
25
|
+
t.verbose = true
|
|
26
|
+
t.rspec_opts = '-f documentation -w'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
RuboCop::RakeTask.new
|
|
30
|
+
|
|
31
|
+
# Clean up afterwards
|
|
32
|
+
Rake::Task[:spec].enhance do
|
|
33
|
+
Rake::Task[:clean].invoke
|
|
34
|
+
end
|
|
35
|
+
|
|
27
36
|
task :default => :spec
|
data/apple-system-logger.gemspec
CHANGED
|
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = 'apple-system-logger'
|
|
5
|
-
spec.version = '0.1.
|
|
5
|
+
spec.version = '0.1.3'
|
|
6
6
|
spec.author = 'Daniel J. Berger'
|
|
7
7
|
spec.email = 'djberg96@gmail.com'
|
|
8
8
|
spec.license = 'Apache-2.0'
|
|
@@ -15,14 +15,17 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.add_dependency('ffi', '~> 1.1')
|
|
16
16
|
spec.add_development_dependency('rake')
|
|
17
17
|
spec.add_development_dependency('rspec', '~> 3.9')
|
|
18
|
+
spec.add_development_dependency('rubocop')
|
|
19
|
+
spec.add_development_dependency('rubocop-rspec')
|
|
18
20
|
|
|
19
21
|
spec.metadata = {
|
|
20
|
-
'homepage_uri'
|
|
21
|
-
'bug_tracker_uri'
|
|
22
|
-
'changelog_uri'
|
|
23
|
-
'documentation_uri'
|
|
24
|
-
'source_code_uri'
|
|
25
|
-
'wiki_uri'
|
|
22
|
+
'homepage_uri' => 'https://github.com/djberg96/apple-system-logger',
|
|
23
|
+
'bug_tracker_uri' => 'https://github.com/djberg96/apple-system-logger/issues',
|
|
24
|
+
'changelog_uri' => 'https://github.com/djberg96/apple-system-logger/blob/main/CHANGES.md',
|
|
25
|
+
'documentation_uri' => 'https://github.com/djberg96/apple-system-logger/wiki',
|
|
26
|
+
'source_code_uri' => 'https://github.com/djberg96/apple-system-logger',
|
|
27
|
+
'wiki_uri' => 'https://github.com/djberg96/apple-system-logger/wiki',
|
|
28
|
+
'rubygems_mfa_required' => 'true'
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
spec.description = <<-EOF
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module Apple
|
|
2
4
|
module System
|
|
3
5
|
module LoggerConstants
|
|
4
|
-
ASL_KEY_TIME =
|
|
5
|
-
ASL_KEY_HOST =
|
|
6
|
-
ASL_KEY_SENDER =
|
|
7
|
-
ASL_KEY_FACILITY =
|
|
8
|
-
ASL_KEY_PID =
|
|
9
|
-
ASL_KEY_UID =
|
|
10
|
-
ASL_KEY_GID =
|
|
11
|
-
ASL_KEY_LEVEL =
|
|
12
|
-
ASL_KEY_MSG =
|
|
6
|
+
ASL_KEY_TIME = 'Time'
|
|
7
|
+
ASL_KEY_HOST = 'Host'
|
|
8
|
+
ASL_KEY_SENDER = 'Sender'
|
|
9
|
+
ASL_KEY_FACILITY = 'Facility'
|
|
10
|
+
ASL_KEY_PID = 'PID'
|
|
11
|
+
ASL_KEY_UID = 'UID'
|
|
12
|
+
ASL_KEY_GID = 'GID'
|
|
13
|
+
ASL_KEY_LEVEL = 'Level'
|
|
14
|
+
ASL_KEY_MSG = 'Message'
|
|
13
15
|
|
|
14
16
|
ASL_LEVEL_EMERG = 0
|
|
15
17
|
ASL_LEVEL_ALERT = 1
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'ffi'
|
|
2
4
|
|
|
3
5
|
module Apple
|
|
@@ -6,22 +8,22 @@ module Apple
|
|
|
6
8
|
extend FFI::Library
|
|
7
9
|
ffi_lib FFI::Library::LIBC
|
|
8
10
|
|
|
9
|
-
attach_function(:asl_add_log_file, [
|
|
11
|
+
attach_function(:asl_add_log_file, %i[pointer int], :int)
|
|
10
12
|
attach_function(:asl_close, [:pointer], :void)
|
|
11
13
|
attach_function(:asl_free, [:pointer], :void)
|
|
12
|
-
attach_function(:asl_get, [
|
|
13
|
-
attach_function(:asl_key, [
|
|
14
|
-
attach_function(:asl_log, [
|
|
14
|
+
attach_function(:asl_get, %i[pointer string], :string)
|
|
15
|
+
attach_function(:asl_key, %i[pointer uint32], :string)
|
|
16
|
+
attach_function(:asl_log, %i[pointer pointer int string varargs], :int)
|
|
15
17
|
attach_function(:asl_new, [:uint32], :pointer)
|
|
16
|
-
attach_function(:asl_open, [
|
|
17
|
-
attach_function(:asl_remove_log_file, [
|
|
18
|
-
attach_function(:asl_search, [
|
|
19
|
-
attach_function(:asl_send, [
|
|
20
|
-
attach_function(:asl_set, [
|
|
21
|
-
attach_function(:asl_set_filter, [
|
|
22
|
-
attach_function(:asl_set_query, [
|
|
23
|
-
attach_function(:asl_unset, [
|
|
24
|
-
attach_function(:asl_vlog, [
|
|
18
|
+
attach_function(:asl_open, %i[string string uint32], :pointer)
|
|
19
|
+
attach_function(:asl_remove_log_file, %i[pointer int], :int)
|
|
20
|
+
attach_function(:asl_search, %i[pointer pointer], :pointer)
|
|
21
|
+
attach_function(:asl_send, %i[pointer pointer], :int)
|
|
22
|
+
attach_function(:asl_set, %i[pointer string string], :int)
|
|
23
|
+
attach_function(:asl_set_filter, %i[pointer int], :int)
|
|
24
|
+
attach_function(:asl_set_query, %i[pointer string string uint32], :int)
|
|
25
|
+
attach_function(:asl_unset, %i[pointer string], :int)
|
|
26
|
+
attach_function(:asl_vlog, %i[pointer pointer int string pointer], :int)
|
|
25
27
|
attach_function(:aslresponse_free, [:pointer], :void)
|
|
26
28
|
attach_function(:aslresponse_next, [:pointer], :pointer)
|
|
27
29
|
end
|
data/lib/apple/system/logger.rb
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require_relative 'logger/functions'
|
|
2
4
|
require_relative 'logger/constants'
|
|
3
5
|
|
|
6
|
+
# The Apple module serves as a namespace only.
|
|
4
7
|
module Apple
|
|
8
|
+
# The System module serves only as a namespace.
|
|
5
9
|
module System
|
|
10
|
+
# The Logger class encapsulates the logging functions of the OSX logging API.
|
|
6
11
|
class Logger
|
|
7
12
|
include Apple::System::LoggerFunctions
|
|
8
13
|
include Apple::System::LoggerConstants
|
|
9
14
|
|
|
10
15
|
# The version of this library.
|
|
11
|
-
VERSION = '0.1.
|
|
16
|
+
VERSION = '0.1.3'
|
|
12
17
|
|
|
13
18
|
# A syslogd facility. The system default is 'user'.
|
|
14
19
|
attr_reader :facility
|
|
@@ -69,18 +74,12 @@ module Apple
|
|
|
69
74
|
@logdev = kwargs[:logdev]
|
|
70
75
|
@stderr = kwargs[:stderr]
|
|
71
76
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
options |= ASL_OPT_STDERR if @stderr
|
|
77
|
+
options = ASL_OPT_NO_DELAY | ASL_OPT_NO_REMOTE
|
|
78
|
+
options |= ASL_OPT_STDERR if @stderr
|
|
75
79
|
|
|
76
|
-
|
|
80
|
+
@aslclient = asl_open(@progname, @facility, options)
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
asl_add_log_file(@aslclient, @logdev.fileno)
|
|
80
|
-
end
|
|
81
|
-
else
|
|
82
|
-
@aslclient = nil
|
|
83
|
-
end
|
|
82
|
+
asl_add_log_file(@aslclient, @logdev.fileno) if @logdev
|
|
84
83
|
|
|
85
84
|
@aslmsg = asl_new(ASL_TYPE_MSG)
|
|
86
85
|
asl_set(@aslmsg, ASL_KEY_FACILITY, @facility) if @facility
|
|
@@ -145,11 +144,11 @@ module Apple
|
|
|
145
144
|
|
|
146
145
|
# Log an error message.
|
|
147
146
|
#
|
|
148
|
-
def error
|
|
147
|
+
def error(message)
|
|
149
148
|
asl_log(@aslclient, @aslmsg, ASL_LEVEL_ERR, message)
|
|
150
149
|
end
|
|
151
150
|
|
|
152
|
-
# Returns true if the current severity level allows for the printing of
|
|
151
|
+
# Returns true if the current severity level allows for the printing of error messages.
|
|
153
152
|
#
|
|
154
153
|
def error?
|
|
155
154
|
level >= ASL_LEVEL_ERR
|
|
@@ -157,7 +156,7 @@ module Apple
|
|
|
157
156
|
|
|
158
157
|
# Log a fatal message. For this library that means an ASL_LEVEL_CRIT message.
|
|
159
158
|
#
|
|
160
|
-
def fatal
|
|
159
|
+
def fatal(message)
|
|
161
160
|
asl_log(@aslclient, @aslmsg, ASL_LEVEL_CRIT, message)
|
|
162
161
|
end
|
|
163
162
|
|
|
@@ -224,12 +223,12 @@ module Apple
|
|
|
224
223
|
# log.search(:uid => 501, :time => Time.now - 3600)
|
|
225
224
|
#
|
|
226
225
|
def search(query)
|
|
227
|
-
value = nil
|
|
228
226
|
aslmsg = asl_new(ASL_TYPE_QUERY)
|
|
229
227
|
result = []
|
|
230
228
|
|
|
231
229
|
query.each do |key, value|
|
|
232
230
|
asl_key = map_key_to_asl_key(key)
|
|
231
|
+
|
|
233
232
|
flags = ASL_QUERY_OP_EQUAL
|
|
234
233
|
flags = (flags | ASL_QUERY_OP_NUMERIC) if value.is_a?(Numeric)
|
|
235
234
|
flags = (flags | ASL_QUERY_OP_TRUE) if value == true
|
|
@@ -281,16 +280,16 @@ module Apple
|
|
|
281
280
|
|
|
282
281
|
def map_key_to_asl_key(key)
|
|
283
282
|
{
|
|
284
|
-
:time
|
|
285
|
-
:host
|
|
286
|
-
:sender
|
|
283
|
+
:time => ASL_KEY_TIME,
|
|
284
|
+
:host => ASL_KEY_HOST,
|
|
285
|
+
:sender => ASL_KEY_SENDER,
|
|
287
286
|
:facility => ASL_KEY_FACILITY,
|
|
288
|
-
:pid
|
|
289
|
-
:uid
|
|
290
|
-
:gid
|
|
291
|
-
:level
|
|
292
|
-
:message
|
|
293
|
-
}
|
|
287
|
+
:pid => ASL_KEY_PID,
|
|
288
|
+
:uid => ASL_KEY_UID,
|
|
289
|
+
:gid => ASL_KEY_GID,
|
|
290
|
+
:level => ASL_KEY_LEVEL,
|
|
291
|
+
:message => ASL_KEY_MSG
|
|
292
|
+
}.fetch(key)
|
|
294
293
|
end
|
|
295
294
|
end
|
|
296
295
|
end
|
data/lib/apple-system-logger.rb
CHANGED
|
@@ -1,125 +1,131 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'apple-system-logger'
|
|
2
4
|
|
|
3
5
|
RSpec.describe Apple::System::Logger do
|
|
4
6
|
let(:log){ described_class.new }
|
|
5
7
|
|
|
6
|
-
context
|
|
7
|
-
example
|
|
8
|
-
expect(described_class::VERSION).to eql('0.1.
|
|
8
|
+
context 'version' do
|
|
9
|
+
example 'version constant is set to expected value' do
|
|
10
|
+
expect(described_class::VERSION).to eql('0.1.3')
|
|
9
11
|
end
|
|
10
12
|
|
|
11
|
-
example
|
|
13
|
+
example 'version constant is frozen' do
|
|
12
14
|
expect(described_class::VERSION).to be_frozen
|
|
13
15
|
end
|
|
14
16
|
end
|
|
15
17
|
|
|
16
|
-
context
|
|
17
|
-
example
|
|
18
|
+
context 'instance methods' do
|
|
19
|
+
example 'defines a facility method' do
|
|
18
20
|
expect(log).to respond_to(:facility)
|
|
19
21
|
end
|
|
20
22
|
|
|
21
|
-
example
|
|
23
|
+
example 'the default facility is nil' do
|
|
22
24
|
expect(log.facility).to be_nil
|
|
23
25
|
end
|
|
24
26
|
|
|
25
|
-
example
|
|
27
|
+
example 'defines a level method' do
|
|
26
28
|
expect(log).to respond_to(:level)
|
|
27
29
|
end
|
|
28
30
|
|
|
29
|
-
example
|
|
31
|
+
example 'the default level is debug' do
|
|
30
32
|
expect(log.level).to eql(Apple::System::Logger::ASL_LEVEL_DEBUG)
|
|
31
33
|
end
|
|
32
34
|
|
|
33
|
-
example
|
|
35
|
+
example 'defines a progname method' do
|
|
34
36
|
expect(log).to respond_to(:progname)
|
|
35
37
|
end
|
|
36
38
|
|
|
37
|
-
example
|
|
39
|
+
example 'the default progname is nil' do
|
|
38
40
|
expect(log.progname).to be_nil
|
|
39
41
|
end
|
|
40
42
|
|
|
41
|
-
example
|
|
43
|
+
example 'defines a logdev method' do
|
|
42
44
|
expect(log).to respond_to(:logdev)
|
|
43
45
|
end
|
|
44
46
|
|
|
45
|
-
example
|
|
47
|
+
example 'the default logdev is nil' do
|
|
46
48
|
expect(log.logdev).to be_nil
|
|
47
49
|
end
|
|
48
50
|
end
|
|
49
51
|
|
|
50
|
-
context
|
|
51
|
-
example
|
|
52
|
+
context 'logging methods' do
|
|
53
|
+
example 'there is a << method' do
|
|
52
54
|
expect(log).to respond_to(:<<)
|
|
53
55
|
end
|
|
54
56
|
|
|
55
|
-
example
|
|
57
|
+
example 'there is an add method' do
|
|
56
58
|
expect(log).to respond_to(:add)
|
|
57
59
|
end
|
|
58
60
|
|
|
59
|
-
example
|
|
61
|
+
example 'there is a debug method' do
|
|
60
62
|
expect(log).to respond_to(:debug)
|
|
61
63
|
end
|
|
62
64
|
|
|
63
|
-
example
|
|
65
|
+
example 'there is a debug? method that returns the expected value' do
|
|
64
66
|
expect(log.debug?).to be true
|
|
65
67
|
end
|
|
66
68
|
|
|
67
|
-
example
|
|
69
|
+
example 'there is an info method' do
|
|
68
70
|
expect(log).to respond_to(:info)
|
|
69
71
|
end
|
|
70
72
|
|
|
71
|
-
example
|
|
73
|
+
example 'there is a info? method that returns the expected value' do
|
|
72
74
|
expect(log.info?).to be true
|
|
73
75
|
end
|
|
74
76
|
|
|
75
|
-
example
|
|
77
|
+
example 'there is a warn method' do
|
|
76
78
|
expect(log).to respond_to(:warn)
|
|
77
79
|
end
|
|
78
80
|
|
|
79
|
-
example
|
|
81
|
+
example 'there is a warn? method that returns the expected value' do
|
|
80
82
|
expect(log.warn?).to be true
|
|
81
83
|
end
|
|
82
84
|
|
|
83
|
-
example
|
|
85
|
+
example 'there is an error method' do
|
|
84
86
|
expect(log).to respond_to(:error)
|
|
85
87
|
end
|
|
86
88
|
|
|
87
|
-
example
|
|
89
|
+
example 'there is a error? method that returns the expected value' do
|
|
88
90
|
expect(log.error?).to be true
|
|
89
91
|
end
|
|
90
92
|
|
|
91
|
-
example
|
|
92
|
-
expect(log).to respond_to(:
|
|
93
|
+
example 'there is a fatal method' do
|
|
94
|
+
expect(log).to respond_to(:fatal)
|
|
93
95
|
end
|
|
94
96
|
|
|
95
|
-
example
|
|
97
|
+
example 'there is a fatal? method that returns the expected value' do
|
|
96
98
|
expect(log.fatal?).to be true
|
|
97
99
|
end
|
|
98
100
|
|
|
99
|
-
example
|
|
101
|
+
example 'there is an unknown method' do
|
|
100
102
|
expect(log).to respond_to(:unknown)
|
|
101
103
|
end
|
|
102
104
|
|
|
103
|
-
example
|
|
105
|
+
example 'there is a close method' do
|
|
104
106
|
expect(log).to respond_to(:close)
|
|
105
107
|
end
|
|
106
108
|
|
|
107
|
-
example
|
|
109
|
+
example 'calling close on the logger instance works as expected' do
|
|
108
110
|
expect(log.close).to be_nil
|
|
109
111
|
expect(log.close).to be_nil
|
|
110
112
|
end
|
|
111
113
|
end
|
|
112
114
|
|
|
113
|
-
context
|
|
114
|
-
example
|
|
115
|
+
context 'search' do
|
|
116
|
+
example 'there is a search method' do
|
|
115
117
|
expect(log).to respond_to(:search)
|
|
116
118
|
end
|
|
117
119
|
|
|
118
|
-
example
|
|
120
|
+
example 'a basic search returns the expected results' do
|
|
119
121
|
result = log.search(:sender => 'bootlog', :level => 5)
|
|
120
|
-
expect(result).to
|
|
121
|
-
expect(result.first).to
|
|
122
|
+
expect(result).to be_a(Array)
|
|
123
|
+
expect(result.first).to be_a(Hash)
|
|
122
124
|
expect(result.size).to be >= 1
|
|
123
125
|
end
|
|
126
|
+
|
|
127
|
+
example 'search keys must be valid' do
|
|
128
|
+
expect{ log.search(:bogus => 'bootlog') }.to raise_error(KeyError)
|
|
129
|
+
end
|
|
124
130
|
end
|
|
125
131
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apple-system-logger
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel J. Berger
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain:
|
|
11
10
|
- |
|
|
@@ -35,7 +34,7 @@ cert_chain:
|
|
|
35
34
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
|
36
35
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
|
37
36
|
-----END CERTIFICATE-----
|
|
38
|
-
date:
|
|
37
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
39
38
|
dependencies:
|
|
40
39
|
- !ruby/object:Gem::Dependency
|
|
41
40
|
name: ffi
|
|
@@ -79,6 +78,34 @@ dependencies:
|
|
|
79
78
|
- - "~>"
|
|
80
79
|
- !ruby/object:Gem::Version
|
|
81
80
|
version: '3.9'
|
|
81
|
+
- !ruby/object:Gem::Dependency
|
|
82
|
+
name: rubocop
|
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
|
84
|
+
requirements:
|
|
85
|
+
- - ">="
|
|
86
|
+
- !ruby/object:Gem::Version
|
|
87
|
+
version: '0'
|
|
88
|
+
type: :development
|
|
89
|
+
prerelease: false
|
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
91
|
+
requirements:
|
|
92
|
+
- - ">="
|
|
93
|
+
- !ruby/object:Gem::Version
|
|
94
|
+
version: '0'
|
|
95
|
+
- !ruby/object:Gem::Dependency
|
|
96
|
+
name: rubocop-rspec
|
|
97
|
+
requirement: !ruby/object:Gem::Requirement
|
|
98
|
+
requirements:
|
|
99
|
+
- - ">="
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '0'
|
|
102
|
+
type: :development
|
|
103
|
+
prerelease: false
|
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
105
|
+
requirements:
|
|
106
|
+
- - ">="
|
|
107
|
+
- !ruby/object:Gem::Version
|
|
108
|
+
version: '0'
|
|
82
109
|
description: " The apple-system-logger library provides an interface for the Apple
|
|
83
110
|
System\n Library. You can both write to, and search, your mac's system logs using\n
|
|
84
111
|
\ this library using an API that is very similar to the stdlib Logger interface.
|
|
@@ -107,11 +134,11 @@ licenses:
|
|
|
107
134
|
metadata:
|
|
108
135
|
homepage_uri: https://github.com/djberg96/apple-system-logger
|
|
109
136
|
bug_tracker_uri: https://github.com/djberg96/apple-system-logger/issues
|
|
110
|
-
changelog_uri: https://github.com/djberg96/apple-system-logger/blob/
|
|
137
|
+
changelog_uri: https://github.com/djberg96/apple-system-logger/blob/main/CHANGES.md
|
|
111
138
|
documentation_uri: https://github.com/djberg96/apple-system-logger/wiki
|
|
112
139
|
source_code_uri: https://github.com/djberg96/apple-system-logger
|
|
113
140
|
wiki_uri: https://github.com/djberg96/apple-system-logger/wiki
|
|
114
|
-
|
|
141
|
+
rubygems_mfa_required: 'true'
|
|
115
142
|
rdoc_options: []
|
|
116
143
|
require_paths:
|
|
117
144
|
- lib
|
|
@@ -126,8 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
126
153
|
- !ruby/object:Gem::Version
|
|
127
154
|
version: '0'
|
|
128
155
|
requirements: []
|
|
129
|
-
rubygems_version: 3.
|
|
130
|
-
signing_key:
|
|
156
|
+
rubygems_version: 3.7.2
|
|
131
157
|
specification_version: 4
|
|
132
158
|
summary: A Ruby interface for the Apple System Logger
|
|
133
159
|
test_files:
|
metadata.gz.sig
CHANGED
|
Binary file
|