From c6646597a579b9b6faeaa27d1e3493d36d2e1bca Mon Sep 17 00:00:00 2001 From: Jeffrey Lee Date: Thu, 5 Apr 2012 09:37:13 -0500 Subject: [PATCH 1/2] Applying patch from vspan to account for NameTree change in Prawn 0.11.1+ Resolves issue #1: https://github.com/yob/prawn-js/issues/ 1 "Discovered a better solution, here is the javascript method replaced, this will then work with both old (0.8.4) and new (0.11.1+) Prawn." --- lib/prawn/js.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/prawn/js.rb b/lib/prawn/js.rb index 8008692..4828832 100644 --- a/lib/prawn/js.rb +++ b/lib/prawn/js.rb @@ -81,7 +81,11 @@ def aa # See section 3.6.3 and table 3.28 in the PDF spec. # def javascript - names.data[:JavaScript] ||= ref!(Prawn::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT)) + if defined? Prawn::NameTree + names.data[:JavaScript] ||= ref!(Prawn::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT)) + else + names.data[:JavaScript] ||= ref!(Prawn::Core::NameTree::Node.new(self, NAME_TREE_CHILDREN_LIMIT)) + end end end From 39c0217583c335437ac9a1eb60dac50219241632 Mon Sep 17 00:00:00 2001 From: Nick Gorbikoff Date: Thu, 23 May 2013 09:59:51 -0500 Subject: [PATCH 2/2] Updating for new prawn, which merged prawn-core into prawn --- prawn-js.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prawn-js.gemspec b/prawn-js.gemspec index 6352474..bbab882 100644 --- a/prawn-js.gemspec +++ b/prawn-js.gemspec @@ -5,7 +5,7 @@ Gem::Specification.new do |s| s.version = "0.7.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["James Healy"] + s.authors = ["James Healy","Nick Gorbikof"] s.date = %q{2009-06-18} s.description = %q{A small extension to prawn that simplifies embedding JavaScript in your PDF files} s.email = %q{pat@freelancing-gods.com} @@ -18,5 +18,5 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.rubyforge_project = %q{prawn} s.summary = %q{A small extension to prawn that makes it possible to embed JavaScript fragment in your document that respond to events.} - s.add_dependency('prawn-core', '>=0.6.1') + s.add_dependency('prawn', '>=0.12.0') end