From 54f4907c438434258bd0a1acc9b5780848b9ee67 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 3 Aug 2023 14:08:02 +1200 Subject: [PATCH 1/2] Modernize gem. --- .github/workflows/coverage.yaml | 4 ++-- .github/workflows/documentation.yaml | 2 +- .github/workflows/test-external.yaml | 2 +- .github/workflows/test.yaml | 3 +-- console.gemspec | 13 +++---------- examples/datadog/gems.rb | 5 +++++ examples/datadog/integration.rb | 4 ++++ fixtures/my_custom_output.rb | 2 +- gems.rb | 5 ++++- lib/console/filter.rb | 2 +- lib/console/output.rb | 2 +- lib/console/output/split.rb | 2 +- lib/console/progress.rb | 3 ++- lib/console/serialized/logger.rb | 2 +- lib/console/terminal/logger.rb | 2 +- lib/console/terminal/xterm.rb | 2 +- lib/console/version.rb | 2 +- license.md | 5 ++++- readme.md | 10 +++++++++- test/console.rb | 2 +- test/console/capture.rb | 2 +- test/console/compatible/logger.rb | 2 +- test/console/logger.rb | 2 +- test/console/output/split.rb | 2 +- test/console/resolver.rb | 2 +- test/console/serialized/logger.rb | 3 ++- test/console/terminal/text.rb | 2 +- 27 files changed, 53 insertions(+), 36 deletions(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 5e9afd7..81f3c65 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -21,7 +21,7 @@ jobs: - macos ruby: - - "3.1" + - "3.2" steps: - uses: actions/checkout@v3 @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.2" bundler-cache: true - uses: actions/download-artifact@v3 diff --git a/.github/workflows/documentation.yaml b/.github/workflows/documentation.yaml index 0e435e2..3d483fc 100644 --- a/.github/workflows/documentation.yaml +++ b/.github/workflows/documentation.yaml @@ -32,7 +32,7 @@ jobs: - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.2" bundler-cache: true - name: Installing packages diff --git a/.github/workflows/test-external.yaml b/.github/workflows/test-external.yaml index ff2ced8..cbff675 100644 --- a/.github/workflows/test-external.yaml +++ b/.github/workflows/test-external.yaml @@ -20,9 +20,9 @@ jobs: - macos ruby: - - "2.7" - "3.0" - "3.1" + - "3.2" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index df6c407..942ede7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,10 +21,9 @@ jobs: - macos ruby: - - "2.7.3" - - "2.7" - "3.0" - "3.1" + - "3.2" experimental: [false] diff --git a/console.gemspec b/console.gemspec index 3778430..cc417f3 100644 --- a/console.gemspec +++ b/console.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |spec| spec.version = Console::VERSION spec.summary = "Beautiful logging for Ruby." - spec.authors = ["Samuel Williams", "Robert Schulze", "Bryan Powell", "Michael Adams", "Cyril Roelandt", "Cédric Boutillier", "Olle Jonsson"] + spec.authors = ["Samuel Williams", "Robert Schulze", "Bryan Powell", "Michael Adams", "Anton Sozontov", "Cyril Roelandt", "Cédric Boutillier", "Felix Yan", "Olle Jonsson", "William T. Nelson"] spec.license = "MIT" spec.cert_chain = ['release.cert'] @@ -17,15 +17,8 @@ Gem::Specification.new do |spec| spec.files = Dir.glob(['{bake,lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) - spec.required_ruby_version = ">= 2.7.3" + spec.required_ruby_version = ">= 3.0" - spec.add_dependency "fiber-local" spec.add_dependency "fiber-annotation" - - spec.add_development_dependency "bake" - spec.add_development_dependency "bake-test" - spec.add_development_dependency "bake-test-external" - spec.add_development_dependency "bundler" - spec.add_development_dependency "covered", "~> 0.18.1" - spec.add_development_dependency "sus", "~> 0.14" + spec.add_dependency "fiber-local" end diff --git a/examples/datadog/gems.rb b/examples/datadog/gems.rb index 7d24df4..dbcff0a 100644 --- a/examples/datadog/gems.rb +++ b/examples/datadog/gems.rb @@ -1,3 +1,8 @@ +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2022-2023, by Samuel Williams. + source 'https://rubygems.org' gem 'traces' diff --git a/examples/datadog/integration.rb b/examples/datadog/integration.rb index b390666..aa24355 100755 --- a/examples/datadog/integration.rb +++ b/examples/datadog/integration.rb @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +# frozen_string_literal: true + +# Released under the MIT License. +# Copyright, 2022-2023, by Samuel Williams. # Run this using `systemd-cat bundle exec ./integration.rb` # This will send logs to datadog using the standard systemd journal. diff --git a/fixtures/my_custom_output.rb b/fixtures/my_custom_output.rb index 032976e..fb5c5f8 100644 --- a/fixtures/my_custom_output.rb +++ b/fixtures/my_custom_output.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. class MyCustomOutput def initialize(output, **options) diff --git a/gems.rb b/gems.rb index 8cf35b8..21fc5f5 100644 --- a/gems.rb +++ b/gems.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2020-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. source "https://rubygems.org" @@ -17,6 +17,9 @@ end group :test do + gem "covered", "~> 0.18.1" + gem "sus", "~> 0.14" + gem "bake-test" gem "bake-test-external" end diff --git a/lib/console/filter.rb b/lib/console/filter.rb index 9f29984..94630ca 100644 --- a/lib/console/filter.rb +++ b/lib/console/filter.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. # Copyright, 2019, by Bryan Powell. # Copyright, 2020, by Michael Adams. # Copyright, 2021, by Robert Schulze. diff --git a/lib/console/output.rb b/lib/console/output.rb index 88e43fa..3e461af 100644 --- a/lib/console/output.rb +++ b/lib/console/output.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2021-2022, by Samuel Williams. +# Copyright, 2021-2023, by Samuel Williams. require_relative 'output/default' require_relative 'output/json' diff --git a/lib/console/output/split.rb b/lib/console/output/split.rb index 440e6e3..06cada1 100644 --- a/lib/console/output/split.rb +++ b/lib/console/output/split.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2022-2023, by Samuel Williams. module Console module Output diff --git a/lib/console/progress.rb b/lib/console/progress.rb index 4880ec9..7851bf1 100644 --- a/lib/console/progress.rb +++ b/lib/console/progress.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2020-2022, by Samuel Williams. +# Copyright, 2020-2023, by Samuel Williams. +# Copyright, 2022, by Anton Sozontov. require_relative 'event/progress' require_relative 'clock' diff --git a/lib/console/serialized/logger.rb b/lib/console/serialized/logger.rb index 7ba81a7..6c1bfbc 100644 --- a/lib/console/serialized/logger.rb +++ b/lib/console/serialized/logger.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. require_relative '../buffer' require_relative '../filter' diff --git a/lib/console/terminal/logger.rb b/lib/console/terminal/logger.rb index 19df7ed..ffcac11 100644 --- a/lib/console/terminal/logger.rb +++ b/lib/console/terminal/logger.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. # Copyright, 2021, by Robert Schulze. require_relative '../buffer' diff --git a/lib/console/terminal/xterm.rb b/lib/console/terminal/xterm.rb index 3ae5e46..f4b68ec 100644 --- a/lib/console/terminal/xterm.rb +++ b/lib/console/terminal/xterm.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. require 'io/console' diff --git a/lib/console/version.rb b/lib/console/version.rb index 07a841f..c77798b 100644 --- a/lib/console/version.rb +++ b/lib/console/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. module Console VERSION = "1.19.0" diff --git a/license.md b/license.md index 8c6cf81..198be76 100644 --- a/license.md +++ b/license.md @@ -1,12 +1,15 @@ # MIT License -Copyright, 2019-2022, by Samuel Williams. +Copyright, 2019-2023, by Samuel Williams. Copyright, 2019-2021, by Bryan Powell. Copyright, 2019, by Cyril Roelandt. Copyright, 2020, by Olle Jonsson. Copyright, 2020, by Michael Adams. Copyright, 2021, by Cédric Boutillier. Copyright, 2021, by Robert Schulze. +Copyright, 2022, by Anton Sozontov. +Copyright, 2022, by William T. Nelson. +Copyright, 2023, by Felix Yan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/readme.md b/readme.md index 6ef6af4..ca053d2 100644 --- a/readme.md +++ b/readme.md @@ -6,7 +6,7 @@ Provides beautiful console logging for Ruby applications. Implements fast, buffe ## Motivation -When Ruby decided to reverse the order of exception backtraces, I finally gave up using the built in logging and decided restore sanity to the output of my programs once and for all! +When Ruby decided to reverse the order of exception backtraces, I finally gave up using the built in logging and decided restore sanity to the output of my programs once and for all\! ## Features @@ -29,3 +29,11 @@ We welcome contributions to this project. 3. Commit your changes (`git commit -am 'Add some feature'`). 4. Push to the branch (`git push origin my-new-feature`). 5. Create new Pull Request. + +### Developer Certificate of Origin + +This project uses the [Developer Certificate of Origin](https://developercertificate.org/). All contributors to this project must agree to this document to have their contributions accepted. + +### Contributor Covenant + +This project is governed by [Contributor Covenant](https://www.contributor-covenant.org/). All contributors and participants agree to abide by its terms. diff --git a/test/console.rb b/test/console.rb index af804cd..5278b5a 100644 --- a/test/console.rb +++ b/test/console.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. # Copyright, 2019, by Bryan Powell. # Copyright, 2020, by Michael Adams. diff --git a/test/console/capture.rb b/test/console/capture.rb index 4a9b8b1..83c12e2 100644 --- a/test/console/capture.rb +++ b/test/console/capture.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2020-2022, by Samuel Williams. +# Copyright, 2020-2023, by Samuel Williams. require 'console/capture' require 'console/logger' diff --git a/test/console/compatible/logger.rb b/test/console/compatible/logger.rb index c9678d5..ec9e036 100644 --- a/test/console/compatible/logger.rb +++ b/test/console/compatible/logger.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2022, by Samuel Williams. +# Copyright, 2022-2023, by Samuel Williams. require 'console/compatible/logger' require 'console/terminal/logger' diff --git a/test/console/logger.rb b/test/console/logger.rb index 8b9b9ac..c868610 100644 --- a/test/console/logger.rb +++ b/test/console/logger.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. # Copyright, 2019, by Bryan Powell. # Copyright, 2020, by Michael Adams. # Copyright, 2021, by Robert Schulze. diff --git a/test/console/output/split.rb b/test/console/output/split.rb index 8a2869b..1a48620 100644 --- a/test/console/output/split.rb +++ b/test/console/output/split.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2021-2022, by Samuel Williams. +# Copyright, 2022-2023, by Samuel Williams. require 'console/output/split' require 'console/capture' diff --git a/test/console/resolver.rb b/test/console/resolver.rb index 613ce34..41420eb 100644 --- a/test/console/resolver.rb +++ b/test/console/resolver.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. # Copyright, 2021, by Robert Schulze. require 'console' diff --git a/test/console/serialized/logger.rb b/test/console/serialized/logger.rb index 2f69531..60d61cd 100644 --- a/test/console/serialized/logger.rb +++ b/test/console/serialized/logger.rb @@ -1,7 +1,8 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2019-2023, by Samuel Williams. +# Copyright, 2023, by Felix Yan. require 'console/serialized/logger' require 'console/event/spawn' diff --git a/test/console/terminal/text.rb b/test/console/terminal/text.rb index e69da2f..6f8c8b6 100644 --- a/test/console/terminal/text.rb +++ b/test/console/terminal/text.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2019-2022, by Samuel Williams. +# Copyright, 2023, by Samuel Williams. require 'console/terminal/xterm' From dd4f8dea2d712cac22bc5f2492c6cd9ad0f812e9 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Thu, 3 Aug 2023 14:10:13 +1200 Subject: [PATCH 2/2] Remove **{} hack. --- test/console/output.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/console/output.rb b/test/console/output.rb index b34b224..12829ec 100644 --- a/test/console/output.rb +++ b/test/console/output.rb @@ -14,8 +14,7 @@ let(:output) {File.open('/tmp/console.log', 'w')} it 'should use a serialized format' do - # Force the options on Ruby 2.x: - expect(Console::Output.new(output, env, **{})).to be_a(Console::Serialized::Logger) + expect(Console::Output.new(output, env)).to be_a(Console::Serialized::Logger) end end @@ -26,8 +25,7 @@ it 'should use a terminal format' do expect($stderr).to receive(:tty?).and_return(true) - # Force the options on Ruby 2.x: - expect(Console::Output.new($stderr, env, **{})).to be_a Console::Terminal::Logger + expect(Console::Output.new($stderr, env)).to be_a Console::Terminal::Logger end end