Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require any installed prawn extensions #29

Merged
merged 9 commits into from
Jun 6, 2018
9 changes: 6 additions & 3 deletions lib/prawn-rails/document.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'prawn'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-add this require prawn and remove require prawn from the loop.

require 'prawn/table'
require "prawn-rails/extension"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-add require "prawn-rails/extension" after this loop and remove from inside the loop

Gem::Specification.find_all{|s| s.name =~ /prawn/}.map(&:name).each do |gem_name|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the condition for find_all should probably bes.name.start_with?('prawn-')

case gem_name
when 'prawn-rails' then require 'prawn-rails/extension'
else require gem_name.gsub('-', '/')
end
end

module PrawnRails

Expand Down