htdebeer / paru

Control pandoc with Ruby and write pandoc filters in Ruby
https://heerdebeer.org/Software/markdown/paru/
GNU General Public License v3.0
38 stars 12 forks source link

Add csv to Gemfile and gemspec #84

Closed UlyssesZh closed 1 month ago

UlyssesZh commented 2 months ago

/home/ulysses/.local/share/gem/ruby/3.3.0/gems/paru-1.3/lib/paru/filter/table.rb:19: warning: csv was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add csv to your Gemfile or gemspec. Also contact author of paru-1.3 to add csv into its gemspec.

htdebeer commented 2 months ago

Thanks for your report! I'll look into it, but it might take a few weeks because I've got some personal matter to attend to first.

htdebeer commented 1 month ago

Importing CSV library in Gemfile. Change available in paru version 1.3.1.

UlyssesZh commented 1 month ago

The warning still appears in 1.3.1. Actually I can see that you didn't specify the runtime dependencies of the gem in gemspec, which is required. The best practice is to specify all your dependencies in gemspec instead of Gemfile and to only write gemspec in Gemfile. See https://bundler.io/guides/creating_gem.html.

htdebeer commented 1 month ago

Thanks for testing!

As usual, I shouldn't break the golden rule of fixing issues: Reproduce first! I'll fix it somewhere in the coming days and'll apply your suggestion of moving all dependencies into the gemspec.

htdebeer commented 1 month ago

Can you tell me how to reproduce the warning?

I've updated the gemspec / Gemfile to your suggestion, but I haven't been able to verify if it works or not.

htdebeer commented 1 month ago

That change will be available in paru version 1.4.0. I've added it to this repository, but not yet pushed to rubygems because I want to make sure this CSV issue is resolved before I do so.

UlyssesZh commented 1 month ago

To reproduce, run this script:

#!/usr/bin/env ruby
require 'bundler/inline'
gemfile { gem 'paru', '1.3.1', require: 'paru/filter' }

Now to check whether you have fixed the issue, you can first run gem build and gem install paru-1.4.0.gem, and then change the '1.3.1' to '1.4.0' in the reproducing script. I have checked for you and the warning is gone now.

htdebeer commented 1 month ago

Thanks for the reproducible scenario!

I confirmed the warning is gone, and I've uploaded paru version 1.4.0 to rubygems for release