syslog 0.1.2 → 0.2.0

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
  SHA256:
3
- metadata.gz: 2de70b2bef5aebf5022b121d4b50b6a77428f98718b3a71499ad5e20364152a7
4
- data.tar.gz: 15b803a1244e1b0e05256c34c842c901aa328807f598a667b0013a278ddae284
3
+ metadata.gz: 4380feb49c69d3151f1180c3bb4709e81b002dbb5ed92f509a1496e2df2b8b82
4
+ data.tar.gz: b5d3d89e6b8554aaa2bc0355f675473304eb6687e8bfd34d0912d9b1429eb2ec
5
5
  SHA512:
6
- metadata.gz: 469270d89d32df91bf0ed44e719db13d3cccc43c93ea47690a6a00a625e033b9eaf5dc0f0b31b10de0ad659cc39b14643cbd3f20236abe4695ce4361ce824e33
7
- data.tar.gz: be1efe211d0a0b15295b0a4ebff9debbd7cf21231a31ee84dccd8772a5cbb6dcd4e6f4bab43fc29ba35e7538a7f82da7499e1c7a811d37daab50bf1b1afccb52
6
+ metadata.gz: a6bc1cb6b33cabcbb9962e10e49053ab4939582bc59129cc291f304a781487da807fea267de2cc05b2cbf61f4ec31e0d45dbeba3f5c721a184744f6b7c31f705
7
+ data.tar.gz: eea9e7881550f036387d03fd73b3e5497d550f41ded31da7d7925c522a515ef76cd6aa0a14c920eb709d8a126442d5b741a92353ae5b2a619c5e8b624b133fba
@@ -0,0 +1,46 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository == 'ruby/syslog'
14
+ runs-on: ubuntu-latest
15
+
16
+ environment:
17
+ name: rubygems.org
18
+ url: https://rubygems.org/gems/syslog
19
+
20
+ permissions:
21
+ contents: write
22
+ id-token: write
23
+
24
+ steps:
25
+ - name: Harden Runner
26
+ uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
27
+ with:
28
+ egress-policy: audit
29
+
30
+ - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
31
+
32
+ - name: Set up Ruby
33
+ uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0
34
+ with:
35
+ bundler-cache: true
36
+ ruby-version: ruby
37
+
38
+ - name: Publish to RubyGems
39
+ uses: rubygems/release-gem@9e85cb11501bebc2ae661c1500176316d3987059 # v1.1.0
40
+
41
+ - name: Create GitHub release
42
+ run: |
43
+ tag_name="$(git describe --tags --abbrev=0)"
44
+ gh release create "${tag_name}" --verify-tag --generate-notes
45
+ env:
46
+ GITHUB_TOKEN: ${{ secrets.MATZBOT_GITHUB_WORKFLOW_TOKEN }}
@@ -8,7 +8,11 @@ jobs:
8
8
  strategy:
9
9
  matrix:
10
10
  ruby: [ 2.7, 2.6, 2.5, head ]
11
- os: [ ubuntu-latest, macos-latest ]
11
+ os: [ ubuntu-latest, macos-latest, windows-latest ]
12
+ exclude:
13
+ - { os: macos-latest, ruby: '2.5' }
14
+ include:
15
+ - { os: macos-13, ruby: '2.5' }
12
16
  runs-on: ${{ matrix.os }}
13
17
  steps:
14
18
  - uses: actions/checkout@v4
data/README.md CHANGED
@@ -24,6 +24,7 @@ Or install it yourself as:
24
24
  ## Usage
25
25
 
26
26
  ```ruby
27
+ require "syslog"
27
28
  Syslog.open("webrick", Syslog::LOG_PID,
28
29
  Syslog::LOG_DAEMON | Syslog::LOG_LOCAL3)
29
30
  ```
data/Rakefile CHANGED
@@ -8,5 +8,13 @@ Rake::TestTask.new(:test) do |t|
8
8
  end
9
9
 
10
10
  require 'rake/extensiontask'
11
- Rake::ExtensionTask.new("syslog")
11
+ Rake::ExtensionTask.new("syslog_ext") do |ext|
12
+ ext.ext_dir = 'ext/syslog'
13
+
14
+ # In contrast to "gem install" a "rake compile" is expecting the C-ext file even on Windows.
15
+ # Work around by creating a dummy so file.
16
+ task "#{ext.tmp_dir}/#{ext.platform}/stage/lib" do |t|
17
+ touch "#{ext.tmp_dir}/#{ext.platform}/#{ext.name}/#{RUBY_VERSION}/#{ext.name}.so"
18
+ end
19
+ end
12
20
  task :default => :test
@@ -4,10 +4,23 @@
4
4
 
5
5
  require 'mkmf'
6
6
 
7
- have_library("log") # for Android
7
+ def generate_dummy_makefile
8
+ File.open("Makefile", "w") do |f|
9
+ f.puts dummy_makefile("syslog_ext").join
10
+ end
11
+ end
8
12
 
9
- have_header("syslog.h") &&
10
- have_func("openlog") &&
11
- have_func("setlogmask") &&
12
- create_makefile("syslog")
13
+ def windows?
14
+ RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
15
+ end
13
16
 
17
+ if windows?
18
+ generate_dummy_makefile
19
+ else
20
+ have_library("log") # for Android
21
+
22
+ have_header("syslog.h") &&
23
+ have_func("openlog") &&
24
+ have_func("setlogmask") &&
25
+ create_makefile("syslog_ext")
26
+ end
data/ext/syslog/syslog.c CHANGED
@@ -12,7 +12,7 @@
12
12
  #include "ruby/util.h"
13
13
  #include <syslog.h>
14
14
 
15
- #define SYSLOG_VERSION "0.1.2"
15
+ #define SYSLOG_VERSION "0.2.0"
16
16
 
17
17
  /* Syslog class */
18
18
  static VALUE mSyslog;
@@ -415,7 +415,7 @@ static VALUE mSyslogMacros_included(VALUE mod, VALUE target)
415
415
  *
416
416
  * The syslog protocol is standardized in RFC 5424.
417
417
  */
418
- void Init_syslog(void)
418
+ void Init_syslog_ext(void)
419
419
  {
420
420
  #undef rb_intern
421
421
  mSyslog = rb_define_module("Syslog");
data/lib/syslog.rb ADDED
@@ -0,0 +1,10 @@
1
+ begin
2
+ require 'syslog_ext'
3
+ rescue LoadError
4
+ raise LoadError.new(<<-EOS)
5
+ Can't load Syslog!
6
+
7
+ Syslog is not supported on your system. For Windows
8
+ we recommend using the win32-eventlog gem.
9
+ EOS
10
+ end
data/syslog.gemspec CHANGED
@@ -22,7 +22,5 @@ Gem::Specification.new do |spec|
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
24
  spec.extensions = ["ext/syslog/extconf.rb"]
25
- spec.bindir = "exe"
26
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
25
  spec.require_paths = ["lib"]
28
26
  end
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.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akinori MUSHA
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-16 00:00:00.000000000 Z
11
+ date: 2024-12-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Ruby interface for the POSIX system logging facility.
14
14
  email:
@@ -21,6 +21,7 @@ files:
21
21
  - ".git-blame-ignore-revs"
22
22
  - ".github/CODEOWNERS"
23
23
  - ".github/dependabot.yml"
24
+ - ".github/workflows/push_gem.yml"
24
25
  - ".github/workflows/test.yml"
25
26
  - ".gitignore"
26
27
  - Gemfile
@@ -32,6 +33,7 @@ files:
32
33
  - ext/syslog/extconf.rb
33
34
  - ext/syslog/syslog.c
34
35
  - ext/syslog/syslog.txt
36
+ - lib/syslog.rb
35
37
  - lib/syslog/logger.rb
36
38
  - syslog.gemspec
37
39
  homepage: https://github.com/ruby/syslog
@@ -56,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
58
  - !ruby/object:Gem::Version
57
59
  version: '0'
58
60
  requirements: []
59
- rubygems_version: 3.5.0.dev
61
+ rubygems_version: 3.5.11
60
62
  signing_key:
61
63
  specification_version: 4
62
64
  summary: Ruby interface for the POSIX system logging facility.