Skip to content

Commit

Permalink
Modernize gem. (#45)
Browse files Browse the repository at this point in the history
* Remove **{} hack.
  • Loading branch information
ioquatix authored Aug 3, 2023
1 parent e3aef3b commit 9262be1
Show file tree
Hide file tree
Showing 28 changed files with 55 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- macos

ruby:
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-external.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
- macos

ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"

steps:
- uses: actions/checkout@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ jobs:
- macos

ruby:
- "2.7.3"
- "2.7"
- "3.0"
- "3.1"
- "3.2"

experimental: [false]

Expand Down
13 changes: 3 additions & 10 deletions console.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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
5 changes: 5 additions & 0 deletions examples/datadog/gems.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
4 changes: 4 additions & 0 deletions examples/datadog/integration.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion fixtures/my_custom_output.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 4 additions & 1 deletion gems.rb
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/console/filter.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/console/output.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/console/output/split.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion lib/console/progress.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/console/serialized/logger.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/console/terminal/logger.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion lib/console/terminal/xterm.rb
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion lib/console/version.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
5 changes: 4 additions & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 9 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
2 changes: 1 addition & 1 deletion test/console.rb
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion test/console/capture.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/console/compatible/logger.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/console/logger.rb
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 2 additions & 4 deletions test/console/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/console/output/split.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/console/resolver.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 2 additions & 1 deletion test/console/serialized/logger.rb
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/console/terminal/text.rb
Original file line number Diff line number Diff line change
@@ -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'

Expand Down

0 comments on commit 9262be1

Please sign in to comment.