Skip to content

Commit

Permalink
🚨 RuboCop Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling authored and JacobEvelyn committed Sep 18, 2024
1 parent c8d18cf commit 925f598
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion benchmarks/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ gem "gem_bench", "2.0.1"
if RUBY_VERSION > "3"
gem "alt_memery", "2.1.0", require: false
gem "dry-core", "1.0.1"
gem "memoist3", "1.0.0", require: false
gem "memery", "1.6.0"
gem "memoist3", "1.0.0", require: false
else
gem "ddmemoize", "1.0.0"
gem "memoist", "0.16.2"
Expand Down
39 changes: 18 additions & 21 deletions benchmarks/benchmarks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
memoization_method: :memoize,
},
),
].each do |re_namespaced_gem|
re_namespaced_gem.doff_and_don # Copies, re-namespaces, and requires each gem.
end
].each(&:doff_and_don) # Copies, re-namespaces, and requires each gem.

# Here we require memo_wise gem from the `pwd` source.
# Separately, in the Gemfile, we download the main branch of MemoWise from GitHub.
Expand Down Expand Up @@ -116,24 +114,23 @@ def benchmark_name
# using it to minimize the chance that our benchmarks are affected by ordering.
# NOTE: Some gems do not yet work in Ruby 3 so we only test with them if they've
# been `require`d.
BENCHMARK_GEMS =
(re_namespaced_gems.map {|re_namespaced_gem|
BenchmarkGem.new(
re_namespaced_gem.as_klass,
re_namespaced_gem.metadata[:activation_code],
re_namespaced_gem.metadata[:memoization_method],
re_namespaced_gem.gem_name == "memo_wise" ? GITHUB_MAIN_BENCHMARK_NAME : re_namespaced_gem.gem_name,
) if re_namespaced_gem.required?
}.concat(
[
BenchmarkGem.new(MemoWise, "prepend MemoWise", :memo_wise, LOCAL_BENCHMARK_NAME),
(BenchmarkGem.new(DDMemoize, "DDMemoize.activate(self)", :memoize, "ddmemoize") if defined?(DDMemoize)),
(BenchmarkGem.new(Dry::Core, "include Dry::Core::Memoizable", :memoize, "dry-core") if defined?(Dry::Core)),
(BenchmarkGem.new(Memery, "include Memery", :memoize, "memery") if defined?(Memery)),
(BenchmarkGem.new(Memoized, "include Memoized", :memoize, "memoized") if defined?(Memoized)),
(BenchmarkGem.new(Memoizer, "include Memoizer", :memoize, "memoizer") if defined?(Memoizer))
]
)).compact.shuffle
benchmarked_gems = re_namespaced_gems.select(&:required?).map do |re_namespaced_gem|
BenchmarkGem.new(
re_namespaced_gem.as_klass,
re_namespaced_gem.metadata[:activation_code],
re_namespaced_gem.metadata[:memoization_method],
re_namespaced_gem.gem_name == "memo_wise" ? GITHUB_MAIN_BENCHMARK_NAME : re_namespaced_gem.gem_name,
)
end
benchmarked_gems.push(
BenchmarkGem.new(MemoWise, "prepend MemoWise", :memo_wise, LOCAL_BENCHMARK_NAME),
(BenchmarkGem.new(DDMemoize, "DDMemoize.activate(self)", :memoize, "ddmemoize") if defined?(DDMemoize)),
(BenchmarkGem.new(Dry::Core, "include Dry::Core::Memoizable", :memoize, "dry-core") if defined?(Dry::Core)),
(BenchmarkGem.new(Memery, "include Memery", :memoize, "memery") if defined?(Memery)),
(BenchmarkGem.new(Memoized, "include Memoized", :memoize, "memoized") if defined?(Memoized)),
(BenchmarkGem.new(Memoizer, "include Memoizer", :memoize, "memoizer") if defined?(Memoizer))
)
BENCHMARK_GEMS = benchmarked_gems.compact.shuffle

puts "\nWill BENCHMARK_GEMS:\n\t#{BENCHMARK_GEMS.map(&:benchmark_name).join("\n\t")}\n"

Expand Down

0 comments on commit 925f598

Please sign in to comment.