From c9fa9f62460efbffd6fbf3379fecd68448831a79 Mon Sep 17 00:00:00 2001 From: Pierre Neyron Date: Sun, 4 May 2025 13:01:18 +0200 Subject: [PATCH 1/2] Let ruby-progressbar and progressbar gems allow requiring progressbar.rb or ruby-progessbar.rb Having the 2 gems with quite the same content but not exactly is very confusing, for instance on Debian because the ruby-progressbar deb package actually contains the progressbar gem, not the ruby-progressbar gem. IMHO, having both gems with the exact same content would be more user-friendly, allowing 'require "progressbar"' and 'require "ruby-progressbar"' indifferently from what gem is actually installed (be it with gem install or a distrubution package). --- progressbar.gemspec | 2 +- ruby-progressbar.gemspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/progressbar.gemspec b/progressbar.gemspec index c8fee06..10f1ad6 100644 --- a/progressbar.gemspec +++ b/progressbar.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.signing_key = File.expand_path('~/.gem/certs/jfelchner-private_key.pem') if $0 =~ /gem\z/ spec.executables = [] - spec.files = Dir['{app,config,db,lib/ruby-progressbar}/**/*'] + %w{lib/progressbar.rb Rakefile README.md LICENSE.txt} + spec.files = Dir['{app,config,db,lib/ruby-progressbar}/**/*'] + %w{lib/progressbar.rb lib/ruby-progressbar.rb Rakefile README.md LICENSE.txt} spec.metadata = { 'bug_tracker_uri' => 'https://github.com/jfelchner/ruby-progressbar/issues', diff --git a/ruby-progressbar.gemspec b/ruby-progressbar.gemspec index 5a2fd4a..5a08fc7 100644 --- a/ruby-progressbar.gemspec +++ b/ruby-progressbar.gemspec @@ -17,7 +17,7 @@ Gem::Specification.new do |spec| spec.signing_key = File.expand_path('~/.gem/certs/jfelchner-private_key.pem') if $0 =~ /gem\z/ spec.executables = [] - spec.files = Dir['{app,config,db,lib/ruby-progressbar}/**/*'] + %w{lib/ruby-progressbar.rb Rakefile README.md LICENSE.txt} + spec.files = Dir['{app,config,db,lib/ruby-progressbar}/**/*'] + %w{lib/progressbar.rb lib/ruby-progressbar.rb Rakefile README.md LICENSE.txt} spec.metadata = { 'bug_tracker_uri' => 'https://github.com/jfelchner/ruby-progressbar/issues', From 13690ea523fa1dbebe9ebf5be3a2a9250b38094f Mon Sep 17 00:00:00 2001 From: Pierre Neyron Date: Sun, 4 May 2025 13:03:21 +0200 Subject: [PATCH 2/2] Make lib/progressbar.rb a symlink to lib/ruby-progressbar.rb (same content) It's the same content. Removes the duplication of code. Avoid possible divergence. --- lib/progressbar.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) mode change 100644 => 120000 lib/progressbar.rb diff --git a/lib/progressbar.rb b/lib/progressbar.rb deleted file mode 100644 index 08f3792..0000000 --- a/lib/progressbar.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -require 'ruby-progressbar/base' -require 'ruby-progressbar/refinements' if Module. - private_instance_methods. - include?(:using) - -class ProgressBar - def self.create(*args) - ProgressBar::Base.new(*args) - end -end diff --git a/lib/progressbar.rb b/lib/progressbar.rb new file mode 120000 index 0000000..8b6c57d --- /dev/null +++ b/lib/progressbar.rb @@ -0,0 +1 @@ +ruby-progressbar.rb \ No newline at end of file