chili_pdf 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +11 -0
- data/Manifest.txt +1 -0
- data/README.md +2 -2
- data/app/controllers/extended_wiki_controller.rb +7 -3
- data/app/helpers/chili_pdf_helper.rb +10 -0
- data/app/views/extended_wiki/show.pdf.html.erb +1 -1
- data/app/views/layouts/pdf.pdf.erb +1 -0
- data/lib/chili_pdf.rb +1 -1
- data/lib/tasks/chili_pdf_tasks.rb +3 -1
- data.tar.gz.sig +0 -0
- metadata +5 -4
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
=== 0.2.0 / 2011-05-23
|
2
|
+
|
3
|
+
* Fixed layout & stylesheet inclusions
|
4
|
+
* HTML template for PDF rendering was not being wrapped in a layout
|
5
|
+
* Added ChiliPdfHelper#chili_pdf_stylesheets to inline (fix)
|
6
|
+
CSS inclusions in generated PDFs
|
7
|
+
* Added HTML debugging (add ?debug=true to URL)
|
8
|
+
* Removed blank spaces from default filename on PDF
|
9
|
+
* Fixed 'rake chili_pdf:install' so it will remove an existing plugin
|
10
|
+
asset directory before attempting to symlink.
|
11
|
+
|
1
12
|
== 0.1.0 2011-05-20
|
2
13
|
|
3
14
|
* 1 major enhancement:
|
data/Manifest.txt
CHANGED
data/README.md
CHANGED
@@ -73,7 +73,7 @@ config.gem 'chili_pdf'
|
|
73
73
|
In your 'Rakefile', add:
|
74
74
|
|
75
75
|
``` ruby
|
76
|
-
require '
|
76
|
+
require 'tasks/chili_pdf_tasks'
|
77
77
|
```
|
78
78
|
|
79
79
|
Run the installation rake task (installs assets)
|
@@ -95,7 +95,7 @@ RAILS_ENV=production rake chili_pdf:uninstall
|
|
95
95
|
In your 'Rakefile', remove:
|
96
96
|
|
97
97
|
``` ruby
|
98
|
-
require '
|
98
|
+
require 'tasks/chili_pdf_tasks'
|
99
99
|
```
|
100
100
|
|
101
101
|
In your 'config/environment.rb', remove:
|
@@ -1,22 +1,26 @@
|
|
1
1
|
class ExtendedWikiController < WikiController
|
2
2
|
unloadable
|
3
3
|
|
4
|
+
helper 'chili_pdf'
|
5
|
+
|
4
6
|
def show
|
5
7
|
super
|
6
8
|
unless performed? # Prevent double render
|
7
9
|
respond_to do |format|
|
8
10
|
format.html {render :template => 'wiki/show'}
|
9
11
|
format.pdf {
|
10
|
-
|
12
|
+
filename = "#{@project.name.underscore}_#{@page.title}".gsub(/\s/,'')
|
13
|
+
render :pdf => filename,
|
11
14
|
:template => 'extended_wiki/show.pdf.html.erb',
|
12
15
|
:page_size => "Letter",
|
13
|
-
:
|
16
|
+
:show_as_html => params[:debug],
|
14
17
|
:margin => {
|
15
18
|
:top => "0.5in",
|
16
19
|
:bottom => "0.5in",
|
17
20
|
:left => "0.5in",
|
18
21
|
:right => "0.5in"
|
19
|
-
}
|
22
|
+
},
|
23
|
+
:layout => 'pdf.pdf.erb'
|
20
24
|
}
|
21
25
|
end
|
22
26
|
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module ChiliPdfHelper
|
2
|
+
# Taken almost verbatim from wicked_pdf gem
|
3
|
+
def chili_pdf_stylesheets
|
4
|
+
css_dir = Rails.root.join('public','plugin_assets', 'chili_pdf', 'stylesheets')
|
5
|
+
css_file_list = Dir.glob("#{css_dir}/*css")
|
6
|
+
css_file_list.collect { |css_file|
|
7
|
+
"<style type='text/css'>#{File.read(css_file)}</style>"
|
8
|
+
}.join("\n")
|
9
|
+
end
|
10
|
+
end
|
data/lib/chili_pdf.rb
CHANGED
@@ -22,6 +22,7 @@ class ChiliPDFTasks < Rake::TaskLib
|
|
22
22
|
task :symlink_assets => [:environment] do
|
23
23
|
# HACK: Symlinks the files from plugindir/assets to the appropriate place in
|
24
24
|
# the rails application
|
25
|
+
remove_symlink(asset_destination_dir)
|
25
26
|
puts "Symlinking assets (stylesheets, etc)..."
|
26
27
|
add_symlink asset_source_dir, asset_destination_dir
|
27
28
|
end
|
@@ -50,7 +51,8 @@ class ChiliPDFTasks < Rake::TaskLib
|
|
50
51
|
end
|
51
52
|
|
52
53
|
def remove_symlink(symlink_file)
|
53
|
-
|
54
|
+
File.unlink(symlink_file)
|
55
|
+
rescue Errno::ENOENT # file did not exist...ignore this error
|
54
56
|
end
|
55
57
|
|
56
58
|
def add_symlink(source, destination)
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chili_pdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Kersten
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
NVADJA==
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2011-05-
|
39
|
+
date: 2011-05-23 00:00:00 -05:00
|
40
40
|
default_executable:
|
41
41
|
dependencies:
|
42
42
|
- !ruby/object:Gem::Dependency
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- app/controllers/extended_wiki_controller.rb
|
95
|
+
- app/helpers/chili_pdf_helper.rb
|
95
96
|
- app/views/extended_wiki/show.pdf.html.erb
|
96
97
|
- app/views/layouts/pdf.pdf.erb
|
97
98
|
- assets/stylesheets/pdf.css
|
metadata.gz.sig
CHANGED
Binary file
|