silent_stream 1.0.6 → 1.0.7

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: e0674612ee30874ba629342778f29d7b96d6366b0398f2848a4a6958c59c2620
4
- data.tar.gz: eac29a150200bfeafd87b8b31557f7c93d9d58d2116426ad5b9de55116a37ff0
3
+ metadata.gz: bfe500149e834232e239140a8fdf05da25846abc05811dce5bdaa928633ff2f4
4
+ data.tar.gz: b306f1189e82d9bd3fb236303a6391ba4bd257be5912394a04423d945af303cc
5
5
  SHA512:
6
- metadata.gz: 2b5398a3e02ebae7efb82c6582d08762e40dba67bd8d6b5420d2a4f4bdb79d09ee525c22b1c50a8f41b0b44a791c916f9255838b0316a4780349cd96eddc9950
7
- data.tar.gz: 31604b518d7d6bd7097d557e187302b9d5846f1564e5a77f1774164d14cefd0549540c2a7e83298f7079c7f6a7518917ec96579efd59d3eab5dd408ac0624093
6
+ metadata.gz: d5c60fb03b31caa92304be9016ed85ba685ee7bc5642a4a8681047f344b28aa169455e52f2f57b5ecc6852ec5119cfc3ec704d1b6362a323ad9be16e64ccd6f8
7
+ data.tar.gz: 268e20474b1174ea982085c5882563f2d294387525d7f7edbb1bfe20c931d44cbde59879458605e95a230a38be9282393aca3bd0f88fbae10243c07c092075bf
data/.rubocop.yml CHANGED
@@ -1,2 +1,4 @@
1
- Layout/DotPosition:
2
- EnforcedStyle: trailing
1
+ inherit_gem:
2
+ rubocop-lts: config/rubygem.yml
3
+
4
+ require: rubocop-minitest
@@ -0,0 +1,33 @@
1
+ {
2
+ "lib/silent_stream.rb:3497521302": [
3
+ [9, 3, 165, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2295567404],
4
+ [33, 26, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
5
+ [68, 22, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
6
+ [84, 7, 102, "Lint/RescueException: Avoid rescuing the `Exception` class. Perhaps you meant to rescue `StandardError`?", 1454146794],
7
+ [114, 19, 4, "Security/Eval: The use of `eval` is a serious security risk.", 2087429787],
8
+ [137, 22, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
9
+ [138, 24, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163]
10
+ ],
11
+ "silent_stream.gemspec:402039502": [
12
+ [61, 5, 19, "Packaging/GemspecGit: Avoid using git to produce lists of files. Downstreams often need to build your package in an environment that does not have git (on purpose). Use some pure Ruby alternative, like `Dir` or `Dir.glob`.", 3879951891],
13
+ [68, 3, 44, "Gemspec/DependencyVersion: Dependency version specification is required.", 2775602551],
14
+ [69, 3, 42, "Gemspec/DependencyVersion: Dependency version specification is required.", 3928530036],
15
+ [71, 3, 53, "Gemspec/DependencyVersion: Dependency version specification is required.", 2976601152],
16
+ [72, 3, 40, "Gemspec/DependencyVersion: Dependency version specification is required.", 2300588954],
17
+ [73, 3, 39, "Gemspec/DependencyVersion: Dependency version specification is required.", 1345440847],
18
+ [76, 3, 39, "Gemspec/DependencyVersion: Dependency version specification is required.", 1249263682]
19
+ ],
20
+ "tests/test_silent_stream.rb:2217126815": [
21
+ [26, 19, 4, "Security/Eval: The use of `eval` is a serious security risk.", 2087429787],
22
+ [60, 25, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
23
+ [67, 25, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
24
+ [72, 27, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
25
+ [73, 28, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
26
+ [73, 38, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
27
+ [74, 39, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
28
+ [88, 27, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
29
+ [89, 27, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163],
30
+ [94, 39, 6, "Style/GlobalStdStream: Use `$stdout` instead of `STDOUT`.", 3356722952],
31
+ [95, 39, 6, "Style/GlobalStdStream: Use `$stderr` instead of `STDERR`.", 3356712163]
32
+ ]
33
+ }
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.2.3
data/.travis.yml CHANGED
@@ -19,8 +19,7 @@ after_script:
19
19
  - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
20
20
 
21
21
  before_install:
22
- - gem update --system
23
- - gem install bundler -v 1.16.5
22
+ - gem install bundler:1.17.3
24
23
 
25
24
  install:
26
25
  - bundle install --path=${BUNDLE_PATH:-vendor/bundle} --no-deployment --jobs 3 --retry 3
data/Appraisals CHANGED
@@ -1,24 +1,26 @@
1
+ # frozen_string_literal: true
2
+
1
3
  appraise "ruby_2.3" do
2
4
  gem "rubocop", "0.77.0"
3
- gem 'rubocop-minitest'
5
+ gem "rubocop-minitest"
4
6
  end
5
7
 
6
8
  appraise "ruby_2.4" do
7
9
  gem "rubocop", "0.77.0"
8
- gem 'rubocop-minitest'
10
+ gem "rubocop-minitest"
9
11
  end
10
12
 
11
13
  appraise "ruby_2.5" do
12
14
  gem "rubocop"
13
- gem 'rubocop-minitest'
15
+ gem "rubocop-minitest"
14
16
  end
15
17
 
16
18
  appraise "ruby_2.6" do
17
19
  gem "rubocop"
18
- gem 'rubocop-minitest'
20
+ gem "rubocop-minitest"
19
21
  end
20
22
 
21
23
  appraise "ruby_2.7" do
22
24
  gem "rubocop"
23
- gem 'rubocop-minitest'
25
+ gem "rubocop-minitest"
24
26
  end
data/Gemfile CHANGED
@@ -1,8 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
7
7
  # Specify your gem's dependencies in silent_stream.gemspec
8
8
  gemspec
9
+
10
+ gem "rubocop-packaging", "~> 0.5", ">= 0.5.2"
11
+ gem "rubocop-minitest"
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2018 Peter Boling of railsbling.com
1
+ Copyright 2018, 2024 Peter Boling of railsbling.com
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -6,21 +6,22 @@ Since July 2014 `silence_stream`, `silence_stderr`, `capture`, `silence`, and `q
6
6
 
7
7
  This gem was taken out of Rails but it is *not* Rails dependent. The extraction was total (**even the tests**!), and this is now a pure Ruby library, which can be used in any Ruby project without encumbrances. *This gem has no runtime dependencies*.
8
8
 
9
- | Project | SilentStream |
10
- |------------------------ | ----------------------- |
11
- | gem name | [silent_stream](https://rubygems.org/gems/silent_stream) |
12
- | compatibility | Ruby 2.3, 2.4, 2.5, 2.6, 2.7 |
13
- | license | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) |
14
- | download rank | [![Downloads Today](https://img.shields.io/gem/rd/silent_stream.svg)](https://github.com/pboling/silent_stream) |
15
- | version | [![Version](https://img.shields.io/gem/v/silent_stream.svg)](https://rubygems.org/gems/silent_stream) |
16
- | continuous integration | [![Build Status](https://travis-ci.org/pboling/silent_stream.svg?branch=master)](https://travis-ci.org/pboling/silent_stream) |
17
- | test coverage | [![Test Coverage](https://api.codeclimate.com/v1/badges/ced7e39984dd9c27c528/test_coverage)](https://codeclimate.com/github/pboling/silent_stream/test_coverage) |
18
- | maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/ced7e39984dd9c27c528/maintainability)](https://codeclimate.com/github/pboling/silent_stream/maintainability) |
19
- | dependencies | [![Depfu](https://badges.depfu.com/badges/6633827ecc1ad3b5dd749b4ac822347b/count.svg)](https://depfu.com/github/pboling/silent_stream?project_id=5828) |
20
- | code triage | [![Open Source Helpers](https://www.codetriage.com/pboling/silent_stream/badges/users.svg)](https://www.codetriage.com/pboling/silent_stream) |
21
- | homepage | [on Github.com][homepage], [on Railsbling.com][blogpage] |
22
- | documentation | [on RDoc.info][documentation] |
23
- | Spread ~♡ⓛⓞⓥⓔ♡~ | [🌍 🌎 🌏](https://about.me/peter.boling), [🍚](https://www.crowdrise.com/helprefugeeswithhopefortomorrowliberia/fundraiser/peterboling), [➕](https://plus.google.com/+PeterBoling/posts), [👼](https://angel.co/peter-boling), [🐛](https://www.topcoder.com/members/pboling/), [:shipit:](http://coderwall.com/pboling), [![Tweet Peter](https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow)](http://twitter.com/galtzo) |
9
+ | Project | SilentStream |
10
+ |------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
11
+ | gem name | [silent_stream](https://rubygems.org/gems/silent_stream) |
12
+ | compatibility | Ruby 2.3, 2.4, 2.5, 2.6, 2.7, 3.0, 3.1, 3.2, 3.3 |
13
+ | license | [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) |
14
+ | download rank | [![Downloads Today](https://img.shields.io/gem/rd/silent_stream.svg)](https://github.com/pboling/silent_stream) |
15
+ | version | [![Version](https://img.shields.io/gem/v/silent_stream.svg)](https://rubygems.org/gems/silent_stream) |
16
+ | continuous integration | [![Build Status](https://travis-ci.org/pboling/silent_stream.svg?branch=master)](https://travis-ci.org/pboling/silent_stream) |
17
+ | test coverage | [![Test Coverage](https://api.codeclimate.com/v1/badges/ced7e39984dd9c27c528/test_coverage)](https://codeclimate.com/github/pboling/silent_stream/test_coverage) |
18
+ | maintainability | [![Maintainability](https://api.codeclimate.com/v1/badges/ced7e39984dd9c27c528/maintainability)](https://codeclimate.com/github/pboling/silent_stream/maintainability) |
19
+ | dependencies | [![Depfu](https://badges.depfu.com/badges/6633827ecc1ad3b5dd749b4ac822347b/count.svg)](https://depfu.com/github/pboling/silent_stream?project_id=5828) |
20
+ | code triage | [![Open Source Helpers](https://www.codetriage.com/pboling/silent_stream/badges/users.svg)](https://www.codetriage.com/pboling/silent_stream) |
21
+ | homepage | [on Github.com][homepage], [on Railsbling.com][blogpage] |
22
+ | documentation | [on RDoc.info][documentation] |
23
+ | Spread ~♡ⓛⓞⓥⓔ♡~ | [🌏](https://about.me/peter.boling), [👼](https://angel.co/peter-boling), [![Tweet Peter](https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow)](http://twitter.com/galtzo) |
24
+
24
25
 
25
26
  ## NOTE
26
27
 
@@ -35,7 +36,7 @@ The reason for not keeping `silence` as it was in Rails 4, i.e. an alias of `cap
35
36
  Add this line to your application's Gemfile:
36
37
 
37
38
  ```ruby
38
- gem 'silent_stream'
39
+ gem "silent_stream"
39
40
  ```
40
41
 
41
42
  And then execute:
@@ -79,14 +80,14 @@ class Bogosity
79
80
  def silent
80
81
  silence_all(true) do
81
82
  puts "play that funky music"
82
- Rails.logger.info "git jiggy with it"
83
+ Rails.logger.info("git jiggy with it")
83
84
  end
84
85
  end
85
86
  class << self
86
87
  def noise
87
88
  silence_all(false) do
88
89
  puts "play that funky music"
89
- Rails.logger.info "git jiggy with it"
90
+ Rails.logger.info("git jiggy with it")
90
91
  end
91
92
  end
92
93
  end
@@ -108,23 +109,45 @@ play that funky music
108
109
  Make the methods avaialble:
109
110
  ```
110
111
  RSpec.configure do |conf|
111
- conf.include SilentStream
112
+ conf.include(SilentStream)
112
113
  end
113
114
  ```
114
115
 
115
116
  Then add a test on output:
116
117
  ```
117
- it 'has output' do
118
- output = capture(:stdout) { subject.request(:get, '/success') }
118
+ it "has output" do
119
+ output = capture(:stdout) { subject.request(:get, "/success") }
119
120
  logs = [
120
- 'INFO -- request: GET https://api.example.com/success',
121
- 'INFO -- response: Status 200'
121
+ "INFO -- request: GET https://api.example.com/success",
122
+ "INFO -- response: Status 200",
122
123
  ]
123
- expect(output).to include(*logs)
124
+ expect(output).to(include(*logs))
124
125
  end
125
126
  ```
126
127
 
127
- See it in practice in the [specs for the oauth2 gem](https://github.com/oauth-xx/oauth2/blob/master/spec/oauth2/client_spec.rb#L193)
128
+ See it in practice in the specs for the [oauth2 gem](https://github.com/oauth-xx/oauth2/blob/master/spec/oauth2/client_spec.rb#L193) and the [debug_logging gem](https://github.com/pboling/debug_logging/blob/master/spec/debug_logging/instance_logger_spec.rb#L10)
129
+
130
+ ## Migrate from ActiveSupport::Testing::Stream, or remove ActiveSupport completely, in your ruby library!
131
+
132
+ For most scenarios, simple. Change three lines. Here's an example from a gem I just converted from ActiveSupport to SilentStream ([see commit](https://github.com/pboling/debug_logging/commit/d0cd109e1509084bbcf753be39f2173f0e2878a7))
133
+
134
+ `gemspec` diff:
135
+ ```
136
+ -spec.add_development_dependency 'activesupport', '>= 5'
137
+ +spec.add_development_dependency 'silent_stream', '>= 1'
138
+ ```
139
+
140
+ `spec_helper.rb` diff:
141
+ ```
142
+ -require 'active_support/testing/stream'
143
+ +require 'silent_stream'
144
+
145
+ RSpec.configure do |config|
146
+ - config.include ActiveSupport::Testing::Stream
147
+ + config.include SilentStream
148
+ ```
149
+
150
+ Run spec suite to verify everything is good. This gem is as close as can be to a drop-in replacement for Rails' `ActiveSupport::Testing::Stream`.
128
151
 
129
152
  ## Development
130
153
 
@@ -155,12 +178,12 @@ dependency on this gem using the [Pessimistic Version Constraint][pvc] with two
155
178
  For example:
156
179
 
157
180
  ```ruby
158
- spec.add_dependency 'silent_stream', '~> 1.0'
181
+ spec.add_dependency("silent_stream", "~> 1.0")
159
182
  ```
160
183
 
161
184
  ## License
162
185
 
163
- * Copyright (c) 2018 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
186
+ * Copyright (c) 2018, 2024 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
164
187
 
165
188
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
166
189
 
data/Rakefile CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rake/testtask'
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
5
 
6
6
  Rake::TestTask.new do |t|
7
- t.test_files = FileList['tests/**/test_*.rb']
7
+ t.test_files = FileList["tests/**/test_*.rb"]
8
8
  end
9
- desc 'Run tests'
9
+ desc "Run tests"
10
10
 
11
11
  task default: :test
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'silent_stream'
4
+ require "bundler/setup"
5
+ require "silent_stream"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'silent_stream'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file was generated by Appraisal
2
4
 
3
5
  source "https://rubygems.org"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SilentStream
4
- VERSION = '1.0.6'
4
+ VERSION = "1.0.7"
5
5
  end
data/lib/silent_stream.rb CHANGED
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'silent_stream/version'
3
+ require "silent_stream/version"
4
4
 
5
- require 'tempfile'
6
- require 'logger'
5
+ require "tempfile"
6
+ require "logger"
7
7
 
8
8
  module SilentStream
9
9
  def self.included(base)
@@ -22,7 +22,7 @@ module SilentStream
22
22
  # so you can use it without changing code structure.
23
23
  #
24
24
  # This method is not thread-safe.
25
- def silence_all(switch = true, temporary_level = Logger::ERROR, logger = nil)
25
+ def silence_all(switch = true, temporary_level = Logger::ERROR, logger = nil, &block)
26
26
  if !switch || silent_stream_no_silence
27
27
  yield
28
28
  else
@@ -30,9 +30,7 @@ module SilentStream
30
30
  logger ||= silent_stream_logger
31
31
  old_logger_level = silent_stream_reset_logger_level(logger, temporary_level)
32
32
  # silence STDOUT (like puts)
33
- silence_stream(STDOUT) do
34
- yield
35
- end
33
+ silence_stream(STDOUT, &block)
36
34
  ensure
37
35
  silent_stream_reset_logger_level(logger, old_logger_level)
38
36
  end
@@ -42,11 +40,11 @@ module SilentStream
42
40
  private
43
41
 
44
42
  def silent_stream_no_silence
45
- ENV['NO_SILENCE'] == 'true'
43
+ ENV["NO_SILENCE"] == "true"
46
44
  end
47
45
 
48
46
  def silent_stream_logger
49
- defined?(Rails) ? Rails.logger : nil
47
+ (defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger) ? Rails.logger : nil
50
48
  end
51
49
 
52
50
  # returns previous logger's level
@@ -59,11 +57,15 @@ module SilentStream
59
57
  # Extracted from:
60
58
  # https://github.com/rails/rails/blob/4-2-stable/activesupport/lib/active_support/core_ext/kernel/reporting.rb
61
59
  module Extracted
62
- SILENT_STREAM_NULL_DEVICE = defined?(IO::NULL) ? IO::NULL : Gem.win_platform? ? 'NUL:' : '/dev/null'
60
+ SILENT_STREAM_NULL_DEVICE = if defined?(IO::NULL)
61
+ IO::NULL
62
+ else
63
+ Gem.win_platform? ? "NUL:" : "/dev/null"
64
+ end
63
65
 
64
66
  # This method is not thread-safe.
65
- def silence_stderr
66
- silence_stream(STDERR) { yield }
67
+ def silence_stderr(&block)
68
+ silence_stream(STDERR, &block)
67
69
  end
68
70
 
69
71
  # Silences any stream for the duration of the block.
@@ -78,7 +80,7 @@ module SilentStream
78
80
  def silence_stream(stream)
79
81
  old_stream = stream.dup
80
82
  begin
81
- stream.reopen(SILENT_STREAM_NULL_DEVICE, 'a+')
83
+ stream.reopen(SILENT_STREAM_NULL_DEVICE, "a+")
82
84
  rescue Exception => e
83
85
  stream.puts "[SilentStream] Unable to silence. #{e.class}: #{e.message}"
84
86
  end
@@ -131,25 +133,23 @@ module SilentStream
131
133
  # quietly { system 'bundle install' }
132
134
  #
133
135
  # This method is not thread-safe.
134
- def quietly
136
+ def quietly(&block)
135
137
  silence_stream(STDOUT) do
136
- silence_stream(STDERR) do
137
- yield
138
- end
138
+ silence_stream(STDERR, &block)
139
139
  end
140
140
  end
141
141
 
142
142
  private
143
143
 
144
144
  SILENT_STREAM_WINDOWS_REGEXP = /mswin|mingw/.freeze
145
- SILENT_STREAM_REGEXP_HAS_MATCH = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.4')
145
+ SILENT_STREAM_REGEXP_HAS_MATCH = Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.4")
146
146
  def windows_os_test
147
147
  # When available, in Ruby 2.4+, we use Regexp#match? which does not update
148
148
  # the $~ global object and may be 3x faster than alternative match tests
149
149
  if SILENT_STREAM_REGEXP_HAS_MATCH
150
- SILENT_STREAM_WINDOWS_REGEXP.match?(RbConfig::CONFIG['host_os'])
150
+ SILENT_STREAM_WINDOWS_REGEXP.match?(RbConfig::CONFIG["host_os"])
151
151
  else
152
- SILENT_STREAM_WINDOWS_REGEXP =~ (RbConfig::CONFIG['host_os'])
152
+ SILENT_STREAM_WINDOWS_REGEXP =~ (RbConfig::CONFIG["host_os"])
153
153
  end
154
154
  end
155
155
  end
@@ -1,67 +1,83 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'silent_stream/version'
5
+ require "silent_stream/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  authors = [
9
9
  # Everyone who touched the files extracted from Rails:
10
- ['jeremy', 'Jeremy Daer'],
11
- ['dhh', 'David Heinemeier Hansson'],
12
- ['pixeltrix', 'Andrew White'],
13
- ['spastorino', 'Santiago Pastorino'],
14
- ['sstephenson', 'Sam Stephenson'],
15
- ['amatsuda', 'Akira Matsuda'],
16
- ['Raphomet', 'Raphael Lee'],
17
- ['rafaelfranca', 'Rafael França'],
18
- ['mariovisic', 'Mario Visic'],
19
- ['krekoten', "Мар'ян Крекотень"],
20
- ['lest', 'Sergey Nartimov'],
21
- ['joshk', 'Josh Kalderimis'],
22
- ['fxn', 'Xavier Noria'],
23
- ['deivid-rodriguez', 'David Rodríguez'],
24
- ['route', 'Dmitry Vorotilin'],
25
- ['tenderlove', 'Aaron Patterson'],
26
- ['guilleiguaran', 'Guillermo Iguaran'],
27
- ['gazay', 'Alexey Gaziev'],
28
- ['wycats', 'Yehuda Katz'],
29
- ['tommeier', 'Tom Meier'],
30
- ['lifo', 'Pratik Naik'],
31
- ['charliesome', 'Charlie Somerville'],
32
- ['atambo', 'Alex Tambellini'],
33
- ['arthurnn', 'Arthur Nogueira Neves'],
34
- ['anildigital', 'Anil Wadghule'],
10
+ ["jeremy", "Jeremy Daer"],
11
+ ["dhh", "David Heinemeier Hansson"],
12
+ ["pixeltrix", "Andrew White"],
13
+ ["spastorino", "Santiago Pastorino"],
14
+ ["sstephenson", "Sam Stephenson"],
15
+ ["amatsuda", "Akira Matsuda"],
16
+ ["Raphomet", "Raphael Lee"],
17
+ ["rafaelfranca", "Rafael França"],
18
+ ["mariovisic", "Mario Visic"],
19
+ ["krekoten", "Мар'ян Крекотень"],
20
+ ["lest", "Sergey Nartimov"],
21
+ ["joshk", "Josh Kalderimis"],
22
+ ["fxn", "Xavier Noria"],
23
+ ["deivid-rodriguez", "David Rodríguez"],
24
+ ["route", "Dmitry Vorotilin"],
25
+ ["tenderlove", "Aaron Patterson"],
26
+ ["guilleiguaran", "Guillermo Iguaran"],
27
+ ["gazay", "Alexey Gaziev"],
28
+ ["wycats", "Yehuda Katz"],
29
+ ["tommeier", "Tom Meier"],
30
+ ["lifo", "Pratik Naik"],
31
+ ["charliesome", "Charlie Somerville"],
32
+ ["atambo", "Alex Tambellini"],
33
+ ["arthurnn", "Arthur Nogueira Neves"],
34
+ ["anildigital", "Anil Wadghule"],
35
35
  # Author/Maintainer of this gem:
36
- ['pboling', 'Peter Boling']
36
+ ["pboling", "Peter Boling"],
37
37
  ]
38
38
 
39
- spec.name = 'silent_stream'
40
- spec.version = SilentStream::VERSION
41
- spec.authors = authors.map { |_gh, name| name }
42
- spec.email = ['peter.boling@gmail.com']
39
+ spec.name = "silent_stream"
40
+ spec.version = SilentStream::VERSION
41
+ spec.authors = authors.map { |_gh, name| name }
42
+ spec.email = ["peter.boling@gmail.com"]
43
+ spec.required_ruby_version = ">= 2.3"
43
44
 
44
- spec.summary = "ActiveSupport's Stream Silencing - Without ActiveSupport"
45
- spec.description = 'ActiveSupport Kernel Reporting Detritus with a few enhancements'
46
- spec.homepage = 'https://github.com/pboling/silent_stream'
45
+ spec.summary = "ActiveSupport's Stream Silencing - Without ActiveSupport"
46
+ spec.description = "ActiveSupport Kernel Reporting Detritus with a few enhancements"
47
+ spec.homepage = "https://github.com/pboling/#{spec.name}"
48
+ spec.metadata["homepage_uri"] = spec.homepage
49
+ spec.metadata["source_code_uri"] = "#{spec.homepage}/tree/v#{spec.version}"
50
+ # spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/v#{spec.version}/CHANGELOG.md"
51
+ spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
52
+ spec.metadata["documentation_uri"] = "https://www.rubydoc.info/gems/#{spec.name}/#{spec.version}"
53
+ spec.metadata["wiki_uri"] = "#{spec.homepage}/wiki"
54
+ spec.metadata["funding_uri"] = "https://liberapay.com/pboling"
55
+ spec.metadata["news_uri"] = "https://www.railsbling.com/tags/#{spec.name}"
56
+ spec.metadata["rubygems_mfa_required"] = "true"
47
57
 
48
58
  # Specify which files should be added to the gem when it is released.
49
59
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
50
60
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
51
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(tests|spec|features)/}) }
61
+ %x(git ls-files -z).split("\x0").reject { |f| f.match(%r{^(tests|spec|features)/}) }
52
62
  end
53
- spec.bindir = 'exe'
54
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
55
- spec.require_paths = ['lib']
56
- spec.license = 'MIT'
63
+ spec.bindir = "exe"
64
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
65
+ spec.require_paths = ["lib"]
66
+ spec.license = "MIT"
57
67
 
58
- spec.add_development_dependency 'rake'
59
- spec.add_development_dependency 'appraisal'
60
- spec.add_development_dependency 'bundler'
61
- spec.add_development_dependency 'minitest', '>= 5.10'
62
- spec.add_development_dependency 'minitest-reporters'
63
- spec.add_development_dependency 'mocha'
64
- spec.add_development_dependency 'simplecov', '>= 0.16'
65
- spec.add_development_dependency 'test-unit', '>= 3.2'
66
- spec.add_development_dependency 'wwtd'
68
+ spec.add_development_dependency("appraisal")
69
+ spec.add_development_dependency("bundler")
70
+ spec.add_development_dependency("minitest", ">= 5.22")
71
+ spec.add_development_dependency("minitest-reporters")
72
+ spec.add_development_dependency("mocha")
73
+ spec.add_development_dependency("rake")
74
+ spec.add_development_dependency("simplecov", ">= 0.16")
75
+ spec.add_development_dependency("test-unit", ">= 3.2")
76
+ spec.add_development_dependency("wwtd")
77
+
78
+ # Linting
79
+ spec.add_dependency("rubocop-gradual", ">= 0.3.4")
80
+ spec.add_dependency("rubocop-lts", "~> 10.1", ">= 10.1.1") # Lint & Style Support for Ruby 2.3+
81
+ spec.add_dependency("rubocop-rspec", "~> 2.26", ">= 2.26.1")
82
+ spec.add_dependency("standard", "~> 1.33")
67
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silent_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Daer
@@ -30,13 +30,13 @@ authors:
30
30
  - Arthur Nogueira Neves
31
31
  - Anil Wadghule
32
32
  - Peter Boling
33
- autorequire:
33
+ autorequire:
34
34
  bindir: exe
35
35
  cert_chain: []
36
- date: 2020-02-25 00:00:00.000000000 Z
36
+ date: 2024-03-20 00:00:00.000000000 Z
37
37
  dependencies:
38
38
  - !ruby/object:Gem::Dependency
39
- name: rake
39
+ name: appraisal
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
@@ -50,7 +50,7 @@ dependencies:
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  - !ruby/object:Gem::Dependency
53
- name: appraisal
53
+ name: bundler
54
54
  requirement: !ruby/object:Gem::Requirement
55
55
  requirements:
56
56
  - - ">="
@@ -64,35 +64,35 @@ dependencies:
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  - !ruby/object:Gem::Dependency
67
- name: bundler
67
+ name: minitest
68
68
  requirement: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: '0'
72
+ version: '5.22'
73
73
  type: :development
74
74
  prerelease: false
75
75
  version_requirements: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - ">="
78
78
  - !ruby/object:Gem::Version
79
- version: '0'
79
+ version: '5.22'
80
80
  - !ruby/object:Gem::Dependency
81
- name: minitest
81
+ name: minitest-reporters
82
82
  requirement: !ruby/object:Gem::Requirement
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: '5.10'
86
+ version: '0'
87
87
  type: :development
88
88
  prerelease: false
89
89
  version_requirements: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
- version: '5.10'
93
+ version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- name: minitest-reporters
95
+ name: mocha
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - ">="
@@ -106,7 +106,7 @@ dependencies:
106
106
  - !ruby/object:Gem::Version
107
107
  version: '0'
108
108
  - !ruby/object:Gem::Dependency
109
- name: mocha
109
+ name: rake
110
110
  requirement: !ruby/object:Gem::Requirement
111
111
  requirements:
112
112
  - - ">="
@@ -161,6 +161,74 @@ dependencies:
161
161
  - - ">="
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
+ - !ruby/object:Gem::Dependency
165
+ name: rubocop-gradual
166
+ requirement: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: 0.3.4
171
+ type: :runtime
172
+ prerelease: false
173
+ version_requirements: !ruby/object:Gem::Requirement
174
+ requirements:
175
+ - - ">="
176
+ - !ruby/object:Gem::Version
177
+ version: 0.3.4
178
+ - !ruby/object:Gem::Dependency
179
+ name: rubocop-lts
180
+ requirement: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - "~>"
183
+ - !ruby/object:Gem::Version
184
+ version: '10.1'
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: 10.1.1
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '10.1'
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ version: 10.1.1
198
+ - !ruby/object:Gem::Dependency
199
+ name: rubocop-rspec
200
+ requirement: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: '2.26'
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: 2.26.1
208
+ type: :runtime
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: '2.26'
215
+ - - ">="
216
+ - !ruby/object:Gem::Version
217
+ version: 2.26.1
218
+ - !ruby/object:Gem::Dependency
219
+ name: standard
220
+ requirement: !ruby/object:Gem::Requirement
221
+ requirements:
222
+ - - "~>"
223
+ - !ruby/object:Gem::Version
224
+ version: '1.33'
225
+ type: :runtime
226
+ prerelease: false
227
+ version_requirements: !ruby/object:Gem::Requirement
228
+ requirements:
229
+ - - "~>"
230
+ - !ruby/object:Gem::Version
231
+ version: '1.33'
164
232
  description: ActiveSupport Kernel Reporting Detritus with a few enhancements
165
233
  email:
166
234
  - peter.boling@gmail.com
@@ -170,7 +238,8 @@ extra_rdoc_files: []
170
238
  files:
171
239
  - ".gitignore"
172
240
  - ".rubocop.yml"
173
- - ".ruby-version"
241
+ - ".rubocop_gradual.lock"
242
+ - ".tool-versions"
174
243
  - ".travis.yml"
175
244
  - Appraisals
176
245
  - CODE_OF_CONDUCT.md
@@ -191,8 +260,16 @@ files:
191
260
  homepage: https://github.com/pboling/silent_stream
192
261
  licenses:
193
262
  - MIT
194
- metadata: {}
195
- post_install_message:
263
+ metadata:
264
+ homepage_uri: https://github.com/pboling/silent_stream
265
+ source_code_uri: https://github.com/pboling/silent_stream/tree/v1.0.7
266
+ bug_tracker_uri: https://github.com/pboling/silent_stream/issues
267
+ documentation_uri: https://www.rubydoc.info/gems/silent_stream/1.0.7
268
+ wiki_uri: https://github.com/pboling/silent_stream/wiki
269
+ funding_uri: https://liberapay.com/pboling
270
+ news_uri: https://www.railsbling.com/tags/silent_stream
271
+ rubygems_mfa_required: 'true'
272
+ post_install_message:
196
273
  rdoc_options: []
197
274
  require_paths:
198
275
  - lib
@@ -200,15 +277,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
277
  requirements:
201
278
  - - ">="
202
279
  - !ruby/object:Gem::Version
203
- version: '0'
280
+ version: '2.3'
204
281
  required_rubygems_version: !ruby/object:Gem::Requirement
205
282
  requirements:
206
283
  - - ">="
207
284
  - !ruby/object:Gem::Version
208
285
  version: '0'
209
286
  requirements: []
210
- rubygems_version: 3.1.2
211
- signing_key:
287
+ rubygems_version: 3.5.6
288
+ signing_key:
212
289
  specification_version: 4
213
290
  summary: ActiveSupport's Stream Silencing - Without ActiveSupport
214
291
  test_files: []
data/.ruby-version DELETED
@@ -1 +0,0 @@
1
- 2.7.0