From 464cc22f22800cb6de4982a964a79909a9895e60 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Mon, 24 Feb 2014 09:39:31 +0100 Subject: [PATCH] split tilt-pdf-rails out of tilt-pdf --- Gemfile.lock | 2 +- README.mdown | 17 ++++------------- lib/tilt/pdf/rails.rb | 24 ------------------------ lib/tilt/pdf/version.rb | 2 +- 4 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 lib/tilt/pdf/rails.rb diff --git a/Gemfile.lock b/Gemfile.lock index 05cac46..73cab17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - tilt-pdf (0.1.2) + tilt-pdf (0.10.0) pdfkit (~> 0.5.4) tilt (~> 1.4.1) diff --git a/README.mdown b/README.mdown index 244dabf..9c2370a 100644 --- a/README.mdown +++ b/README.mdown @@ -29,8 +29,8 @@ A `foo` template is currently threefold: document. - `foo.css`: this stylesheet can be written in any template language you need (such as Sass or Less), and the Tilt template resolution system via extension - chaining will apply. Tilt will *not* pass the block to be yielded to this - template. + chaining will apply. Tilt will pass the block to be yielded to this + template, so you'd rather not `yield` if you fancy using `.css.erb`. The three files must currently be stored in the *same* directory. @@ -84,14 +84,5 @@ as based from the rpdf file. ## Rails and ActionView integration -Require `tilt/pdf/rails` if you want to set up and register `tilt-pdf` as an -ActionView template handler. You can do it in an initializer, or straight from -the Gemfile: - -```ruby -gem 'tilt-pdf', require: 'tilt/pdf/rails' -``` - -Put your three template files *together* in the relevant `app/views/foo` view -directory, or use absolute paths using application/engine root. Work is in -progress to enable better integration with Rails file layout. +Starting with 0.10, this functionality has been split into its own gem. Use +[Tilt::PDF::Rails](https://github.com/lloeki/tilt-pdf-rails) diff --git a/lib/tilt/pdf/rails.rb b/lib/tilt/pdf/rails.rb deleted file mode 100644 index 3595e95..0000000 --- a/lib/tilt/pdf/rails.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'tilt-pdf' - -module ActionView - class Template - module Handlers - class PDFTemplate - class_attribute :default_format - self.default_format = :pdf - - def call(template) - "Tilt.new('#{template.identifier}').render(self)" - end - end - end - - register_template_handler :rpdf, Handlers::PDFTemplate.new - end -end - -module Tilt::PDFTemplate::Rails - class Railtie < ::Rails::Railtie - config.app_generators.template_engine :rpdf - end -end diff --git a/lib/tilt/pdf/version.rb b/lib/tilt/pdf/version.rb index 05c0a13..d5b8560 100644 --- a/lib/tilt/pdf/version.rb +++ b/lib/tilt/pdf/version.rb @@ -1,5 +1,5 @@ module Tilt module PDF - VERSION = '0.9.0' + VERSION = '0.10.0' end end