prawnto_2 0.2.6 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.rdoc +14 -15
  4. data/Rakefile +1 -8
  5. data/lib/prawnto.rb +1 -0
  6. data/lib/prawnto/compile_support.rb +1 -1
  7. metadata +44 -179
  8. data/.gitignore +0 -8
  9. data/.travis.yml +0 -5
  10. data/Appraisals +0 -7
  11. data/Gemfile +0 -13
  12. data/Guardfile +0 -15
  13. data/prawnto.gemspec +0 -22
  14. data/rails/init.rb +0 -1
  15. data/script/rails +0 -6
  16. data/spec/assets/1.8/default_render-0.12.0.pdf +0 -83
  17. data/spec/assets/1.8/default_render-0.6.3.pdf +0 -83
  18. data/spec/assets/1.8/dsl_render-0.12.0.pdf +0 -83
  19. data/spec/assets/1.8/dsl_render-0.6.3.pdf +0 -85
  20. data/spec/assets/1.8/partial_render-0.12.0.pdf +0 -83
  21. data/spec/assets/1.8/partial_render-0.6.3.pdf +0 -85
  22. data/spec/assets/1.8/yield_block_in_helper_test-0.12.0.pdf +0 -76
  23. data/spec/assets/1.8/yield_block_in_helper_test-0.6.3.pdf +0 -78
  24. data/spec/assets/1.9/default_render-0.12.0.pdf +0 -83
  25. data/spec/assets/1.9/default_render-0.6.3.pdf +0 -85
  26. data/spec/assets/1.9/dsl_render-0.12.0.pdf +0 -83
  27. data/spec/assets/1.9/dsl_render-0.6.3.pdf +0 -85
  28. data/spec/assets/1.9/partial_render-0.12.0.pdf +0 -83
  29. data/spec/assets/1.9/partial_render-0.6.3.pdf +0 -85
  30. data/spec/assets/1.9/yield_block_in_helper_test-0.12.0.pdf +0 -76
  31. data/spec/assets/1.9/yield_block_in_helper_test-0.6.3.pdf +0 -78
  32. data/spec/dummy/.rspec +0 -1
  33. data/spec/dummy/.sass-cache/387f7b3fde13680ae5a79212c089f81d2d418f1e/application.css.scssc +0 -0
  34. data/spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/_shared.css.scssc +0 -0
  35. data/spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/ab_tests.css.scssc +0 -0
  36. data/spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/application.css.scssc +0 -0
  37. data/spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/metrics.css.scssc +0 -0
  38. data/spec/dummy/.sass-cache/6a18c557e07dbc07a14d0809be02d4f21f1dbe91/reports.css.scssc +0 -0
  39. data/spec/dummy/Rakefile +0 -7
  40. data/spec/dummy/app/assets/javascripts/application.js +0 -10
  41. data/spec/dummy/app/assets/javascripts/highcharts.js +0 -170
  42. data/spec/dummy/app/assets/stylesheets/application.css.scss +0 -78
  43. data/spec/dummy/app/controllers/application_controller.rb +0 -3
  44. data/spec/dummy/app/controllers/test_controller.rb +0 -32
  45. data/spec/dummy/app/helpers/application_helper.rb +0 -18
  46. data/spec/dummy/app/mailers/.gitkeep +0 -0
  47. data/spec/dummy/app/mailers/pdf_emailer.rb +0 -14
  48. data/spec/dummy/app/models/.gitkeep +0 -0
  49. data/spec/dummy/app/models/super_model.rb +0 -8
  50. data/spec/dummy/app/views/layouts/application.html.erb +0 -23
  51. data/spec/dummy/app/views/pdf_emailer/email_with_attachment.text.erb +0 -1
  52. data/spec/dummy/app/views/test/_simple_partial.pdf.prawn +0 -1
  53. data/spec/dummy/app/views/test/default_render.pdf.prawn +0 -3
  54. data/spec/dummy/app/views/test/dsl_render.pdf.prawn +0 -3
  55. data/spec/dummy/app/views/test/instance_var_test.pdf.prawn +0 -15
  56. data/spec/dummy/app/views/test/partial_render.pdf.prawn +0 -3
  57. data/spec/dummy/app/views/test/yield_block_in_helper_test.pdf.prawn +0 -4
  58. data/spec/dummy/config.ru +0 -4
  59. data/spec/dummy/config/application.rb +0 -49
  60. data/spec/dummy/config/boot.rb +0 -10
  61. data/spec/dummy/config/environment.rb +0 -5
  62. data/spec/dummy/config/environments/development.rb +0 -30
  63. data/spec/dummy/config/environments/production.rb +0 -60
  64. data/spec/dummy/config/environments/test.rb +0 -39
  65. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  66. data/spec/dummy/config/initializers/inflections.rb +0 -10
  67. data/spec/dummy/config/initializers/mime_types.rb +0 -5
  68. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  69. data/spec/dummy/config/initializers/session_store.rb +0 -8
  70. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  71. data/spec/dummy/config/locales/en.yml +0 -5
  72. data/spec/dummy/config/routes.rb +0 -8
  73. data/spec/dummy/lib/assets/.gitkeep +0 -0
  74. data/spec/dummy/public/404.html +0 -26
  75. data/spec/dummy/public/422.html +0 -26
  76. data/spec/dummy/public/500.html +0 -26
  77. data/spec/dummy/public/favicon.ico +0 -0
  78. data/spec/dummy/public/index.html +0 -13
  79. data/spec/dummy/script/delayed_job +0 -5
  80. data/spec/dummy/script/rails +0 -6
  81. data/spec/integrations/pdf_emailer_spec.rb +0 -21
  82. data/spec/integrations/super_model_spec.rb +0 -16
  83. data/spec/integrations/test_controller_spec.rb +0 -60
  84. data/spec/spec_helper.rb +0 -33
  85. data/spec/units/action_controller_mixin_spec.rb +0 -48
  86. data/spec/units/compile_support_spec.rb +0 -50
  87. data/spec/units/template_handlers/partials_spec.rb +0 -68
  88. data/spec/units/template_handlers/renderer_spec.rb +0 -4
@@ -1,78 +0,0 @@
1
- html, body {
2
- background-color: #4B7399;
3
- font-family: Verdana, Helvetica, Arial;
4
- font-size: 14px;
5
- }
6
-
7
- #container {
8
- width: 75%;
9
- margin: 0 auto;
10
- background-color: #FFF;
11
- padding: 20px 40px;
12
- border: solid 1px black;
13
- margin-top: 20px;
14
- }
15
-
16
- #flash_notice, #flash_error, #flash_alert {
17
- padding: 5px 8px;
18
- margin: 10px 0;
19
- }
20
-
21
- #flash_notice {
22
- background-color: #CFC;
23
- border: solid 1px #6C6;
24
- }
25
-
26
- #flash_error, #flash_alert {
27
- background-color: #FCC;
28
- border: solid 1px #C66;
29
- }
30
-
31
- p, ol, ul, td {
32
- font-family: verdana, arial, helvetica, sans-serif;
33
- font-size: 13px;
34
- line-height: 18px; }
35
-
36
- pre {
37
- background-color: #eee;
38
- padding: 10px;
39
- font-size: 11px; }
40
-
41
- a {
42
- color: #000;
43
- &:visited {
44
- color: #666; }
45
- &:hover {
46
- color: #fff;
47
- background-color: #000; } }
48
-
49
- div {
50
- &.field, &.actions {
51
- margin-bottom: 10px; } }
52
-
53
- #notice { color: green; }
54
-
55
- form .field_with_errors { display:inline;
56
- label { color:red; }
57
- input { color:red; border-color:red;}
58
- }
59
-
60
- #error_explanation {
61
- width: 450px;
62
- border: 2px solid red;
63
- padding: 7px;
64
- padding-bottom: 0;
65
- margin-bottom: 20px;
66
- background-color: #f0f0f0;
67
- h2 {
68
- text-align: left;
69
- font-weight: bold;
70
- padding: 5px 5px 5px 15px;
71
- font-size: 12px;
72
- margin: -7px;
73
- margin-bottom: 0px;
74
- background-color: #c00;
75
- color: #fff; }
76
- ul li {
77
- font-size: 12px;
78
- list-style: square; } }
@@ -1,3 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
@@ -1,32 +0,0 @@
1
- class TestController < ApplicationController
2
-
3
- def default_render
4
- @x = 1
5
- render :action => "default_render"
6
- end
7
-
8
- def dsl_render
9
- @x = 1
10
- render :action => "dsl_render"
11
- end
12
-
13
- def instance_var_test
14
- @x = 1
15
- render :action => "instance_var_test"
16
- end
17
-
18
- def yield_block_in_helper_test
19
- render :action => "yield_block_in_helper_test"
20
- end
21
-
22
- def partial_render
23
- @x = 1
24
- render :action => "partial_render"
25
- end
26
-
27
- def filename_test
28
- prawnto :filename => "fancy_name.pdf", :inline => false
29
- render :action => "default_render"
30
- end
31
-
32
- end
@@ -1,18 +0,0 @@
1
- module ApplicationHelper
2
- def some_helper
3
- "this is from a helper"
4
- end
5
-
6
- def x_output_helper
7
- @x.to_s
8
- end
9
-
10
- def set_x_to_3_in_helper
11
- @x = 3
12
- end
13
-
14
- def yield_this_block
15
- yield
16
- end
17
-
18
- end
File without changes
@@ -1,14 +0,0 @@
1
- class PdfEmailer < ActionMailer::Base
2
- helper :application
3
- default :from => "from@example.com"
4
-
5
- def email_with_attachment
6
- @x = 1
7
-
8
- attachments["hello_world.pdf"] = render("test/default_render", :format => :pdf)
9
- mail :subject => "Hello", :to => "test@test.com" do |format|
10
- format.text
11
- end
12
- end
13
-
14
- end
File without changes
@@ -1,8 +0,0 @@
1
- class SuperModel
2
-
3
- def to_pdf
4
- @x = 1
5
- Prawnto::ModelRenderer.to_string "test/default_render", self
6
- end
7
-
8
- end
@@ -1,23 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application" %>
6
- <%= javascript_include_tag "application" %>
7
-
8
- <%= yield :extra_scripts_and_styles %>
9
-
10
- <%= csrf_meta_tags %>
11
- </head>
12
- <body>
13
-
14
- <div id="container">
15
- <% flash.each do |name, msg| %>
16
- <%= content_tag :div, msg, :id => "flash_#{name}", :class => "flash clearfix hide_for_print" %>
17
- <% end %>
18
-
19
- <%= yield %>
20
- </div>
21
-
22
- </body>
23
- </html>
@@ -1 +0,0 @@
1
- Please see attached PDF
@@ -1 +0,0 @@
1
- text "inside partial"
@@ -1,3 +0,0 @@
1
- pdf.text "Hello World!"
2
- pdf.text "instance variable @x = #{@x}"
3
- pdf.text "helper methods work : #{some_helper}"
@@ -1,3 +0,0 @@
1
- text "Hello World! - DSL"
2
- text "instance variable @x = #{@x}"
3
- text "helper methods work : #{some_helper}"
@@ -1,15 +0,0 @@
1
- text "Complex Example"
2
- text "@x = #{@x}"
3
- @x = 2
4
- text x_output_helper
5
-
6
- if @x.to_s != x_output_helper
7
- raise "Variable did not carry over"
8
- end
9
-
10
- set_x_to_3_in_helper
11
-
12
- if @x != 3
13
- raise "Variable did not carry over"
14
- end
15
-
@@ -1,3 +0,0 @@
1
- text "before partial"
2
- partial! "test/simple_partial"
3
- text "after partial"
@@ -1,4 +0,0 @@
1
- text "test 1"
2
- yield_this_block {
3
- text "test 2"
4
- }
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,49 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require "action_controller/railtie"
4
- require "action_mailer/railtie"
5
- require "active_resource/railtie"
6
- require "rails/test_unit/railtie"
7
- require "sprockets/railtie"
8
-
9
- Bundler.require
10
- require "prawnto"
11
-
12
- module Dummy
13
- class Application < Rails::Application
14
- # Settings in config/environments/* take precedence over those specified here.
15
- # Application configuration should go into files in config/initializers
16
- # -- all .rb files in that directory are automatically loaded.
17
-
18
- # Custom directories with classes and modules you want to be autoloadable.
19
- # config.autoload_paths += %W(#{config.root}/extras)
20
-
21
- # Only load the plugins named here, in the order given (default is alphabetical).
22
- # :all can be used as a placeholder for all plugins not explicitly named.
23
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
-
25
- # Activate observers that should always be running.
26
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
-
28
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
- # config.time_zone = 'Central Time (US & Canada)'
31
-
32
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
- # config.i18n.default_locale = :de
35
-
36
- # Configure the default encoding used in templates for Ruby 1.9.
37
- config.encoding = "utf-8"
38
-
39
- # Configure sensitive parameters which will be filtered from the log file.
40
- config.filter_parameters += [:password]
41
-
42
- # Enable the asset pipeline
43
- config.assets.enabled = true
44
-
45
- # Version of your assets, change this if you want to expire all your assets
46
- config.assets.version = '1.0'
47
- end
48
- end
49
-
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
@@ -1,30 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger
20
- config.active_support.deprecation = :log
21
-
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
24
-
25
- # Do not compress assets
26
- config.assets.compress = false
27
-
28
- # Expands the lines which load the assets
29
- config.assets.debug = true
30
- end
@@ -1,60 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Full error reports are disabled and caching is turned on
8
- config.consider_all_requests_local = false
9
- config.action_controller.perform_caching = true
10
-
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
12
- config.serve_static_assets = false
13
-
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
16
-
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
18
- config.assets.compile = false
19
-
20
- # Generate digests for assets URLs
21
- config.assets.digest = true
22
-
23
- # Defaults to Rails.root.join("public/assets")
24
- # config.assets.manifest = YOUR_PATH
25
-
26
- # Specifies the header that your server uses for sending files
27
- # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
-
30
- # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
- # config.force_ssl = true
32
-
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
35
-
36
- # Use a different logger for distributed setups
37
- # config.logger = SyslogLogger.new
38
-
39
- # Use a different cache store in production
40
- # config.cache_store = :mem_cache_store
41
-
42
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
43
- # config.action_controller.asset_host = "http://assets.example.com"
44
-
45
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
46
- # config.assets.precompile += %w( search.js )
47
-
48
- # Disable delivery errors, bad email addresses will be ignored
49
- # config.action_mailer.raise_delivery_errors = false
50
-
51
- # Enable threaded mode
52
- # config.threadsafe!
53
-
54
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
55
- # the I18n.default_locale when a translation can not be found)
56
- config.i18n.fallbacks = true
57
-
58
- # Send deprecation notices to registered listeners
59
- config.active_support.deprecation = :notify
60
- end
@@ -1,39 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Configure static asset server for tests with Cache-Control for performance
11
- config.serve_static_assets = true
12
- config.static_cache_control = "public, max-age=3600"
13
-
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
16
-
17
- # Show full error reports and disable caching
18
- config.consider_all_requests_local = true
19
- config.action_controller.perform_caching = false
20
-
21
- # Raise exceptions instead of rendering exception templates
22
- config.action_dispatch.show_exceptions = false
23
-
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
-
27
- # Tell Action Mailer not to deliver emails to the real world.
28
- # The :test delivery method accumulates sent emails in the
29
- # ActionMailer::Base.deliveries array.
30
- config.action_mailer.delivery_method = :test
31
-
32
- # Use SQL instead of Active Record's schema dumper when creating the test database.
33
- # This is necessary if your schema can't be completely dumped by the schema dumper,
34
- # like if you have constraints or database-specific column types
35
- # config.active_record.schema_format = :sql
36
-
37
- # Print deprecation notices to the stderr
38
- config.active_support.deprecation = :stderr
39
- end
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!