syslog 0.1.0 → 0.1.2

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: ddb6ed968d877f312af6f7f03878492b0a90488d5bc3c0262d8655405520cd83
4
- data.tar.gz: d3d22a728f8144fdc97dba1a637e8abf212366f3b6e928d4b02849c876517542
3
+ metadata.gz: 2de70b2bef5aebf5022b121d4b50b6a77428f98718b3a71499ad5e20364152a7
4
+ data.tar.gz: 15b803a1244e1b0e05256c34c842c901aa328807f598a667b0013a278ddae284
5
5
  SHA512:
6
- metadata.gz: 47bd387f3709fb5331e33b4f89c1e605eb18bfe20ab4fc3a4921198c5bcaa9db20f032f03c13d5d6feb02b38b1d76807ee28db0c676ef3488d8482264f611a1f
7
- data.tar.gz: d18c20fe78f8bf9fa967a3717dc72beb653069f015d4fc737b3e85dfe058b5cb59c5f82a4068786d0b57315f3e18e673b40dc63846fa6decacce6207c0ea82bb
6
+ metadata.gz: 469270d89d32df91bf0ed44e719db13d3cccc43c93ea47690a6a00a625e033b9eaf5dc0f0b31b10de0ad659cc39b14643cbd3f20236abe4695ce4361ce824e33
7
+ data.tar.gz: be1efe211d0a0b15295b0a4ebff9debbd7cf21231a31ee84dccd8772a5cbb6dcd4e6f4bab43fc29ba35e7538a7f82da7499e1c7a811d37daab50bf1b1afccb52
@@ -0,0 +1,7 @@
1
+ # This is a file used by GitHub to ignore the following commits on `git blame`.
2
+ #
3
+ # You can also do the same thing in your local repository with:
4
+ # $ git config --local blame.ignoreRevsFile .git-blame-ignore-revs
5
+
6
+ # Expand tabs
7
+ 4ba27cb6380daf5103fc9920ce61e7c5fcfcc713
@@ -0,0 +1 @@
1
+ * @knu
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'github-actions'
4
+ directory: '/'
5
+ schedule:
6
+ interval: 'weekly'
@@ -11,14 +11,12 @@ jobs:
11
11
  os: [ ubuntu-latest, macos-latest ]
12
12
  runs-on: ${{ matrix.os }}
13
13
  steps:
14
- - uses: actions/checkout@master
14
+ - uses: actions/checkout@v4
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: ${{ matrix.ruby }}
19
19
  - name: Install dependencies
20
- run: |
21
- gem install bundler --no-document
22
- bundle install
20
+ run: bundle install
23
21
  - name: Run test
24
22
  run: rake compile test
data/ext/syslog/syslog.c CHANGED
@@ -12,6 +12,8 @@
12
12
  #include "ruby/util.h"
13
13
  #include <syslog.h>
14
14
 
15
+ #define SYSLOG_VERSION "0.1.2"
16
+
15
17
  /* Syslog class */
16
18
  static VALUE mSyslog;
17
19
  /*
@@ -165,15 +167,15 @@ static VALUE mSyslog_open(int argc, VALUE *argv, VALUE self)
165
167
  syslog_ident = strdup(ident_ptr);
166
168
 
167
169
  if (NIL_P(opt)) {
168
- syslog_options = LOG_PID | LOG_CONS;
170
+ syslog_options = LOG_PID | LOG_CONS;
169
171
  } else {
170
- syslog_options = NUM2INT(opt);
172
+ syslog_options = NUM2INT(opt);
171
173
  }
172
174
 
173
175
  if (NIL_P(fac)) {
174
- syslog_facility = LOG_USER;
176
+ syslog_facility = LOG_USER;
175
177
  } else {
176
- syslog_facility = NUM2INT(fac);
178
+ syslog_facility = NUM2INT(fac);
177
179
  }
178
180
 
179
181
  openlog(syslog_ident, syslog_options, syslog_facility);
@@ -307,7 +309,7 @@ static VALUE mSyslog_log(int argc, VALUE *argv, VALUE self)
307
309
  pri = *argv++;
308
310
 
309
311
  if (!FIXNUM_P(pri)) {
310
- rb_raise(rb_eTypeError, "type mismatch: %"PRIsVALUE" given", rb_obj_class(pri));
312
+ rb_raise(rb_eTypeError, "type mismatch: %"PRIsVALUE" given", rb_obj_class(pri));
311
313
  }
312
314
 
313
315
  syslog_write(FIX2INT(pri), argc, argv);
@@ -322,14 +324,14 @@ static VALUE mSyslog_inspect(VALUE self)
322
324
  Check_Type(self, T_MODULE);
323
325
 
324
326
  if (!syslog_opened)
325
- return rb_sprintf("<#%"PRIsVALUE": opened=false>", self);
327
+ return rb_sprintf("<#%"PRIsVALUE": opened=false>", self);
326
328
 
327
329
  return rb_sprintf("<#%"PRIsVALUE": opened=true, ident=\"%s\", options=%d, facility=%d, mask=%d>",
328
- self,
329
- syslog_ident,
330
- syslog_options,
331
- syslog_facility,
332
- syslog_mask);
330
+ self,
331
+ syslog_ident,
332
+ syslog_options,
333
+ syslog_facility,
334
+ syslog_mask);
333
335
  }
334
336
 
335
337
  /* Returns self, for backward compatibility.
@@ -574,6 +576,8 @@ void Init_syslog(void)
574
576
 
575
577
  /* Syslog macros */
576
578
 
579
+ rb_define_const(mSyslog, "VERSION", rb_str_new_cstr(SYSLOG_VERSION));
580
+
577
581
  rb_define_method(mSyslogMacros, "LOG_MASK", mSyslogMacros_LOG_MASK, 1);
578
582
  rb_define_method(mSyslogMacros, "LOG_UPTO", mSyslogMacros_LOG_UPTO, 1);
579
583
  rb_define_singleton_method(mSyslogMacros, "included", mSyslogMacros_included, 1);
data/syslog.gemspec CHANGED
@@ -1,13 +1,18 @@
1
+ source_version = %w[. ext/syslog].find do |dir|
2
+ break $1 if File.foreach(File.join(__dir__, dir, "syslog.c")).any?(/^#define\s+SYSLOG_VERSION\s+"(.+)"/)
3
+ rescue Errno::ENOENT
4
+ end
5
+
1
6
  Gem::Specification.new do |spec|
2
7
  spec.name = "syslog"
3
- spec.version = "0.1.0"
8
+ spec.version = source_version
4
9
  spec.authors = ["Akinori MUSHA"]
5
10
  spec.email = ["knu@idaemons.org"]
6
11
 
7
12
  spec.summary = %q{Ruby interface for the POSIX system logging facility.}
8
13
  spec.description = %q{Ruby interface for the POSIX system logging facility.}
9
14
  spec.homepage = "https://github.com/ruby/syslog"
10
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
15
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
11
16
  spec.licenses = ["Ruby", "BSD-2-Clause"]
12
17
 
13
18
  spec.metadata["homepage_uri"] = spec.homepage
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syslog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-18 00:00:00.000000000 Z
11
+ date: 2023-12-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby interface for the POSIX system logging facility.
14
14
  email:
@@ -18,6 +18,9 @@ extensions:
18
18
  - ext/syslog/extconf.rb
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - ".git-blame-ignore-revs"
22
+ - ".github/CODEOWNERS"
23
+ - ".github/dependabot.yml"
21
24
  - ".github/workflows/test.yml"
22
25
  - ".gitignore"
23
26
  - Gemfile
@@ -46,14 +49,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
46
49
  requirements:
47
50
  - - ">="
48
51
  - !ruby/object:Gem::Version
49
- version: 2.3.0
52
+ version: 2.5.0
50
53
  required_rubygems_version: !ruby/object:Gem::Requirement
51
54
  requirements:
52
55
  - - ">="
53
56
  - !ruby/object:Gem::Version
54
57
  version: '0'
55
58
  requirements: []
56
- rubygems_version: 3.2.0.rc.1
59
+ rubygems_version: 3.5.0.dev
57
60
  signing_key:
58
61
  specification_version: 4
59
62
  summary: Ruby interface for the POSIX system logging facility.