Skip to content

Commit

Permalink
Gemwork update v0.5.0: New Rubocop cops added
Browse files Browse the repository at this point in the history
Fix up new offenses after adding new Rubocop cops.

Update all gems.
  • Loading branch information
pdobb committed Mar 22, 2024
1 parent bd19399 commit 85de294
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require:
- rubocop-performance

inherit_gem:
gemwork: lib/rubocop/.rubocop.yml
gemwork: lib/rubocop/.rubocop-gems.yml

AllCops:
TargetRubyVersion: 2.7
95 changes: 63 additions & 32 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,44 @@ PATH
GEM
remote: https://rubygems.org/
specs:
amazing_print (1.5.0)
amazing_print (1.6.0)
ansi (1.5.0)
ast (2.4.2)
bigdecimal (3.1.7)
builder (3.2.4)
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
concurrent-ruby (1.2.3)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
gemwork (0.3.0)
dry-configurable (1.1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-core (1.0.1)
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-schema (1.13.3)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
zeitwerk (~> 2.6)
dry-types (1.7.2)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
dry-inflector (~> 1.0)
dry-logic (~> 1.4)
zeitwerk (~> 2.6)
gemwork (0.5.0)
debug
irb
minitest
Expand All @@ -27,57 +56,58 @@ GEM
rubocop-rake
simplecov
yard
io-console (0.6.0)
irb (1.9.1)
io-console (0.7.2)
irb (1.12.0)
rdoc
reline (>= 0.3.8)
json (2.6.3)
kwalify (0.7.2)
reline (>= 0.4.2)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
minitest (5.22.3)
minitest-reporters (1.6.1)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
much-stub (0.1.10)
parallel (1.23.0)
parser (3.2.2.4)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (5.1.1.1)
psych (5.1.2)
stringio
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.0)
rdoc (6.6.3.1)
psych (>= 4.0.0)
reek (6.1.4)
kwalify (~> 0.7.0)
parser (~> 3.2.0)
reek (6.3.0)
dry-schema (~> 1.13.0)
parser (~> 3.3.0)
rainbow (>= 2.0, < 4.0)
regexp_parser (2.8.2)
reline (0.4.0)
rexml (~> 3.1)
regexp_parser (2.9.0)
reline (0.4.3)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.57.2)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-minitest (0.33.0)
rubocop (>= 1.39, < 2.0)
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-minitest (0.35.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-progressbar (1.13.0)
Expand All @@ -87,10 +117,11 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
stringio (3.0.9)
stringio (3.1.0)
timecop (0.9.8)
unicode-display_width (2.5.0)
yard (0.9.34)
yard (0.9.36)
zeitwerk (2.6.13)

PLATFORMS
arm64-darwin-22
Expand Down
2 changes: 1 addition & 1 deletion lib/say/generators/banner_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Say::BannerGenerator
def self.call(text, columns:, justify:)
interpolation_template = build_interpolation_template(text)
interpolation_template.public_send(
"#{justify}_justify", text, length: columns)
:"#{justify}_justify", text, length: columns)
end

def self.build_interpolation_template(text)
Expand Down
2 changes: 1 addition & 1 deletion lib/say/time.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

# Say::Time assists with outputting Timestamps.
class Say::Time
module Say::Time
# The default {.timestamp} format name, if none is provided.
DEFAULT_TIMESTAMP_FORMAT_NAME = :web_service

Expand Down
3 changes: 2 additions & 1 deletion rakelib/bump.rake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ module RubyVersions

def self.latest_supported_patches
@latest_supported_patches ||= begin
patches = versions.fetch_values(*VERSION_TYPES).compact.flatten
patches =
versions.fetch_values(*VERSION_TYPES).tap(&:flatten!).tap(&:compact!)
patches.map { |patch| Gem::Version.new(patch) }.sort!.map(&:to_s)
end
end
Expand Down
17 changes: 15 additions & 2 deletions rakelib/gemwork.rake
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# frozen_string_literal: true

spec = Gem::Specification.find_by_name("gemwork")

# Load additional tasks defined by Gemwork.
Gem::Specification.find_by_name("gemwork").tap do |gemspec|
Rake.load_rakefile("#{gemspec.gem_dir}/lib/tasks/Rakefile")
Dir.glob(
Pathname.new(spec.gem_dir).
join("lib", "tasks", "{util,rubocop,reek,test}.rake")) do |task|
load(task)
end

# Redefine the default `rake` task.
task :default do
run_tasks(%i[
test
rubocop
reek
])
end
14 changes: 7 additions & 7 deletions test/say/say_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class SayTest < Minitest::Spec
"= Done ========================================================================="
# rubocop:enable Layout/LineLength
value(subject.footer).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
[expected_result, "\n"])
end

Expand All @@ -250,7 +250,7 @@ class SayTest < Minitest::Spec
"= TEST ========================================================================="
# rubocop:enable Layout/LineLength
value(subject.footer("TEST")).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
[expected_result, "\n"])
end

Expand All @@ -261,7 +261,7 @@ class SayTest < Minitest::Spec
"= TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT ="
# rubocop:enable Layout/LineLength
value(subject.footer("T" * 90)).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
[expected_result, "\n"])
end
end
Expand Down Expand Up @@ -328,7 +328,7 @@ class SayTest < Minitest::Spec
]
# rubocop:enable Layout/LineLength
value(subject.section).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
expected_result + ["\n"])
end

Expand All @@ -341,7 +341,7 @@ class SayTest < Minitest::Spec
]
# rubocop:enable Layout/LineLength
value(subject.section("")).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
expected_result + ["\n"])
end

Expand All @@ -354,7 +354,7 @@ class SayTest < Minitest::Spec
]
# rubocop:enable Layout/LineLength
value(subject.section("TEST")).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
expected_result + ["\n"])
end

Expand All @@ -367,7 +367,7 @@ class SayTest < Minitest::Spec
]
# rubocop:enable Layout/LineLength
value(subject.section("T" * 90)).must_equal(expected_result)
value(@puts_calls.map(&:args).flatten).must_equal(
value(@puts_calls.map(&:args).tap(&:flatten!)).must_equal(
expected_result + ["\n"])
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

require "minitest/autorun"

require "gemwork/test/support/reporters"
require "gemwork/test/support/much_stub"
require "gemwork/test/support/reporters"
require "gemwork/test/support/spec_dsl"

require "timecop"

0 comments on commit 85de294

Please sign in to comment.