prawnto_2 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +4 -2
- data/lib/prawnto/model_renderer.rb +3 -2
- data/lib/prawnto/template_handlers/partials.rb +11 -3
- data/prawnto.gemspec +1 -1
- data/script/rails +0 -0
- data/spec/assets/1.8/default_render-0.12.0.pdf +83 -0
- data/spec/assets/1.8/default_render-0.6.3.pdf +83 -0
- data/spec/assets/{dsl_render-0.12.0.pdf → 1.8/dsl_render-0.12.0.pdf} +0 -0
- data/spec/assets/{dsl_render-0.6.3.pdf → 1.8/dsl_render-0.6.3.pdf} +0 -0
- data/spec/assets/{partial_render-0.12.0.pdf → 1.8/partial_render-0.12.0.pdf} +0 -0
- data/spec/assets/{partial_render-0.6.3.pdf → 1.8/partial_render-0.6.3.pdf} +0 -0
- data/spec/assets/{yield_block_in_helper_test-0.12.0.pdf → 1.8/yield_block_in_helper_test-0.12.0.pdf} +0 -0
- data/spec/assets/{yield_block_in_helper_test-0.6.3.pdf → 1.8/yield_block_in_helper_test-0.6.3.pdf} +0 -0
- data/spec/assets/{default_render-0.12.0.pdf → 1.9/default_render-0.12.0.pdf} +0 -0
- data/spec/assets/{default_render-0.6.3.pdf → 1.9/default_render-0.6.3.pdf} +0 -0
- data/spec/assets/1.9/dsl_render-0.12.0.pdf +83 -0
- data/spec/assets/1.9/dsl_render-0.6.3.pdf +85 -0
- data/spec/assets/1.9/partial_render-0.12.0.pdf +83 -0
- data/spec/assets/1.9/partial_render-0.6.3.pdf +85 -0
- data/spec/assets/1.9/yield_block_in_helper_test-0.12.0.pdf +76 -0
- data/spec/assets/1.9/yield_block_in_helper_test-0.6.3.pdf +78 -0
- data/spec/dummy/app/mailers/pdf_emailer.rb +4 -4
- data/spec/dummy/config/initializers/session_store.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- metadata +38 -22
data/.travis.yml
CHANGED
@@ -12,11 +12,12 @@ module Prawnto
|
|
12
12
|
|
13
13
|
# template : invoices/show.pdf
|
14
14
|
# instance_variables : {"@account" => account} - variables set in before filters
|
15
|
-
|
15
|
+
# prawn_options : options to be used when creating the document
|
16
|
+
def self.to_string(template, calling_object = nil, prawn_options = {})
|
16
17
|
instance = CustomController.new
|
17
18
|
|
18
19
|
if calling_object
|
19
|
-
instance.prawnto :inline => true, :instance_variables_from => calling_object
|
20
|
+
instance.prawnto :inline => true, :instance_variables_from => calling_object, :prawn => prawn_options
|
20
21
|
end
|
21
22
|
|
22
23
|
return instance.render_to_string(:action => template, :template => false, :formats => [:pdf]).html_safe
|
@@ -33,9 +33,17 @@ module Prawnto
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def cleaned_path(provided_partial_path)
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
if (RUBY_VERSION > "1.8.7")
|
37
|
+
# This eval avoids the syntax error in 1.8.7
|
38
|
+
eval('*provided_path, file_name = provided_partial_path.split("/")')
|
39
|
+
else
|
40
|
+
splitted_provided_partial_path = provided_partial_path.split("/")
|
41
|
+
provided_path = splitted_provided_partial_path[0..-2]
|
42
|
+
file_name = splitted_provided_partial_path.last
|
43
|
+
end
|
44
|
+
|
45
|
+
file_name = "_"+file_name unless file_name[0].chr == "_"
|
46
|
+
File.join(provided_path, [file_name])
|
39
47
|
end
|
40
48
|
|
41
49
|
end
|
data/prawnto.gemspec
CHANGED
data/script/rails
CHANGED
File without changes
|
@@ -0,0 +1,83 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator <feff0050007200610077006e>
|
5
|
+
/Producer <feff0050007200610077006e>
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Pages 3 0 R
|
10
|
+
/Type /Catalog
|
11
|
+
>>
|
12
|
+
endobj
|
13
|
+
3 0 obj
|
14
|
+
<< /Type /Pages
|
15
|
+
/Count 1
|
16
|
+
/Kids [5 0 R]
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 332
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
q
|
24
|
+
|
25
|
+
BT
|
26
|
+
36 747.384 Td
|
27
|
+
/F1.0 12 Tf
|
28
|
+
[<48656c6c6f2057> 30 <6f72> -15 <6c6421>] TJ
|
29
|
+
ET
|
30
|
+
|
31
|
+
|
32
|
+
BT
|
33
|
+
36 733.512 Td
|
34
|
+
/F1.0 12 Tf
|
35
|
+
[<696e7374616e63652076> 25 <6172> -15 <696162> 20 <6c65204078203d2031>] TJ
|
36
|
+
ET
|
37
|
+
|
38
|
+
|
39
|
+
BT
|
40
|
+
36 719.64 Td
|
41
|
+
/F1.0 12 Tf
|
42
|
+
[<68656c706572206d6574686f64732077> 10 <6f72> -15 <6b203a20746869732069732066726f6d20612068656c706572>] TJ
|
43
|
+
ET
|
44
|
+
|
45
|
+
Q
|
46
|
+
|
47
|
+
endstream
|
48
|
+
endobj
|
49
|
+
5 0 obj
|
50
|
+
<< /Type /Page
|
51
|
+
/Contents 4 0 R
|
52
|
+
/Parent 3 0 R
|
53
|
+
/MediaBox [0 0 612.0 792.0]
|
54
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
55
|
+
/Font << /F1.0 6 0 R
|
56
|
+
>>
|
57
|
+
>>
|
58
|
+
>>
|
59
|
+
endobj
|
60
|
+
6 0 obj
|
61
|
+
<< /Subtype /Type1
|
62
|
+
/Type /Font
|
63
|
+
/BaseFont /Helvetica
|
64
|
+
/Encoding /WinAnsiEncoding
|
65
|
+
>>
|
66
|
+
endobj
|
67
|
+
xref
|
68
|
+
0 7
|
69
|
+
0000000000 65535 f
|
70
|
+
0000000015 00000 n
|
71
|
+
0000000109 00000 n
|
72
|
+
0000000158 00000 n
|
73
|
+
0000000215 00000 n
|
74
|
+
0000000598 00000 n
|
75
|
+
0000000776 00000 n
|
76
|
+
trailer
|
77
|
+
<< /Info 1 0 R
|
78
|
+
/Size 7
|
79
|
+
/Root 2 0 R
|
80
|
+
>>
|
81
|
+
startxref
|
82
|
+
873
|
83
|
+
%%EOF
|
@@ -0,0 +1,83 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator <feff0050007200610077006e>
|
5
|
+
/Producer <feff0050007200610077006e>
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Pages 3 0 R
|
10
|
+
/Type /Catalog
|
11
|
+
>>
|
12
|
+
endobj
|
13
|
+
3 0 obj
|
14
|
+
<< /Type /Pages
|
15
|
+
/Count 1
|
16
|
+
/Kids [5 0 R]
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 332
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
q
|
24
|
+
|
25
|
+
BT
|
26
|
+
36 747.384 Td
|
27
|
+
/F1.0 12 Tf
|
28
|
+
[<48656c6c6f2057> 30 <6f72> -15 <6c6421>] TJ
|
29
|
+
ET
|
30
|
+
|
31
|
+
|
32
|
+
BT
|
33
|
+
36 733.512 Td
|
34
|
+
/F1.0 12 Tf
|
35
|
+
[<696e7374616e63652076> 25 <6172> -15 <696162> 20 <6c65204078203d2031>] TJ
|
36
|
+
ET
|
37
|
+
|
38
|
+
|
39
|
+
BT
|
40
|
+
36 719.64 Td
|
41
|
+
/F1.0 12 Tf
|
42
|
+
[<68656c706572206d6574686f64732077> 10 <6f72> -15 <6b203a20746869732069732066726f6d20612068656c706572>] TJ
|
43
|
+
ET
|
44
|
+
|
45
|
+
Q
|
46
|
+
|
47
|
+
endstream
|
48
|
+
endobj
|
49
|
+
5 0 obj
|
50
|
+
<< /Type /Page
|
51
|
+
/Contents 4 0 R
|
52
|
+
/Parent 3 0 R
|
53
|
+
/MediaBox [0 0 612.0 792.0]
|
54
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
55
|
+
/Font << /F1.0 6 0 R
|
56
|
+
>>
|
57
|
+
>>
|
58
|
+
>>
|
59
|
+
endobj
|
60
|
+
6 0 obj
|
61
|
+
<< /Subtype /Type1
|
62
|
+
/Type /Font
|
63
|
+
/BaseFont /Helvetica
|
64
|
+
/Encoding /WinAnsiEncoding
|
65
|
+
>>
|
66
|
+
endobj
|
67
|
+
xref
|
68
|
+
0 7
|
69
|
+
0000000000 65535 f
|
70
|
+
0000000015 00000 n
|
71
|
+
0000000109 00000 n
|
72
|
+
0000000158 00000 n
|
73
|
+
0000000215 00000 n
|
74
|
+
0000000598 00000 n
|
75
|
+
0000000776 00000 n
|
76
|
+
trailer
|
77
|
+
<< /Info 1 0 R
|
78
|
+
/Size 7
|
79
|
+
/Root 2 0 R
|
80
|
+
>>
|
81
|
+
startxref
|
82
|
+
873
|
83
|
+
%%EOF
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/assets/{yield_block_in_helper_test-0.12.0.pdf → 1.8/yield_block_in_helper_test-0.12.0.pdf}
RENAMED
File without changes
|
data/spec/assets/{yield_block_in_helper_test-0.6.3.pdf → 1.8/yield_block_in_helper_test-0.6.3.pdf}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,83 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator <feff0050007200610077006e>
|
5
|
+
/Producer <feff0050007200610077006e>
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Catalog
|
10
|
+
/Pages 3 0 R
|
11
|
+
>>
|
12
|
+
endobj
|
13
|
+
3 0 obj
|
14
|
+
<< /Type /Pages
|
15
|
+
/Count 1
|
16
|
+
/Kids [5 0 R]
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 355
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
q
|
24
|
+
|
25
|
+
BT
|
26
|
+
36 747.384 Td
|
27
|
+
/F1.0 12 Tf
|
28
|
+
[<48656c6c6f2057> 30 <6f72> -15 <6c6421202d2044534c>] TJ
|
29
|
+
ET
|
30
|
+
|
31
|
+
|
32
|
+
BT
|
33
|
+
36 733.512 Td
|
34
|
+
/F1.0 12 Tf
|
35
|
+
[<696e7374616e63652076> 25 <6172> -15 <696162> 20 <6c65204078203d2031>] TJ
|
36
|
+
ET
|
37
|
+
|
38
|
+
|
39
|
+
BT
|
40
|
+
36 719.6399999999999 Td
|
41
|
+
/F1.0 12 Tf
|
42
|
+
[<68656c706572206d6574686f64732077> 10 <6f72> -15 <6b203a20746869732069732066726f6d20612068656c706572>] TJ
|
43
|
+
ET
|
44
|
+
|
45
|
+
Q
|
46
|
+
|
47
|
+
endstream
|
48
|
+
endobj
|
49
|
+
5 0 obj
|
50
|
+
<< /Type /Page
|
51
|
+
/Parent 3 0 R
|
52
|
+
/MediaBox [0 0 612.0 792.0]
|
53
|
+
/Contents 4 0 R
|
54
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
55
|
+
/Font << /F1.0 6 0 R
|
56
|
+
>>
|
57
|
+
>>
|
58
|
+
>>
|
59
|
+
endobj
|
60
|
+
6 0 obj
|
61
|
+
<< /Type /Font
|
62
|
+
/Subtype /Type1
|
63
|
+
/BaseFont /Helvetica
|
64
|
+
/Encoding /WinAnsiEncoding
|
65
|
+
>>
|
66
|
+
endobj
|
67
|
+
xref
|
68
|
+
0 7
|
69
|
+
0000000000 65535 f
|
70
|
+
0000000015 00000 n
|
71
|
+
0000000109 00000 n
|
72
|
+
0000000158 00000 n
|
73
|
+
0000000215 00000 n
|
74
|
+
0000000621 00000 n
|
75
|
+
0000000799 00000 n
|
76
|
+
trailer
|
77
|
+
<< /Size 7
|
78
|
+
/Root 2 0 R
|
79
|
+
/Info 1 0 R
|
80
|
+
>>
|
81
|
+
startxref
|
82
|
+
896
|
83
|
+
%%EOF
|
@@ -0,0 +1,85 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator (Prawn)
|
5
|
+
/Producer (Prawn)
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Pages
|
10
|
+
/Count 1
|
11
|
+
/Kids [5 0 R]
|
12
|
+
>>
|
13
|
+
endobj
|
14
|
+
3 0 obj
|
15
|
+
<< /Type /Catalog
|
16
|
+
/Pages 2 0 R
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 419
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
0.000 0.000 0.000 rg
|
24
|
+
0.000 0.000 0.000 RG
|
25
|
+
q
|
26
|
+
|
27
|
+
BT
|
28
|
+
36 747.384 Td
|
29
|
+
/F1.0 12 Tf
|
30
|
+
[<48656c6c6f20> 40 <57> 30 <6f72> -15 <6c6421202d2044534c>] TJ
|
31
|
+
ET
|
32
|
+
|
33
|
+
|
34
|
+
BT
|
35
|
+
36 733.5120000000001 Td
|
36
|
+
/F1.0 12 Tf
|
37
|
+
[<696e7374616e63652076> 25 <6172> -15 <696162> 20 <6c65204078203d2031>] TJ
|
38
|
+
ET
|
39
|
+
|
40
|
+
|
41
|
+
BT
|
42
|
+
36 719.6400000000001 Td
|
43
|
+
/F1.0 12 Tf
|
44
|
+
[<68656c706572206d6574686f64732077> 10 <6f72> -15 <6b203a> 50 <20746869732069732066726f6d20612068656c706572>] TJ
|
45
|
+
ET
|
46
|
+
|
47
|
+
Q
|
48
|
+
|
49
|
+
endstream
|
50
|
+
endobj
|
51
|
+
5 0 obj
|
52
|
+
<< /Type /Page
|
53
|
+
/Parent 2 0 R
|
54
|
+
/MediaBox [0 0 612.0 792.0]
|
55
|
+
/Contents 4 0 R
|
56
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
57
|
+
/Font << /F1.0 6 0 R
|
58
|
+
>>
|
59
|
+
>>
|
60
|
+
>>
|
61
|
+
endobj
|
62
|
+
6 0 obj
|
63
|
+
<< /Type /Font
|
64
|
+
/Subtype /Type1
|
65
|
+
/BaseFont /Helvetica
|
66
|
+
/Encoding /WinAnsiEncoding
|
67
|
+
>>
|
68
|
+
endobj
|
69
|
+
xref
|
70
|
+
0 7
|
71
|
+
0000000000 65535 f
|
72
|
+
0000000015 00000 n
|
73
|
+
0000000071 00000 n
|
74
|
+
0000000128 00000 n
|
75
|
+
0000000177 00000 n
|
76
|
+
0000000647 00000 n
|
77
|
+
0000000825 00000 n
|
78
|
+
trailer
|
79
|
+
<< /Size 7
|
80
|
+
/Root 3 0 R
|
81
|
+
/Info 1 0 R
|
82
|
+
>>
|
83
|
+
startxref
|
84
|
+
922
|
85
|
+
%%EOF
|
@@ -0,0 +1,83 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator <feff0050007200610077006e>
|
5
|
+
/Producer <feff0050007200610077006e>
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Catalog
|
10
|
+
/Pages 3 0 R
|
11
|
+
>>
|
12
|
+
endobj
|
13
|
+
3 0 obj
|
14
|
+
<< /Type /Pages
|
15
|
+
/Count 1
|
16
|
+
/Kids [5 0 R]
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 249
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
q
|
24
|
+
|
25
|
+
BT
|
26
|
+
36 747.384 Td
|
27
|
+
/F1.0 12 Tf
|
28
|
+
[<626566> 30 <6f726520706172> -40 <7469616c>] TJ
|
29
|
+
ET
|
30
|
+
|
31
|
+
|
32
|
+
BT
|
33
|
+
36 733.512 Td
|
34
|
+
/F1.0 12 Tf
|
35
|
+
[<696e7369646520706172> -40 <7469616c>] TJ
|
36
|
+
ET
|
37
|
+
|
38
|
+
|
39
|
+
BT
|
40
|
+
36 719.6399999999999 Td
|
41
|
+
/F1.0 12 Tf
|
42
|
+
[<616674657220706172> -40 <7469616c>] TJ
|
43
|
+
ET
|
44
|
+
|
45
|
+
Q
|
46
|
+
|
47
|
+
endstream
|
48
|
+
endobj
|
49
|
+
5 0 obj
|
50
|
+
<< /Type /Page
|
51
|
+
/Parent 3 0 R
|
52
|
+
/MediaBox [0 0 612.0 792.0]
|
53
|
+
/Contents 4 0 R
|
54
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
55
|
+
/Font << /F1.0 6 0 R
|
56
|
+
>>
|
57
|
+
>>
|
58
|
+
>>
|
59
|
+
endobj
|
60
|
+
6 0 obj
|
61
|
+
<< /Type /Font
|
62
|
+
/Subtype /Type1
|
63
|
+
/BaseFont /Helvetica
|
64
|
+
/Encoding /WinAnsiEncoding
|
65
|
+
>>
|
66
|
+
endobj
|
67
|
+
xref
|
68
|
+
0 7
|
69
|
+
0000000000 65535 f
|
70
|
+
0000000015 00000 n
|
71
|
+
0000000109 00000 n
|
72
|
+
0000000158 00000 n
|
73
|
+
0000000215 00000 n
|
74
|
+
0000000515 00000 n
|
75
|
+
0000000693 00000 n
|
76
|
+
trailer
|
77
|
+
<< /Size 7
|
78
|
+
/Root 2 0 R
|
79
|
+
/Info 1 0 R
|
80
|
+
>>
|
81
|
+
startxref
|
82
|
+
790
|
83
|
+
%%EOF
|
@@ -0,0 +1,85 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator (Prawn)
|
5
|
+
/Producer (Prawn)
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Pages
|
10
|
+
/Count 1
|
11
|
+
/Kids [5 0 R]
|
12
|
+
>>
|
13
|
+
endobj
|
14
|
+
3 0 obj
|
15
|
+
<< /Type /Catalog
|
16
|
+
/Pages 2 0 R
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 301
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
0.000 0.000 0.000 rg
|
24
|
+
0.000 0.000 0.000 RG
|
25
|
+
q
|
26
|
+
|
27
|
+
BT
|
28
|
+
36 747.384 Td
|
29
|
+
/F1.0 12 Tf
|
30
|
+
[<626566> 30 <6f726520706172> -40 <7469616c>] TJ
|
31
|
+
ET
|
32
|
+
|
33
|
+
|
34
|
+
BT
|
35
|
+
36 733.5120000000001 Td
|
36
|
+
/F1.0 12 Tf
|
37
|
+
[<696e7369646520706172> -40 <7469616c>] TJ
|
38
|
+
ET
|
39
|
+
|
40
|
+
|
41
|
+
BT
|
42
|
+
36 719.6400000000001 Td
|
43
|
+
/F1.0 12 Tf
|
44
|
+
[<616674657220706172> -40 <7469616c>] TJ
|
45
|
+
ET
|
46
|
+
|
47
|
+
Q
|
48
|
+
|
49
|
+
endstream
|
50
|
+
endobj
|
51
|
+
5 0 obj
|
52
|
+
<< /Type /Page
|
53
|
+
/Parent 2 0 R
|
54
|
+
/MediaBox [0 0 612.0 792.0]
|
55
|
+
/Contents 4 0 R
|
56
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
57
|
+
/Font << /F1.0 6 0 R
|
58
|
+
>>
|
59
|
+
>>
|
60
|
+
>>
|
61
|
+
endobj
|
62
|
+
6 0 obj
|
63
|
+
<< /Type /Font
|
64
|
+
/Subtype /Type1
|
65
|
+
/BaseFont /Helvetica
|
66
|
+
/Encoding /WinAnsiEncoding
|
67
|
+
>>
|
68
|
+
endobj
|
69
|
+
xref
|
70
|
+
0 7
|
71
|
+
0000000000 65535 f
|
72
|
+
0000000015 00000 n
|
73
|
+
0000000071 00000 n
|
74
|
+
0000000128 00000 n
|
75
|
+
0000000177 00000 n
|
76
|
+
0000000529 00000 n
|
77
|
+
0000000707 00000 n
|
78
|
+
trailer
|
79
|
+
<< /Size 7
|
80
|
+
/Root 3 0 R
|
81
|
+
/Info 1 0 R
|
82
|
+
>>
|
83
|
+
startxref
|
84
|
+
804
|
85
|
+
%%EOF
|
@@ -0,0 +1,76 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator <feff0050007200610077006e>
|
5
|
+
/Producer <feff0050007200610077006e>
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Catalog
|
10
|
+
/Pages 3 0 R
|
11
|
+
>>
|
12
|
+
endobj
|
13
|
+
3 0 obj
|
14
|
+
<< /Type /Pages
|
15
|
+
/Count 1
|
16
|
+
/Kids [5 0 R]
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 112
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
q
|
24
|
+
|
25
|
+
BT
|
26
|
+
36 747.384 Td
|
27
|
+
/F1.0 12 Tf
|
28
|
+
[<746573742031>] TJ
|
29
|
+
ET
|
30
|
+
|
31
|
+
|
32
|
+
BT
|
33
|
+
36 733.512 Td
|
34
|
+
/F1.0 12 Tf
|
35
|
+
[<746573742032>] TJ
|
36
|
+
ET
|
37
|
+
|
38
|
+
Q
|
39
|
+
|
40
|
+
endstream
|
41
|
+
endobj
|
42
|
+
5 0 obj
|
43
|
+
<< /Type /Page
|
44
|
+
/Parent 3 0 R
|
45
|
+
/MediaBox [0 0 612.0 792.0]
|
46
|
+
/Contents 4 0 R
|
47
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
48
|
+
/Font << /F1.0 6 0 R
|
49
|
+
>>
|
50
|
+
>>
|
51
|
+
>>
|
52
|
+
endobj
|
53
|
+
6 0 obj
|
54
|
+
<< /Type /Font
|
55
|
+
/Subtype /Type1
|
56
|
+
/BaseFont /Helvetica
|
57
|
+
/Encoding /WinAnsiEncoding
|
58
|
+
>>
|
59
|
+
endobj
|
60
|
+
xref
|
61
|
+
0 7
|
62
|
+
0000000000 65535 f
|
63
|
+
0000000015 00000 n
|
64
|
+
0000000109 00000 n
|
65
|
+
0000000158 00000 n
|
66
|
+
0000000215 00000 n
|
67
|
+
0000000378 00000 n
|
68
|
+
0000000556 00000 n
|
69
|
+
trailer
|
70
|
+
<< /Size 7
|
71
|
+
/Root 2 0 R
|
72
|
+
/Info 1 0 R
|
73
|
+
>>
|
74
|
+
startxref
|
75
|
+
653
|
76
|
+
%%EOF
|
@@ -0,0 +1,78 @@
|
|
1
|
+
%PDF-1.3
|
2
|
+
%����
|
3
|
+
1 0 obj
|
4
|
+
<< /Creator (Prawn)
|
5
|
+
/Producer (Prawn)
|
6
|
+
>>
|
7
|
+
endobj
|
8
|
+
2 0 obj
|
9
|
+
<< /Type /Pages
|
10
|
+
/Count 1
|
11
|
+
/Kids [5 0 R]
|
12
|
+
>>
|
13
|
+
endobj
|
14
|
+
3 0 obj
|
15
|
+
<< /Type /Catalog
|
16
|
+
/Pages 2 0 R
|
17
|
+
>>
|
18
|
+
endobj
|
19
|
+
4 0 obj
|
20
|
+
<< /Length 164
|
21
|
+
>>
|
22
|
+
stream
|
23
|
+
0.000 0.000 0.000 rg
|
24
|
+
0.000 0.000 0.000 RG
|
25
|
+
q
|
26
|
+
|
27
|
+
BT
|
28
|
+
36 747.384 Td
|
29
|
+
/F1.0 12 Tf
|
30
|
+
[<746573742031>] TJ
|
31
|
+
ET
|
32
|
+
|
33
|
+
|
34
|
+
BT
|
35
|
+
36 733.5120000000001 Td
|
36
|
+
/F1.0 12 Tf
|
37
|
+
[<746573742032>] TJ
|
38
|
+
ET
|
39
|
+
|
40
|
+
Q
|
41
|
+
|
42
|
+
endstream
|
43
|
+
endobj
|
44
|
+
5 0 obj
|
45
|
+
<< /Type /Page
|
46
|
+
/Parent 2 0 R
|
47
|
+
/MediaBox [0 0 612.0 792.0]
|
48
|
+
/Contents 4 0 R
|
49
|
+
/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
|
50
|
+
/Font << /F1.0 6 0 R
|
51
|
+
>>
|
52
|
+
>>
|
53
|
+
>>
|
54
|
+
endobj
|
55
|
+
6 0 obj
|
56
|
+
<< /Type /Font
|
57
|
+
/Subtype /Type1
|
58
|
+
/BaseFont /Helvetica
|
59
|
+
/Encoding /WinAnsiEncoding
|
60
|
+
>>
|
61
|
+
endobj
|
62
|
+
xref
|
63
|
+
0 7
|
64
|
+
0000000000 65535 f
|
65
|
+
0000000015 00000 n
|
66
|
+
0000000071 00000 n
|
67
|
+
0000000128 00000 n
|
68
|
+
0000000177 00000 n
|
69
|
+
0000000392 00000 n
|
70
|
+
0000000570 00000 n
|
71
|
+
trailer
|
72
|
+
<< /Size 7
|
73
|
+
/Root 3 0 R
|
74
|
+
/Info 1 0 R
|
75
|
+
>>
|
76
|
+
startxref
|
77
|
+
667
|
78
|
+
%%EOF
|
@@ -1,14 +1,14 @@
|
|
1
1
|
class PdfEmailer < ActionMailer::Base
|
2
2
|
helper :application
|
3
|
-
default from
|
4
|
-
|
3
|
+
default :from => "from@example.com"
|
4
|
+
|
5
5
|
def email_with_attachment
|
6
6
|
@x = 1
|
7
|
-
|
7
|
+
|
8
8
|
attachments["hello_world.pdf"] = render("test/default_render", :format => :pdf)
|
9
9
|
mail :subject => "Hello", :to => "test@test.com" do |format|
|
10
10
|
format.text
|
11
11
|
end
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
Dummy::Application.config.session_store :cookie_store, key
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format
|
8
|
+
wrap_parameters :format => [:json]
|
9
9
|
end
|
10
10
|
|
11
11
|
# Disable root element in JSON by default.
|
data/spec/spec_helper.rb
CHANGED
@@ -28,5 +28,6 @@ end
|
|
28
28
|
# "/path/to/prawnto/spec/assets/default_render-#{prawn version}.pdf"
|
29
29
|
def asset_path(file)
|
30
30
|
prawn_version = Gem.loaded_specs["prawn"].version.to_s.inspect
|
31
|
-
|
31
|
+
ruby_version_folder = RUBY_VERSION.split(".")[0..1].join(".")
|
32
|
+
TEST_ASSETS + "/#{ruby_version_folder}/#{file}-#{prawn_version.gsub('"','')}.pdf"
|
32
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawnto_2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03-
|
12
|
+
date: 2012-03-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70209470835380 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70209470835380
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: prawn
|
27
|
-
requirement: &
|
27
|
+
requirement: &70209470834900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 0.6.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70209470834900
|
36
36
|
description: Simple PDF generation using the prawn library.
|
37
37
|
email:
|
38
38
|
- development@forrestzeisler.com
|
@@ -61,14 +61,22 @@ files:
|
|
61
61
|
- prawnto.gemspec
|
62
62
|
- rails/init.rb
|
63
63
|
- script/rails
|
64
|
-
- spec/assets/default_render-0.12.0.pdf
|
65
|
-
- spec/assets/default_render-0.6.3.pdf
|
66
|
-
- spec/assets/dsl_render-0.12.0.pdf
|
67
|
-
- spec/assets/dsl_render-0.6.3.pdf
|
68
|
-
- spec/assets/partial_render-0.12.0.pdf
|
69
|
-
- spec/assets/partial_render-0.6.3.pdf
|
70
|
-
- spec/assets/yield_block_in_helper_test-0.12.0.pdf
|
71
|
-
- spec/assets/yield_block_in_helper_test-0.6.3.pdf
|
64
|
+
- spec/assets/1.8/default_render-0.12.0.pdf
|
65
|
+
- spec/assets/1.8/default_render-0.6.3.pdf
|
66
|
+
- spec/assets/1.8/dsl_render-0.12.0.pdf
|
67
|
+
- spec/assets/1.8/dsl_render-0.6.3.pdf
|
68
|
+
- spec/assets/1.8/partial_render-0.12.0.pdf
|
69
|
+
- spec/assets/1.8/partial_render-0.6.3.pdf
|
70
|
+
- spec/assets/1.8/yield_block_in_helper_test-0.12.0.pdf
|
71
|
+
- spec/assets/1.8/yield_block_in_helper_test-0.6.3.pdf
|
72
|
+
- spec/assets/1.9/default_render-0.12.0.pdf
|
73
|
+
- spec/assets/1.9/default_render-0.6.3.pdf
|
74
|
+
- spec/assets/1.9/dsl_render-0.12.0.pdf
|
75
|
+
- spec/assets/1.9/dsl_render-0.6.3.pdf
|
76
|
+
- spec/assets/1.9/partial_render-0.12.0.pdf
|
77
|
+
- spec/assets/1.9/partial_render-0.6.3.pdf
|
78
|
+
- spec/assets/1.9/yield_block_in_helper_test-0.12.0.pdf
|
79
|
+
- spec/assets/1.9/yield_block_in_helper_test-0.6.3.pdf
|
72
80
|
- spec/dummy/.rspec
|
73
81
|
- spec/dummy/.sass-cache/387f7b3fde13680ae5a79212c089f81d2d418f1e/application.css.scssc
|
74
82
|
- spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/_shared.css.scssc
|
@@ -152,14 +160,22 @@ specification_version: 3
|
|
152
160
|
summary: This gem allows you to use the PDF mime-type and the simple prawn syntax
|
153
161
|
to generate impressive looking PDFs.
|
154
162
|
test_files:
|
155
|
-
- spec/assets/default_render-0.12.0.pdf
|
156
|
-
- spec/assets/default_render-0.6.3.pdf
|
157
|
-
- spec/assets/dsl_render-0.12.0.pdf
|
158
|
-
- spec/assets/dsl_render-0.6.3.pdf
|
159
|
-
- spec/assets/partial_render-0.12.0.pdf
|
160
|
-
- spec/assets/partial_render-0.6.3.pdf
|
161
|
-
- spec/assets/yield_block_in_helper_test-0.12.0.pdf
|
162
|
-
- spec/assets/yield_block_in_helper_test-0.6.3.pdf
|
163
|
+
- spec/assets/1.8/default_render-0.12.0.pdf
|
164
|
+
- spec/assets/1.8/default_render-0.6.3.pdf
|
165
|
+
- spec/assets/1.8/dsl_render-0.12.0.pdf
|
166
|
+
- spec/assets/1.8/dsl_render-0.6.3.pdf
|
167
|
+
- spec/assets/1.8/partial_render-0.12.0.pdf
|
168
|
+
- spec/assets/1.8/partial_render-0.6.3.pdf
|
169
|
+
- spec/assets/1.8/yield_block_in_helper_test-0.12.0.pdf
|
170
|
+
- spec/assets/1.8/yield_block_in_helper_test-0.6.3.pdf
|
171
|
+
- spec/assets/1.9/default_render-0.12.0.pdf
|
172
|
+
- spec/assets/1.9/default_render-0.6.3.pdf
|
173
|
+
- spec/assets/1.9/dsl_render-0.12.0.pdf
|
174
|
+
- spec/assets/1.9/dsl_render-0.6.3.pdf
|
175
|
+
- spec/assets/1.9/partial_render-0.12.0.pdf
|
176
|
+
- spec/assets/1.9/partial_render-0.6.3.pdf
|
177
|
+
- spec/assets/1.9/yield_block_in_helper_test-0.12.0.pdf
|
178
|
+
- spec/assets/1.9/yield_block_in_helper_test-0.6.3.pdf
|
163
179
|
- spec/dummy/.rspec
|
164
180
|
- spec/dummy/.sass-cache/387f7b3fde13680ae5a79212c089f81d2d418f1e/application.css.scssc
|
165
181
|
- spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/_shared.css.scssc
|