pdf_maker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +3 -0
  3. data/Rakefile +38 -0
  4. data/lib/pdf_maker/version.rb +3 -0
  5. data/lib/pdf_maker.rb +68 -0
  6. data/lib/tasks/pdf_maker_tasks.rake +4 -0
  7. data/test/dummy/README.rdoc +261 -0
  8. data/test/dummy/Rakefile +7 -0
  9. data/test/dummy/app/assets/javascripts/application.js +15 -0
  10. data/test/dummy/app/assets/javascripts/tester.js.coffee +2 -0
  11. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  12. data/test/dummy/app/assets/stylesheets/colors.css.scss +3 -0
  13. data/test/dummy/app/controllers/application_controller.rb +3 -0
  14. data/test/dummy/app/helpers/application_helper.rb +2 -0
  15. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  16. data/test/dummy/app/views/layouts/pdf.html.erb +12 -0
  17. data/test/dummy/app/views/users/profile.html.erb +2 -0
  18. data/test/dummy/config/application.rb +59 -0
  19. data/test/dummy/config/boot.rb +10 -0
  20. data/test/dummy/config/database.yml +25 -0
  21. data/test/dummy/config/environment.rb +5 -0
  22. data/test/dummy/config/environments/development.rb +37 -0
  23. data/test/dummy/config/environments/production.rb +67 -0
  24. data/test/dummy/config/environments/test.rb +37 -0
  25. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  26. data/test/dummy/config/initializers/inflections.rb +15 -0
  27. data/test/dummy/config/initializers/mime_types.rb +5 -0
  28. data/test/dummy/config/initializers/secret_token.rb +7 -0
  29. data/test/dummy/config/initializers/session_store.rb +8 -0
  30. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  31. data/test/dummy/config/locales/en.yml +5 -0
  32. data/test/dummy/config/routes.rb +58 -0
  33. data/test/dummy/config.ru +4 -0
  34. data/test/dummy/db/test.sqlite3 +0 -0
  35. data/test/dummy/log/development.log +1 -0
  36. data/test/dummy/log/test.log +981 -0
  37. data/test/dummy/public/404.html +26 -0
  38. data/test/dummy/public/422.html +26 -0
  39. data/test/dummy/public/500.html +25 -0
  40. data/test/dummy/public/favicon.ico +0 -0
  41. data/test/dummy/script/rails +6 -0
  42. data/test/pdf_maker_test.rb +29 -0
  43. data/test/test_helper.rb +15 -0
  44. metadata +235 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,29 @@
1
+ require 'test_helper'
2
+ require 'fileutils'
3
+
4
+ class PdfMakerTest < ActiveSupport::TestCase
5
+ setup do
6
+ FileUtils.mkdir_p("test/test_pdfs")
7
+ end
8
+
9
+ teardown do
10
+ FileUtils.rm_rf(Dir["test/test_pdfs"])
11
+ end
12
+
13
+ def test_context
14
+ pdf = PdfMaker::Base.new do
15
+ layout 'test/dummy/app/views/layouts/pdf'
16
+ renders 'test/dummy/app/views/users/profile'
17
+
18
+ variable :message, "Hello"
19
+ method :current_user, "Sean"
20
+ end
21
+
22
+ assert pdf
23
+ assert_equal "Hello", pdf.message
24
+ assert_equal "Sean", pdf.current_user
25
+ assert pdf.to_file("test/test_pdfs/test_pdf.pdf")
26
+ assert_equal "%PDF", File.read("test/test_pdfs/test_pdf.pdf")[0...4]
27
+ end
28
+
29
+ end
@@ -0,0 +1,15 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,235 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pdf_maker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sean Behan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70172942956260 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.7
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70172942956260
25
+ - !ruby/object:Gem::Dependency
26
+ name: pdfkit
27
+ requirement: &70172942955760 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 0.5.2
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70172942955760
36
+ - !ruby/object:Gem::Dependency
37
+ name: sprockets
38
+ requirement: &70172942955300 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 2.1.3
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70172942955300
47
+ - !ruby/object:Gem::Dependency
48
+ name: sass
49
+ requirement: &70172942954840 !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.20
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: *70172942954840
58
+ - !ruby/object:Gem::Dependency
59
+ name: wkhtmltopdf-binary
60
+ requirement: &70172942954380 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ version: 0.9.9.1
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: *70172942954380
69
+ - !ruby/object:Gem::Dependency
70
+ name: sass-rails
71
+ requirement: &70172942970300 !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: 3.2.3
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: *70172942970300
80
+ - !ruby/object:Gem::Dependency
81
+ name: coffee-rails
82
+ requirement: &70172942969840 !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ~>
86
+ - !ruby/object:Gem::Version
87
+ version: 3.2.1
88
+ type: :runtime
89
+ prerelease: false
90
+ version_requirements: *70172942969840
91
+ - !ruby/object:Gem::Dependency
92
+ name: therubyracer
93
+ requirement: &70172942969380 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
98
+ version: 0.9.10
99
+ type: :runtime
100
+ prerelease: false
101
+ version_requirements: *70172942969380
102
+ - !ruby/object:Gem::Dependency
103
+ name: uglifier
104
+ requirement: &70172942968920 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.3
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: *70172942968920
113
+ - !ruby/object:Gem::Dependency
114
+ name: sqlite3
115
+ requirement: &70172942968540 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *70172942968540
124
+ description: Turn your Rails actions/views into PDFs without a web browser
125
+ email:
126
+ - inbox@seanbehan.com
127
+ executables: []
128
+ extensions: []
129
+ extra_rdoc_files: []
130
+ files:
131
+ - lib/pdf_maker/version.rb
132
+ - lib/pdf_maker.rb
133
+ - lib/tasks/pdf_maker_tasks.rake
134
+ - MIT-LICENSE
135
+ - Rakefile
136
+ - README.md
137
+ - test/dummy/app/assets/javascripts/application.js
138
+ - test/dummy/app/assets/javascripts/tester.js.coffee
139
+ - test/dummy/app/assets/stylesheets/application.css
140
+ - test/dummy/app/assets/stylesheets/colors.css.scss
141
+ - test/dummy/app/controllers/application_controller.rb
142
+ - test/dummy/app/helpers/application_helper.rb
143
+ - test/dummy/app/views/layouts/application.html.erb
144
+ - test/dummy/app/views/layouts/pdf.html.erb
145
+ - test/dummy/app/views/users/profile.html.erb
146
+ - test/dummy/config/application.rb
147
+ - test/dummy/config/boot.rb
148
+ - test/dummy/config/database.yml
149
+ - test/dummy/config/environment.rb
150
+ - test/dummy/config/environments/development.rb
151
+ - test/dummy/config/environments/production.rb
152
+ - test/dummy/config/environments/test.rb
153
+ - test/dummy/config/initializers/backtrace_silencers.rb
154
+ - test/dummy/config/initializers/inflections.rb
155
+ - test/dummy/config/initializers/mime_types.rb
156
+ - test/dummy/config/initializers/secret_token.rb
157
+ - test/dummy/config/initializers/session_store.rb
158
+ - test/dummy/config/initializers/wrap_parameters.rb
159
+ - test/dummy/config/locales/en.yml
160
+ - test/dummy/config/routes.rb
161
+ - test/dummy/config.ru
162
+ - test/dummy/db/test.sqlite3
163
+ - test/dummy/log/development.log
164
+ - test/dummy/log/test.log
165
+ - test/dummy/public/404.html
166
+ - test/dummy/public/422.html
167
+ - test/dummy/public/500.html
168
+ - test/dummy/public/favicon.ico
169
+ - test/dummy/Rakefile
170
+ - test/dummy/README.rdoc
171
+ - test/dummy/script/rails
172
+ - test/pdf_maker_test.rb
173
+ - test/test_helper.rb
174
+ homepage: http://github.com/gristmill/pdf_maker
175
+ licenses: []
176
+ post_install_message:
177
+ rdoc_options: []
178
+ require_paths:
179
+ - lib
180
+ required_ruby_version: !ruby/object:Gem::Requirement
181
+ none: false
182
+ requirements:
183
+ - - ! '>='
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ required_rubygems_version: !ruby/object:Gem::Requirement
187
+ none: false
188
+ requirements:
189
+ - - ! '>='
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ requirements: []
193
+ rubyforge_project:
194
+ rubygems_version: 1.8.17
195
+ signing_key:
196
+ specification_version: 3
197
+ summary: PdfMaker builds PDFs from Rails templates.
198
+ test_files:
199
+ - test/dummy/app/assets/javascripts/application.js
200
+ - test/dummy/app/assets/javascripts/tester.js.coffee
201
+ - test/dummy/app/assets/stylesheets/application.css
202
+ - test/dummy/app/assets/stylesheets/colors.css.scss
203
+ - test/dummy/app/controllers/application_controller.rb
204
+ - test/dummy/app/helpers/application_helper.rb
205
+ - test/dummy/app/views/layouts/application.html.erb
206
+ - test/dummy/app/views/layouts/pdf.html.erb
207
+ - test/dummy/app/views/users/profile.html.erb
208
+ - test/dummy/config/application.rb
209
+ - test/dummy/config/boot.rb
210
+ - test/dummy/config/database.yml
211
+ - test/dummy/config/environment.rb
212
+ - test/dummy/config/environments/development.rb
213
+ - test/dummy/config/environments/production.rb
214
+ - test/dummy/config/environments/test.rb
215
+ - test/dummy/config/initializers/backtrace_silencers.rb
216
+ - test/dummy/config/initializers/inflections.rb
217
+ - test/dummy/config/initializers/mime_types.rb
218
+ - test/dummy/config/initializers/secret_token.rb
219
+ - test/dummy/config/initializers/session_store.rb
220
+ - test/dummy/config/initializers/wrap_parameters.rb
221
+ - test/dummy/config/locales/en.yml
222
+ - test/dummy/config/routes.rb
223
+ - test/dummy/config.ru
224
+ - test/dummy/db/test.sqlite3
225
+ - test/dummy/log/development.log
226
+ - test/dummy/log/test.log
227
+ - test/dummy/public/404.html
228
+ - test/dummy/public/422.html
229
+ - test/dummy/public/500.html
230
+ - test/dummy/public/favicon.ico
231
+ - test/dummy/Rakefile
232
+ - test/dummy/README.rdoc
233
+ - test/dummy/script/rails
234
+ - test/pdf_maker_test.rb
235
+ - test/test_helper.rb