rails-latex 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/examples/rails-latex-demo/Gemfile +1 -1
  3. data/examples/rails-latex-demo/Rakefile +2 -3
  4. data/examples/rails-latex-demo/app/controllers/application_controller.rb +1 -1
  5. data/examples/rails-latex-demo/app/views/latex_example/barcode.pdf.erb +1 -3
  6. data/examples/rails-latex-demo/app/views/layouts/application.html.erb +8 -7
  7. data/examples/rails-latex-demo/app/views/layouts/barcode.pdf.erbtex +4 -1
  8. data/examples/rails-latex-demo/bin/bundle +3 -0
  9. data/examples/rails-latex-demo/bin/rails +4 -0
  10. data/examples/rails-latex-demo/bin/rake +4 -0
  11. data/examples/rails-latex-demo/bin/setup +34 -0
  12. data/examples/rails-latex-demo/bin/update +29 -0
  13. data/examples/rails-latex-demo/config.ru +3 -2
  14. data/examples/rails-latex-demo/config/application.rb +12 -34
  15. data/examples/rails-latex-demo/config/boot.rb +2 -12
  16. data/examples/rails-latex-demo/config/environment.rb +4 -4
  17. data/examples/rails-latex-demo/config/environments/development.rb +29 -16
  18. data/examples/rails-latex-demo/config/environments/production.rb +45 -28
  19. data/examples/rails-latex-demo/config/environments/test.rb +22 -21
  20. data/examples/rails-latex-demo/config/initializers/application_controller_renderer.rb +6 -0
  21. data/examples/rails-latex-demo/config/initializers/cookies_serializer.rb +5 -0
  22. data/examples/rails-latex-demo/config/initializers/filter_parameter_logging.rb +4 -0
  23. data/examples/rails-latex-demo/config/initializers/inflections.rb +9 -3
  24. data/examples/rails-latex-demo/config/initializers/mime_types.rb +0 -2
  25. data/examples/rails-latex-demo/config/initializers/new_framework_defaults.rb +21 -0
  26. data/examples/rails-latex-demo/config/initializers/session_store.rb +1 -6
  27. data/examples/rails-latex-demo/config/initializers/wrap_parameters.rb +9 -0
  28. data/examples/rails-latex-demo/config/locales/en.yml +20 -2
  29. data/examples/rails-latex-demo/config/routes.rb +4 -4
  30. data/examples/rails-latex-demo/config/secrets.yml +22 -0
  31. data/examples/rails-latex-demo/public/404.html +67 -0
  32. data/examples/rails-latex-demo/public/422.html +67 -0
  33. data/examples/rails-latex-demo/public/500.html +66 -0
  34. data/examples/rails-latex-demo/public/apple-touch-icon-precomposed.png +0 -0
  35. data/examples/rails-latex-demo/public/apple-touch-icon.png +0 -0
  36. data/examples/rails-latex-demo/public/robots.txt +5 -0
  37. data/lib/rails-latex/version.rb +1 -1
  38. data/rails-latex.gemspec +2 -2
  39. metadata +23 -11
  40. data/examples/rails-latex-demo/README +0 -256
  41. data/examples/rails-latex-demo/config/initializers/secret_token.rb +0 -7
  42. data/examples/rails-latex-demo/script/rails +0 -6
  43. data/examples/rails-latex-demo/test/functional/latex_example_controller_test.rb +0 -9
  44. data/examples/rails-latex-demo/test/unit/helpers/latex_example_helper_test.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5309d586b2ef3b9af95eb0c66e120d4c523773b6
4
- data.tar.gz: 93a2ad21871df64a11416a0a26bebae2d059fda2
3
+ metadata.gz: b4a58a2e53aa24c145c576d73874442e6799dd68
4
+ data.tar.gz: 9d906c68f010aa291ce64f8e1ab6c35e8919c816
5
5
  SHA512:
6
- metadata.gz: f942c7f3a80b5e93e4b064bfbbe1adf796a1022df665e2a1b024f482757ea84edad578b01d8402dc3e6f9c9c3745880c647c8d550cb3a3c13f3fd23ee44b3acd
7
- data.tar.gz: c8680b6ced9aa002404e4a6969c8c88d23e29e7147041ab1a678da4123d8a35bb0663d99bbbc13141d6e886a6c8adf2afd4cf92f51356eafc8e91aecc2e40711
6
+ metadata.gz: efbf6f4dae0cf37ddc6e43f927864f4fa7f00b388ad5e1de478940ec7efd5e4b9f9cadae401bb3b9677b677ff4d35ebae5cdcdca308a1c5fd1c1ca2db9882eda
7
+ data.tar.gz: 99dbca3cd469ffcd4b5285b97c115bf753d84c3b30326394fbe0dae0328744b84e4ca872f8d4a90ca4efe8a72033cdcf8181fcac7a914af166343cbf2b7bc37c
@@ -1,5 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '~> 3.2'
3
+ gem 'rails', '~> 5'
4
4
 
5
5
  gem 'rails-latex', :path => '../../'
@@ -1,7 +1,6 @@
1
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
2
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
3
 
4
- require File.expand_path('../config/application', __FILE__)
5
- require 'rake'
4
+ require_relative 'config/application'
6
5
 
7
- RailsLatexDemo::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -1,3 +1,3 @@
1
1
  class ApplicationController < ActionController::Base
2
- protect_from_forgery
2
+ protect_from_forgery with: :exception
3
3
  end
@@ -1,7 +1,5 @@
1
1
  {\titlefont \huge Sample Barcodes}
2
2
 
3
- More examples \& full documentation of the pst-barcode package can be found \href{http://mirrors.ctan.org/graphics/pstricks/contrib/pst-barcode/pst-barcode-doc.pdf}{here}.
4
-
5
3
  \section*{Code-39}
6
4
 
7
5
  \begin{pspicture}(3,1in)
@@ -11,7 +9,7 @@ More examples \& full documentation of the pst-barcode package can be found \hre
11
9
  \section*{EAN-8}
12
10
 
13
11
  \begin{pspicture}(2.5,1in)
14
- \psbarcode{12345678}{includetext}{ean8}
12
+ \psbarcode{96385074}{includetext}{ean8}
15
13
  \end{pspicture}
16
14
 
17
15
  \section*{EAN-13}
@@ -1,12 +1,13 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <title>RailsLatexDemo</title>
5
- <%= csrf_meta_tag %>
6
- </head>
7
- <body>
3
+ <head>
4
+ <title>Rails5LatexDemo</title>
5
+ <%= csrf_meta_tags %>
8
6
 
9
- <%= yield %>
7
+ <%= stylesheet_link_tag 'application', media: 'all' %>
8
+ </head>
10
9
 
11
- </body>
10
+ <body>
11
+ <%= yield %>
12
+ </body>
12
13
  </html>
@@ -1,6 +1,9 @@
1
1
  \documentclass{scrartcl}
2
+ <% @latex_config = { :recipe => [
3
+ {:command => 'xelatex'},
4
+ ]} # you can override the defaults if you wish; see LatexToPdf#config
5
+ %>
2
6
 
3
- \usepackage{auto-pst-pdf}
4
7
  \usepackage{pst-barcode}
5
8
  \usepackage{hyperref}
6
9
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # puts "\n== Copying sample files =="
22
+ # unless File.exist?('config/database.yml')
23
+ # cp 'config/database.yml.sample', 'config/database.yml'
24
+ # end
25
+
26
+ puts "\n== Preparing database =="
27
+ system! 'bin/rails db:setup'
28
+
29
+ puts "\n== Removing old logs and tempfiles =="
30
+ system! 'bin/rails log:clear tmp:clear'
31
+
32
+ puts "\n== Restarting application server =="
33
+ system! 'bin/rails restart'
34
+ end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
@@ -1,4 +1,5 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run RailsLatexDemo::Application
3
+ require_relative 'config/environment'
4
+
5
+ run Rails.application
@@ -1,47 +1,25 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
+ require "rails"
3
4
  # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
4
7
  # require "active_record/railtie"
5
8
  require "action_controller/railtie"
6
- require "action_mailer/railtie"
7
- require "active_resource/railtie"
8
- require "rails/test_unit/railtie"
9
+ # require "action_mailer/railtie"
10
+ require "action_view/railtie"
11
+ # require "action_cable/engine"
12
+ # require "sprockets/railtie"
13
+ # require "rails/test_unit/railtie"
9
14
 
10
- # If you have a Gemfile, require the gems listed there, including any gems
15
+ # Require the gems listed in Gemfile, including any gems
11
16
  # you've limited to :test, :development, or :production.
12
- Bundler.require(:default, Rails.env) if defined?(Bundler)
17
+ Bundler.require(*Rails.groups)
13
18
 
14
- module RailsLatexDemo
19
+ module Rails5LatexDemo
15
20
  class Application < Rails::Application
16
21
  # Settings in config/environments/* take precedence over those specified here.
17
22
  # Application configuration should go into files in config/initializers
18
23
  # -- all .rb files in that directory are automatically loaded.
19
-
20
- # Custom directories with classes and modules you want to be autoloadable.
21
- # config.autoload_paths += %W(#{config.root}/extras)
22
-
23
- # Only load the plugins named here, in the order given (default is alphabetical).
24
- # :all can be used as a placeholder for all plugins not explicitly named.
25
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
-
27
- # Activate observers that should always be running.
28
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
29
-
30
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
31
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
32
- # config.time_zone = 'Central Time (US & Canada)'
33
-
34
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
35
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
36
- # config.i18n.default_locale = :de
37
-
38
- # JavaScript files you want as :defaults (application.js is always included).
39
- config.action_view.javascript_expansions[:defaults] = %w()
40
-
41
- # Configure the default encoding used in templates for Ruby 1.9.
42
- config.encoding = "utf-8"
43
-
44
- # Configure sensitive parameters which will be filtered from the log file.
45
- config.filter_parameters += [:password]
46
24
  end
47
25
  end
@@ -1,13 +1,3 @@
1
- require 'rubygems'
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
2
 
3
- # Set up gems listed in the Gemfile.
4
- gemfile = File.expand_path('../../Gemfile', __FILE__)
5
- begin
6
- ENV['BUNDLE_GEMFILE'] = gemfile
7
- require 'bundler'
8
- Bundler.setup
9
- rescue Bundler::GemNotFound => e
10
- STDERR.puts e.message
11
- STDERR.puts "Try running `bundle install`."
12
- exit!
13
- end if File.exist?(gemfile)
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -1,5 +1,5 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
3
 
4
- # Initialize the rails application
5
- RailsLatexDemo::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,26 +1,39 @@
1
- RailsLatexDemo::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
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 webserver when you make code changes.
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
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
13
- config.consider_all_requests_local = true
14
- # config.action_view.debug_rjs = true
15
- config.action_controller.perform_caching = false
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
16
14
 
17
- # Don't care if the mailer can't send
18
- config.action_mailer.raise_delivery_errors = false
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
19
18
 
20
- # Print deprecation notices to the Rails logger
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => 'public, max-age=172800'
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
28
+
29
+ # Print deprecation notices to the Rails logger.
21
30
  config.active_support.deprecation = :log
22
31
 
23
- # Only use best-standards-support built into browsers
24
- config.action_dispatch.best_standards_support = :builtin
25
- end
26
32
 
33
+ # Raises error for missing translations
34
+ # config.action_view.raise_on_missing_translations = true
35
+
36
+ # Use an evented file watcher to asynchronously detect changes in source code,
37
+ # routes, locales, etc. This feature depends on the listen gem.
38
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
39
+ end
@@ -1,49 +1,66 @@
1
- RailsLatexDemo::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # The production environment is meant for finished, "live" apps.
5
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
6
5
  config.cache_classes = true
7
6
 
8
- # Full error reports are disabled and caching is turned on
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
9
14
  config.consider_all_requests_local = false
10
15
  config.action_controller.perform_caching = true
11
16
 
12
- # Specifies the header that your server uses for sending files
13
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
17
+ # Disable serving static files from the `/public` folder by default since
18
+ # Apache or NGINX already handles this.
19
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
14
20
 
15
- # For nginx:
16
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
21
 
18
- # If you have no front-end server that supports something like X-Sendfile,
19
- # just comment this out and Rails will serve the files
22
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
23
+ # config.action_controller.asset_host = 'http://assets.example.com'
20
24
 
21
- # See everything in the log (default is :info)
22
- # config.log_level = :debug
25
+ # Specifies the header that your server uses for sending files.
26
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
27
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
23
28
 
24
- # Use a different logger for distributed setups
25
- # config.logger = SyslogLogger.new
26
29
 
27
- # Use a different cache store in production
28
- # config.cache_store = :mem_cache_store
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
29
32
 
30
- # Disable Rails's static asset server
31
- # In production, Apache or nginx will already do this
32
- config.serve_static_assets = false
33
+ # Use the lowest log level to ensure availability of diagnostic information
34
+ # when problems arise.
35
+ config.log_level = :debug
33
36
 
34
- # Enable serving of images, stylesheets, and javascripts from an asset server
35
- # config.action_controller.asset_host = "http://assets.example.com"
37
+ # Prepend all log lines with the following tags.
38
+ config.log_tags = [ :request_id ]
36
39
 
37
- # Disable delivery errors, bad email addresses will be ignored
38
- # config.action_mailer.raise_delivery_errors = false
40
+ # Use a different cache store in production.
41
+ # config.cache_store = :mem_cache_store
39
42
 
40
- # Enable threaded mode
41
- # config.threadsafe!
43
+ # Use a real queuing backend for Active Job (and separate queues per environment)
44
+ # config.active_job.queue_adapter = :resque
45
+ # config.active_job.queue_name_prefix = "rails-5-latex-demo_#{Rails.env}"
42
46
 
43
47
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
- # the I18n.default_locale when a translation can not be found)
48
+ # the I18n.default_locale when a translation cannot be found).
45
49
  config.i18n.fallbacks = true
46
50
 
47
- # Send deprecation notices to registered listeners
51
+ # Send deprecation notices to registered listeners.
48
52
  config.active_support.deprecation = :notify
53
+
54
+ # Use default logging formatter so that PID and timestamp are not suppressed.
55
+ config.log_formatter = ::Logger::Formatter.new
56
+
57
+ # Use a different logger for distributed setups.
58
+ # require 'syslog/logger'
59
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
60
+
61
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
62
+ logger = ActiveSupport::Logger.new(STDOUT)
63
+ logger.formatter = config.log_formatter
64
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
65
+ end
49
66
  end
@@ -1,35 +1,36 @@
1
- RailsLatexDemo::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
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
5
+ # test suite. You never need to work with it otherwise. Remember that
6
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!
7
+ # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
9
 
10
- # Log error messages when you accidentally call methods on nil.
11
- config.whiny_nils = true
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
12
14
 
13
- # Show full error reports and disable caching
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => 'public, max-age=3600'
19
+ }
20
+
21
+ # Show full error reports and disable caching.
14
22
  config.consider_all_requests_local = true
15
23
  config.action_controller.perform_caching = false
16
24
 
17
- # Raise exceptions instead of rendering exception templates
25
+ # Raise exceptions instead of rendering exception templates.
18
26
  config.action_dispatch.show_exceptions = false
19
27
 
20
- # Disable request forgery protection in test environment
21
- config.action_controller.allow_forgery_protection = false
22
-
23
- # Tell Action Mailer not to deliver emails to the real world.
24
- # The :test delivery method accumulates sent emails in the
25
- # ActionMailer::Base.deliveries array.
26
- config.action_mailer.delivery_method = :test
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
27
30
 
28
- # Use SQL instead of Active Record's schema dumper when creating the test database.
29
- # This is necessary if your schema can't be completely dumped by the schema dumper,
30
- # like if you have constraints or database-specific column types
31
- # config.active_record.schema_format = :sql
32
-
33
- # Print deprecation notices to the stderr
31
+ # Print deprecation notices to the stderr.
34
32
  config.active_support.deprecation = :stderr
33
+
34
+ # Raises error for missing translations
35
+ # config.action_view.raise_on_missing_translations = true
35
36
  end