lumberjack_syslog_device 1.1.0 → 1.1.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
  SHA256:
3
- metadata.gz: fb001f870d1cfccdc29ec125be18dcff064b2d78e2731205db30704a9d2170c2
4
- data.tar.gz: b9a73d61ec0ef1be9dd31cb35b36d405d265a8de5a2692480a3f98faef270c23
3
+ metadata.gz: 05cda0528c884ab6d20bc8248c33a4ceaea7e03d7290597a0f38a416792298dd
4
+ data.tar.gz: 77d51847f6bedd3c998084b6d7346351f3757cb7981f8b97f06b76a053ca6c13
5
5
  SHA512:
6
- metadata.gz: 15851b8b81b2480ca0735173b9f9e2fa1b4d05147d6b4d64979c06a984df8adfd965fe384e4b8073c4b219bb6973948ada88a2aaae3a3647b8ed175ba683c4b7
7
- data.tar.gz: 537be3b73a57c3d62abbcb31442c9d88242fa44e884b4b73739e8f72edb0272a383fa9ed0110bfda74a931f705367ca7bae97be137b460345ec33cda011923bd
6
+ metadata.gz: 531c7966e066dd4618058306c096553cad8fd6ce36e0e40794bcaffad6ec1bee8456cf3178c456ea6b99a896a066f98a5af1406fb577a5b4123286bd2c0f92a0
7
+ data.tar.gz: 848b6bc544c0e437648e1f7b73d337f8b83790ab264cc8f8f667367a1be3c3c6d12973fc13a4834781b9976826759d80f5ea5bf9d43245ec17f9b6068c02c14b
@@ -0,0 +1,12 @@
1
+ # Dependabot update strategy
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: weekly
8
+ allow:
9
+ # Automatically keep all runtime dependencies updated
10
+ - dependency-name: "*"
11
+ dependency-type: "production"
12
+ versioning-strategy: lockfile-only
@@ -0,0 +1,47 @@
1
+ name: Continuous Integration
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - actions-*
8
+ tags:
9
+ - v*
10
+ pull_request:
11
+ branches-ignore:
12
+ - actions-*
13
+
14
+ env:
15
+ BUNDLE_CLEAN: "true"
16
+ BUNDLE_PATH: vendor/bundle
17
+ BUNDLE_JOBS: 3
18
+ BUNDLE_RETRY: 3
19
+
20
+ jobs:
21
+ build:
22
+ name: ${{ matrix.ruby }} build
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ matrix:
26
+ include:
27
+ - ruby: "ruby"
28
+ standardrb: true
29
+ - ruby: "3.0"
30
+ - ruby: "2.7"
31
+ - ruby: "2.6"
32
+ - ruby: "2.5"
33
+ - ruby: "2.4"
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+ - name: Set up Ruby
37
+ uses: ruby/setup-ruby@v1
38
+ with:
39
+ ruby-version: ${{ matrix.ruby}}
40
+ - name: Install gems
41
+ run: |
42
+ bundle install
43
+ - name: Run Tests
44
+ run: bundle exec rake
45
+ - name: standardrb
46
+ if: matrix.standardrb
47
+ run: bundle exec standardrb
@@ -0,0 +1,29 @@
1
+ name: Regression Test
2
+ on:
3
+ workflow_dispatch:
4
+ schedule:
5
+ - cron: "0 15 * * 1"
6
+ env:
7
+ BUNDLE_CLEAN: "true"
8
+ BUNDLE_PATH: vendor/bundle
9
+ BUNDLE_JOBS: 3
10
+ BUNDLE_RETRY: 3
11
+ jobs:
12
+ specs:
13
+ name: Run specs
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v4
20
+ - name: Set up Ruby ${{ matrix.ruby }}
21
+ uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ruby
24
+ - name: Install bundler
25
+ run: |
26
+ bundle update
27
+ - name: Run specs
28
+ run: |
29
+ bundle exec rake spec
data/.standard.yml ADDED
@@ -0,0 +1,10 @@
1
+ # I really just have issues with the automatic "semantic blocks"
2
+
3
+ ruby_version: 2.4
4
+
5
+ format: progress
6
+
7
+ ignore:
8
+ - 'spec/**/*':
9
+ - Lint/UselessAssignment
10
+ - Lint/Void
data/CHANGE_LOG.md CHANGED
@@ -1,3 +1,23 @@
1
- # 2.0.0
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
2
3
 
3
- * Add support for lumberjack 2.0 tags
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 1.1.1
8
+
9
+ ### Changed
10
+
11
+ - Always cast values to strings before logging to syslog (thanks @eremeyev).
12
+
13
+ ## 1.1.0
14
+
15
+ ### Added
16
+
17
+ - Add support for lumberjack 2.0 tags.
18
+
19
+ ## 1.0.0
20
+
21
+ ### Added
22
+
23
+ - Initial release.
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Lumberjack Syslog Device
2
2
 
3
- [![Build Status](https://travis-ci.org/bdurand/lumberjack_syslog_device.svg?branch=master)](https://travis-ci.org/bdurand/lumberjack_syslog_device)
4
- [![Maintainability](https://api.codeclimate.com/v1/badges/61785ec7e33012f55d65/maintainability)](https://codeclimate.com/github/bdurand/lumberjack_syslog_device/maintainability)
3
+ [![Continuous Integration](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/continuous_integration.yml)
4
+ [![Regression Test](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/regression_test.yml/badge.svg)](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/regression_test.yml)
5
+ [![Ruby Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/testdouble/standard)
5
6
 
6
7
  This gem provides a logging device for the [lumberjack](https://github.com/bdurand/lumberjack) gem that will log to syslog, the centralized system logging facility. See http://en.wikipedia.org/wiki/Syslog for more information on syslog.
7
8
 
8
- ## Example Usage
9
+ ## Usage
9
10
 
10
11
  ```ruby
11
12
  require 'lumberjack_syslog_device'
@@ -15,4 +16,32 @@ logger = Lumberjack::Logger.new(device)
15
16
  logger.info("Write me to syslog!")
16
17
  ```
17
18
 
18
- See SyslogDevice for more details.
19
+ See the docs in the Lumberjack::SyslogDevice file for more details.
20
+
21
+ ## Installation
22
+
23
+ Add this line to your application's Gemfile:
24
+
25
+ ```ruby
26
+ gem 'lumberjack_syslog_device'
27
+ ```
28
+
29
+ And then execute:
30
+ ```bash
31
+ $ bundle
32
+ ```
33
+
34
+ Or install it yourself as:
35
+ ```bash
36
+ $ gem install lumberjack_syslog_device
37
+ ```
38
+
39
+ ## Contributing
40
+
41
+ Open a pull request on GitHub.
42
+
43
+ Please use the [standardrb](https://github.com/testdouble/standard) syntax and lint your code with `standardrb --fix` before submitting.
44
+
45
+ ## License
46
+
47
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'syslog'
4
- require 'lumberjack'
3
+ require "syslog"
4
+ require "lumberjack"
5
5
 
6
6
  module Lumberjack
7
7
  # This Lumberjack device logs output to syslog. There can only be one connection to syslog
@@ -18,8 +18,8 @@ module Lumberjack
18
18
  Severity::UNKNOWN => Syslog::LOG_ALERT
19
19
  }
20
20
 
21
- PERCENT = '%'
22
- ESCAPED_PERCENT = '%%'
21
+ PERCENT = "%"
22
+ ESCAPED_PERCENT = "%%"
23
23
 
24
24
  @@lock = Mutex.new
25
25
 
@@ -68,7 +68,7 @@ module Lumberjack
68
68
  end
69
69
 
70
70
  def write(entry)
71
- message = @template.call(entry).gsub(PERCENT, ESCAPED_PERCENT)
71
+ message = @template.call(entry).to_s.gsub(PERCENT, ESCAPED_PERCENT)
72
72
  @@lock.synchronize do
73
73
  syslog = open_syslog(entry.progname)
74
74
  begin
@@ -82,7 +82,7 @@ module Lumberjack
82
82
  def close
83
83
  flush
84
84
  @lock.synchronize do
85
- @syslog.close if @syslog && @syslog.opened?
85
+ @syslog.close if @syslog&.opened?
86
86
  end
87
87
  end
88
88
 
@@ -90,22 +90,22 @@ module Lumberjack
90
90
 
91
91
  # Open syslog with ident set to progname. If it is already open with a different
92
92
  # ident, close it and reopen it.
93
- def open_syslog(progname) #:nodoc:
93
+ def open_syslog(progname) # :nodoc:
94
94
  syslog_impl = syslog_implementation
95
95
  if syslog_impl.opened?
96
- if (progname.nil? || syslog_impl.ident == progname) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
96
+ if (progname.nil? || syslog_impl.ident == progname.to_s) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
97
97
  return syslog_impl
98
98
  else
99
99
  syslog_impl.close
100
100
  end
101
101
  end
102
- syslog = syslog_impl.open(progname, @syslog_options, @syslog_facility)
102
+ syslog = syslog_impl.open(progname.to_s, @syslog_options, @syslog_facility)
103
103
  syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_DEBUG)
104
104
  syslog
105
105
  end
106
106
 
107
107
  # Provided for testing purposes
108
- def syslog_implementation #:nodoc:
108
+ def syslog_implementation # :nodoc:
109
109
  Syslog
110
110
  end
111
111
 
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |spec|
2
- spec.name = 'lumberjack_syslog_device'
2
+ spec.name = "lumberjack_syslog_device"
3
3
  spec.version = File.read(File.expand_path("../VERSION", __FILE__)).strip
4
- spec.authors = ['Brian Durand']
5
- spec.email = ['bbdurand@gmail.com']
4
+ spec.authors = ["Brian Durand"]
5
+ spec.email = ["bbdurand@gmail.com"]
6
6
 
7
7
  spec.summary = "A logging device for the lumberjack gem that writes log entries to syslog."
8
8
  spec.homepage = "https://github.com/bdurand/lumberjack_syslog_device"
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
 
11
11
  # Specify which files should be added to the gem when it is released.
12
12
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
13
- ignore_files = %w(
13
+ ignore_files = %w[
14
14
  .gitignore
15
15
  .travis.yml
16
16
  Appraisals
@@ -19,15 +19,16 @@ Gem::Specification.new do |spec|
19
19
  Rakefile
20
20
  gemfiles/
21
21
  spec/
22
- )
23
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
24
- `git ls-files -z`.split("\x0").reject{ |f| ignore_files.any?{ |path| f.start_with?(path) } }
22
+ ]
23
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| ignore_files.any? { |path| f.start_with?(path) } }
25
25
  end
26
26
 
27
- spec.require_paths = ['lib']
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.required_ruby_version = ">=2.4"
28
30
 
29
31
  spec.add_dependency "lumberjack", ">=1.1"
30
32
 
31
- spec.add_development_dependency("rspec", ["~> 3.0"])
32
- spec.add_development_dependency "rake"
33
+ spec.add_development_dependency "bundler"
33
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lumberjack_syslog_device
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-05 00:00:00.000000000 Z
11
+ date: 2023-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lumberjack
@@ -25,21 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '3.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '3.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rake
28
+ name: bundler
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - ">="
@@ -52,13 +38,17 @@ dependencies:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
- description:
41
+ description:
56
42
  email:
57
43
  - bbdurand@gmail.com
58
44
  executables: []
59
45
  extensions: []
60
46
  extra_rdoc_files: []
61
47
  files:
48
+ - ".github/dependabot.yml"
49
+ - ".github/workflows/continuous_integration.yml"
50
+ - ".github/workflows/regression_test.yml"
51
+ - ".standard.yml"
62
52
  - CHANGE_LOG.md
63
53
  - MIT_LICENSE
64
54
  - README.md
@@ -69,7 +59,7 @@ homepage: https://github.com/bdurand/lumberjack_syslog_device
69
59
  licenses:
70
60
  - MIT
71
61
  metadata: {}
72
- post_install_message:
62
+ post_install_message:
73
63
  rdoc_options: []
74
64
  require_paths:
75
65
  - lib
@@ -77,15 +67,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
67
  requirements:
78
68
  - - ">="
79
69
  - !ruby/object:Gem::Version
80
- version: '0'
70
+ version: '2.4'
81
71
  required_rubygems_version: !ruby/object:Gem::Requirement
82
72
  requirements:
83
73
  - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  requirements: []
87
- rubygems_version: 3.0.3
88
- signing_key:
77
+ rubygems_version: 3.4.12
78
+ signing_key:
89
79
  specification_version: 4
90
80
  summary: A logging device for the lumberjack gem that writes log entries to syslog.
91
81
  test_files: []