Skip to content

Commit

Permalink
Remove railties dependency and replace with actionview dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
westonganger committed May 27, 2021
1 parent 8dee2ac commit 9469566
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changelog

* `Unreleased` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.1...master)
- Nothing yet
- Remove dependency on `railsties` and instead only depend on `actionview`

* `v1.4.1` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.4.0...v1.4.1)
- [7575606](https://github.com/cortiz/prawn-rails/commit/7575606) - Fix bug in v1.4.0, where PDF's wouldnt open as `inline` within the browser. Problem was due to incomplete switch to Railsties from [PR #41](https://github.com/cortiz/prawn-rails/pull/41)
- [7575606](https://github.com/cortiz/prawn-rails/commit/7575606) - Complete switch to Railsties from [PR #41](https://github.com/cortiz/prawn-rails/pull/41)

* `v1.4.0` - [View Diff](https://github.com/cortiz/prawn-rails/compare/v1.3.0...v1.4.0)
- [PR #41](https://github.com/cortiz/prawn-rails/pull/41) - Depend on `railsties` instead of `rails` gem to avoid pulling in unnecessary dependencies such as action_cable, etc.
Expand Down
13 changes: 12 additions & 1 deletion lib/prawn-rails.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
require "prawn"

require "prawn-rails/version"
require "prawn-rails/config"
require "prawn-rails/railtie"

require "prawn-rails/rails_helper"
require "prawn-rails/renderer"

ActionView::Base.send(:include, PrawnRails::RailsHelper)
ActionView::Template.register_template_handler(:prawn, PrawnRails::Renderer)

unless Mime::Type.lookup_by_extension(:pdf)
Mime::Type.register_alias("application/pdf", :pdf)
end

module PrawnRails
end
2 changes: 1 addition & 1 deletion lib/prawn-rails/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def prawn_document(options={})

yield pdf if block_given?

pdf.render
return pdf.render
end

def get_metadata
Expand Down
14 changes: 0 additions & 14 deletions lib/prawn-rails/railtie.rb

This file was deleted.

2 changes: 1 addition & 1 deletion prawn-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|

s.add_dependency "prawn"
s.add_dependency "prawn-table"
s.add_dependency "railties", ">= 3.1.0"
s.add_dependency "actionview", ">= 3.1.0"

s.add_development_dependency "pdf-reader"
s.add_development_dependency 'rake'
Expand Down

0 comments on commit 9469566

Please sign in to comment.