drnic-princely 1.2.3 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/princely.rb +4 -4
- data/lib/princely/pdf_helper.rb +3 -2
- data/princely.gemspec +3 -3
- metadata +5 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.4
|
data/lib/princely.rb
CHANGED
@@ -18,9 +18,9 @@ $:.unshift(File.dirname(__FILE__))
|
|
18
18
|
require 'logger'
|
19
19
|
|
20
20
|
class Princely
|
21
|
-
VERSION = "1.
|
21
|
+
VERSION = "1.2.5" unless const_defined?("VERSION")
|
22
22
|
|
23
|
-
attr_accessor :exe_path, :style_sheets, :log_file, :logger
|
23
|
+
attr_accessor :exe_path, :style_sheets, :log_file, :logger, :additional_options
|
24
24
|
|
25
25
|
# Initialize method
|
26
26
|
#
|
@@ -47,7 +47,7 @@ class Princely
|
|
47
47
|
#
|
48
48
|
def exe_path
|
49
49
|
# Add any standard cmd line arguments we need to pass
|
50
|
-
@exe_path << " --input=html --server --log=#{@log_file} "
|
50
|
+
@exe_path << " --input=html --server --log=#{@log_file} #{@additional_options} "
|
51
51
|
@exe_path << @style_sheets
|
52
52
|
return @exe_path
|
53
53
|
end
|
@@ -81,7 +81,7 @@ class Princely
|
|
81
81
|
path = self.exe_path()
|
82
82
|
# Don't spew errors to the standard out...and set up to take IO
|
83
83
|
# as input and output
|
84
|
-
path << " --silent - -o #{output_file} >> #{@log_file} 2>> #{@log_file}"
|
84
|
+
path << " --silent - -o '#{output_file}' >> '#{@log_file}' 2>> '#{@log_file}'"
|
85
85
|
|
86
86
|
# Show the command used...
|
87
87
|
logger.info "\n\nPRINCE XML PDF COMMAND"
|
data/lib/princely/pdf_helper.rb
CHANGED
@@ -22,16 +22,17 @@ module PdfHelper
|
|
22
22
|
options[:stylesheets] ||= []
|
23
23
|
options[:layout] ||= false
|
24
24
|
options[:template] ||= File.join(controller_path,action_name)
|
25
|
-
|
25
|
+
options[:additional_options] ||= ''
|
26
26
|
prince = Princely.new()
|
27
27
|
# Sets style sheets on PDF renderer
|
28
|
+
prince.additional_options = options[:additional_options]
|
28
29
|
prince.add_style_sheets(*options[:stylesheets].collect{|style| stylesheet_file_path(style)})
|
29
30
|
|
30
31
|
html_string = render_to_string(:template => options[:template], :layout => options[:layout])
|
31
32
|
|
32
33
|
# Make all paths relative, on disk paths...
|
33
34
|
html_string.gsub!(".com:/",".com/") # strip out bad attachment_fu URLs
|
34
|
-
html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{RAILS_ROOT}/public/" + $1 + '"' } # re-route absolute paths
|
35
|
+
# html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{RAILS_ROOT}/public/" + $1 + '"' } # re-route absolute paths
|
35
36
|
|
36
37
|
# Remove asset ids on images with a regex
|
37
38
|
html_string.gsub!( /src=["'](\S+\?\d*)["']/i ) { |m| 'src="' + $1.split('?').first + '"' }
|
data/princely.gemspec
CHANGED
@@ -4,12 +4,12 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{princely}
|
8
|
-
s.version = "1.2.
|
7
|
+
s.name = %q{drnic-princely}
|
8
|
+
s.version = "1.2.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Bleigh", "Seth from Subimage Interactive"]
|
12
|
-
s.date = %q{2009-
|
12
|
+
s.date = %q{2009-10-01}
|
13
13
|
s.description = %q{A wrapper for the PrinceXML PDF generation library based on article by Seth from Subimage Interactive at http://sublog.subimage.com/2007/05/29/html-css-to-pdf-using-ruby-on-rails}
|
14
14
|
s.email = %q{michael@intridea.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drnic-princely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-
|
13
|
+
date: 2009-10-01 00:00:00 +10:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|
@@ -33,9 +33,10 @@ files:
|
|
33
33
|
- lib/princely/pdf_helper.rb
|
34
34
|
- lib/princely/rails.rb
|
35
35
|
- princely.gemspec
|
36
|
-
has_rdoc:
|
36
|
+
has_rdoc: true
|
37
37
|
homepage: http://github.com/drnic/princely
|
38
|
-
licenses:
|
38
|
+
licenses: []
|
39
|
+
|
39
40
|
post_install_message:
|
40
41
|
rdoc_options:
|
41
42
|
- --charset=UTF-8
|