fine_print 1.3.0 → 1.4.1

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.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +56 -44
  3. data/app/controllers/fine_print/application_controller.rb +0 -3
  4. data/app/models/fine_print/contract.rb +9 -8
  5. data/app/models/fine_print/signature.rb +1 -1
  6. data/config/initializers/fine_print.rb +20 -16
  7. data/db/migrate/0_install_fine_print.rb +4 -3
  8. data/lib/fine_print/controller_includes.rb +114 -0
  9. data/lib/fine_print/version.rb +1 -1
  10. data/lib/fine_print.rb +20 -24
  11. data/spec/controllers/contracts_controller_spec.rb +38 -36
  12. data/spec/controllers/home_controller_spec.rb +4 -4
  13. data/spec/controllers/signatures_controller_spec.rb +8 -8
  14. data/spec/dummy/Rakefile +0 -1
  15. data/spec/dummy/app/assets/javascripts/application.js +3 -5
  16. data/spec/dummy/app/views/layouts/application.html.erb +2 -2
  17. data/spec/dummy/bin/bundle +3 -0
  18. data/spec/dummy/bin/rails +4 -0
  19. data/spec/dummy/bin/rake +4 -0
  20. data/spec/dummy/config/application.rb +3 -37
  21. data/spec/dummy/config/boot.rb +4 -9
  22. data/spec/dummy/config/environment.rb +2 -2
  23. data/spec/dummy/config/environments/development.rb +11 -19
  24. data/spec/dummy/config/environments/production.rb +40 -27
  25. data/spec/dummy/config/environments/test.rb +13 -14
  26. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  27. data/spec/dummy/config/initializers/fine_print.rb +1 -34
  28. data/spec/dummy/config/initializers/inflections.rb +6 -5
  29. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  30. data/spec/dummy/config/initializers/session_store.rb +1 -6
  31. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  32. data/spec/dummy/config/locales/en.yml +20 -2
  33. data/spec/dummy/config/routes.rb +2 -1
  34. data/spec/dummy/config.ru +1 -1
  35. data/spec/dummy/db/development.sqlite3 +0 -0
  36. data/spec/dummy/db/schema.rb +21 -21
  37. data/spec/dummy/db/test.sqlite3 +0 -0
  38. data/spec/dummy/log/development.log +15 -1849
  39. data/spec/dummy/log/test.log +10536 -53785
  40. data/spec/dummy/public/404.html +43 -11
  41. data/spec/dummy/public/422.html +43 -11
  42. data/spec/dummy/public/500.html +43 -11
  43. data/spec/factories/contract.rb +2 -2
  44. data/spec/lib/fine_print/{controller_additions_spec.rb → controller_includes_spec.rb} +16 -6
  45. metadata +104 -166
  46. data/app/assets/javascripts/application.js~ +0 -16
  47. data/app/controllers/fine_print/application_controller.rb~ +0 -15
  48. data/app/controllers/fine_print/contracts_controller.rb~ +0 -79
  49. data/app/controllers/fine_print/home_controller.rb~ +0 -6
  50. data/app/controllers/fine_print/signatures_controller.rb~ +0 -14
  51. data/app/helpers/fine_print/application_helper.rb~ +0 -7
  52. data/app/helpers/fine_print/contracts_helper.rb~ +0 -7
  53. data/app/models/fine_print/contract.rb~ +0 -100
  54. data/app/models/fine_print/signature.rb~ +0 -25
  55. data/app/views/fine_print/contracts/_form.html.erb~ +0 -35
  56. data/app/views/fine_print/contracts/index.html.erb~ +0 -43
  57. data/app/views/fine_print/contracts/show.html.erb~ +0 -35
  58. data/app/views/fine_print/home/index.html.erb~ +0 -15
  59. data/app/views/fine_print/signatures/index.html.erb~ +0 -32
  60. data/app/views/layouts/fine_print/application.html.erb~ +0 -20
  61. data/config/initializers/fine_print.rb~ +0 -36
  62. data/config/routes.rb~ +0 -12
  63. data/db/migrate/0_install_fine_print.rb~ +0 -26
  64. data/lib/fine_print/controller_additions.rb +0 -80
  65. data/lib/fine_print/controller_additions.rb~ +0 -86
  66. data/lib/fine_print/utilities.rb~ +0 -26
  67. data/lib/fine_print/version.rb~ +0 -3
  68. data/lib/fine_print.rb~ +0 -120
  69. data/spec/controllers/contracts_controller_spec.rb~ +0 -224
  70. data/spec/controllers/home_controller_spec.rb~ +0 -25
  71. data/spec/controllers/signatures_controller_spec.rb~ +0 -46
  72. data/spec/dummy/app/controllers/dummy_models_controller.rb~ +0 -29
  73. data/spec/dummy/app/models/dummy_user.rb~ +0 -4
  74. data/spec/dummy/app/models/user.rb~ +0 -78
  75. data/spec/dummy/config/application.rb~ +0 -60
  76. data/spec/dummy/config/initializers/fine_print.rb~ +0 -36
  77. data/spec/dummy/config/initializers/session_store.rb~ +0 -8
  78. data/spec/dummy/config/initializers/wrap_parameters.rb~ +0 -14
  79. data/spec/dummy/config/routes.rb~ +0 -4
  80. data/spec/dummy/db/migrate/1_create_dummy_users.rb~ +0 -8
  81. data/spec/dummy/script/rails +0 -6
  82. data/spec/factories/contract.rb~ +0 -26
  83. data/spec/factories/dummy_user.rb~ +0 -6
  84. data/spec/factories/signature.rb~ +0 -8
  85. data/spec/factories/user.rb~ +0 -6
  86. data/spec/fine_print_spec.rb~ +0 -18
  87. data/spec/lib/fine_print/controller_additions_spec.rb~ +0 -20
  88. data/spec/lib/fine_print_spec.rb~ +0 -47
  89. data/spec/models/contract_spec.rb~ +0 -80
  90. data/spec/models/signature_spec.rb~ +0 -28
  91. data/spec/spec_helper.rb~ +0 -32
  92. data/spec/test_helper.rb~ +0 -15
@@ -11,12 +11,12 @@ module FinePrint
11
11
  end
12
12
 
13
13
  it "won't get index unless authorized" do
14
- get :index, :use_route => :fine_print
15
- assert_redirected_to FinePrint.redirect_path
14
+ expect { get :index, :use_route => :fine_print }
15
+ .to raise_error(FinePrint::SecurityTransgression)
16
16
 
17
17
  sign_in @user
18
- get :index, :use_route => :fine_print
19
- assert_redirected_to FinePrint.redirect_path
18
+ expect { get :index, :use_route => :fine_print }
19
+ .to raise_error(FinePrint::SecurityTransgression)
20
20
  end
21
21
 
22
22
  it 'must get index if authorized' do
@@ -26,12 +26,12 @@ module FinePrint
26
26
  end
27
27
 
28
28
  it "won't get new unless authorized" do
29
- get :new, :use_route => :fine_print
30
- assert_redirected_to FinePrint.redirect_path
29
+ expect { get :new, :use_route => :fine_print }
30
+ .to raise_error(FinePrint::SecurityTransgression)
31
31
 
32
32
  sign_in @user
33
- get :new, :use_route => :fine_print
34
- assert_redirected_to FinePrint.redirect_path
33
+ expect { get :new, :use_route => :fine_print }
34
+ .to raise_error(FinePrint::SecurityTransgression)
35
35
  end
36
36
 
37
37
  it 'must get new if authorized' do
@@ -46,13 +46,13 @@ module FinePrint
46
46
  attributes[:title] = 'Some title'
47
47
  attributes[:content] = 'Some content'
48
48
 
49
- post :create, :contract => attributes, :use_route => :fine_print
50
- assert_redirected_to FinePrint.redirect_path
49
+ expect { post :create, :contract => :attributes, :use_route => :fine_print }
50
+ .to raise_error(FinePrint::SecurityTransgression)
51
51
  expect(assigns(:contract)).to be_nil
52
52
 
53
53
  sign_in @user
54
- post :create, :contract => attributes, :use_route => :fine_print
55
- assert_redirected_to FinePrint.redirect_path
54
+ expect { post :create, :contract => :attributes, :use_route => :fine_print }
55
+ .to raise_error(FinePrint::SecurityTransgression)
56
56
  expect(assigns(:contract)).to be_nil
57
57
  end
58
58
 
@@ -72,12 +72,12 @@ module FinePrint
72
72
  end
73
73
 
74
74
  it "won't edit unless authorized" do
75
- get :edit, :id => @contract.id, :use_route => :fine_print
76
- assert_redirected_to FinePrint.redirect_path
75
+ expect { get :edit, :id => @contract.id, :use_route => :fine_print }
76
+ .to raise_error(FinePrint::SecurityTransgression)
77
77
 
78
78
  sign_in @user
79
- get :edit, :id => @contract.id, :use_route => :fine_print
80
- assert_redirected_to FinePrint.redirect_path
79
+ expect { get :edit, :id => @contract.id, :use_route => :fine_print }
80
+ .to raise_error(FinePrint::SecurityTransgression)
81
81
  end
82
82
 
83
83
  it 'must edit if authorized' do
@@ -95,16 +95,18 @@ module FinePrint
95
95
  title = @contract.title
96
96
  content = @contract.content
97
97
 
98
- put :update, :id => @contract.id, :contract => attributes, :use_route => :fine_print
99
- assert_redirected_to FinePrint.redirect_path
98
+ expect { post :update, :id => @contract.id,
99
+ :contract => attributes, :use_route => :fine_print }
100
+ .to raise_error(FinePrint::SecurityTransgression)
100
101
  @contract.reload
101
102
  expect(@contract.name).to eq name
102
103
  expect(@contract.title).to eq title
103
104
  expect(@contract.content).to eq content
104
105
 
105
106
  sign_in @user
106
- put :update, :id => @contract.id, :contract => attributes, :use_route => :fine_print
107
- assert_redirected_to FinePrint.redirect_path
107
+ expect { post :update, :id => @contract.id,
108
+ :contract => attributes, :use_route => :fine_print }
109
+ .to raise_error(FinePrint::SecurityTransgression)
108
110
  @contract.reload
109
111
  expect(@contract.name).to eq name
110
112
  expect(@contract.title).to eq title
@@ -128,13 +130,13 @@ module FinePrint
128
130
  end
129
131
 
130
132
  it "won't destroy unless authorized" do
131
- delete :destroy, :id => @contract.id, :use_route => :fine_print
132
- assert_redirected_to FinePrint.redirect_path
133
+ expect { delete :destroy, :id => @contract.id, :use_route => :fine_print }
134
+ .to raise_error(FinePrint::SecurityTransgression)
133
135
  expect(Contract.find(@contract.id)).to eq @contract
134
136
 
135
137
  sign_in @user
136
- delete :destroy, :id => @contract.id, :use_route => :fine_print
137
- assert_redirected_to FinePrint.redirect_path
138
+ expect { delete :destroy, :id => @contract.id, :use_route => :fine_print }
139
+ .to raise_error(FinePrint::SecurityTransgression)
138
140
  expect(Contract.find(@contract.id)).to eq @contract
139
141
  end
140
142
 
@@ -147,14 +149,14 @@ module FinePrint
147
149
 
148
150
  it "won't publish unless authorized" do
149
151
  expect(@contract.is_published?).to eq false
150
- put :publish, :id => @contract.id, :use_route => :fine_print
151
- assert_redirected_to FinePrint.redirect_path
152
+ expect { put :publish, :id => @contract.id, :use_route => :fine_print }
153
+ .to raise_error(FinePrint::SecurityTransgression)
152
154
  @contract.reload
153
155
  expect(@contract.is_published?).to eq false
154
156
 
155
157
  sign_in @user
156
- put :publish, :id => @contract.id, :use_route => :fine_print
157
- assert_redirected_to FinePrint.redirect_path
158
+ expect { put :publish, :id => @contract.id, :use_route => :fine_print }
159
+ .to raise_error(FinePrint::SecurityTransgression)
158
160
  @contract.reload
159
161
  expect(@contract.is_published?).to eq false
160
162
  end
@@ -172,14 +174,14 @@ module FinePrint
172
174
  it "won't unpublish unless authorized" do
173
175
  @contract.publish
174
176
  expect(@contract.is_published?).to eq true
175
- put :unpublish, :id => @contract.id, :use_route => :fine_print
176
- assert_redirected_to FinePrint.redirect_path
177
+ expect { put :unpublish, :id => @contract.id, :use_route => :fine_print }
178
+ .to raise_error(FinePrint::SecurityTransgression)
177
179
  @contract.reload
178
180
  expect(@contract.is_published?).to eq true
179
181
 
180
182
  sign_in @user
181
- put :unpublish, :id => @contract.id, :use_route => :fine_print
182
- assert_redirected_to FinePrint.redirect_path
183
+ expect { put :unpublish, :id => @contract.id, :use_route => :fine_print }
184
+ .to raise_error(FinePrint::SecurityTransgression)
183
185
  @contract.reload
184
186
  expect(@contract.is_published?).to eq true
185
187
  end
@@ -199,13 +201,13 @@ module FinePrint
199
201
  @contract.publish
200
202
  expect(@contract.is_published?).to eq true
201
203
 
202
- put :new_version, :id => @contract.id, :use_route => :fine_print
203
- assert_redirected_to FinePrint.redirect_path
204
+ expect { put :new_version, :id => @contract.id, :use_route => :fine_print }
205
+ .to raise_error(FinePrint::SecurityTransgression)
204
206
  expect(assigns(:contract)).to be_nil
205
207
 
206
208
  sign_in @user
207
- put :new_version, :id => @contract.id, :use_route => :fine_print
208
- assert_redirected_to FinePrint.redirect_path
209
+ expect { put :new_version, :id => @contract.id, :use_route => :fine_print }
210
+ .to raise_error(FinePrint::SecurityTransgression)
209
211
  expect(assigns(:contract)).to be_nil
210
212
  end
211
213
 
@@ -7,12 +7,12 @@ module FinePrint
7
7
  end
8
8
 
9
9
  it "won't get index unless authorized" do
10
- get :index, :use_route => :fine_print
11
- assert_response :redirect
10
+ expect { get :index, :use_route => :fine_print }
11
+ .to raise_error(FinePrint::SecurityTransgression)
12
12
 
13
13
  sign_in @user
14
- get :index, :use_route => :fine_print
15
- assert_response :redirect
14
+ expect { get :index, :use_route => :fine_print }
15
+ .to raise_error(FinePrint::SecurityTransgression)
16
16
  end
17
17
 
18
18
  it 'must get index if authorized' do
@@ -11,12 +11,12 @@ module FinePrint
11
11
  end
12
12
 
13
13
  it "won't get index unless authorized" do
14
- get :index, :use_route => :fine_print
15
- assert_redirected_to FinePrint.redirect_path
14
+ expect { get :index, :use_route => :fine_print }
15
+ .to raise_error(FinePrint::SecurityTransgression)
16
16
 
17
17
  sign_in @user
18
- get :index, :use_route => :fine_print
19
- assert_redirected_to FinePrint.redirect_path
18
+ expect { get :index, :use_route => :fine_print }
19
+ .to raise_error(FinePrint::SecurityTransgression)
20
20
  end
21
21
 
22
22
  it 'must get index if authorized' do
@@ -26,13 +26,13 @@ module FinePrint
26
26
  end
27
27
 
28
28
  it "won't destroy unless authorized" do
29
- delete :destroy, :id => @signature.id, :use_route => :fine_print
30
- assert_redirected_to FinePrint.redirect_path
29
+ expect { delete :destroy, :id => @signature.id, :use_route => :fine_print }
30
+ .to raise_error(FinePrint::SecurityTransgression)
31
31
  expect(Signature.find(@signature.id)).to eq @signature
32
32
 
33
33
  sign_in @user
34
- delete :destroy, :id => @signature.id, :use_route => :fine_print
35
- assert_redirected_to FinePrint.redirect_path
34
+ expect { delete :destroy, :id => @signature.id, :use_route => :fine_print }
35
+ .to raise_error(FinePrint::SecurityTransgression)
36
36
  expect(Signature.find(@signature.id)).to eq @signature
37
37
  end
38
38
 
data/spec/dummy/Rakefile CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env rake
2
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
3
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
3
 
@@ -5,11 +5,9 @@
5
5
  // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
6
  //
7
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // the compiled file.
8
+ // compiled file.
9
9
  //
10
- // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
- // GO AFTER THE REQUIRES BELOW.
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
12
  //
13
- //= require jquery
14
- //= require jquery_ujs
15
13
  //= require_tree .
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
@@ -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', __FILE__)
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
@@ -2,8 +2,8 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- Bundler.require
6
- require 'fine_print'
5
+ Bundler.require(*Rails.groups)
6
+ require "fine_print"
7
7
 
8
8
  module Dummy
9
9
  class Application < Rails::Application
@@ -11,16 +11,6 @@ module Dummy
11
11
  # Application configuration should go into files in config/initializers
12
12
  # -- all .rb files in that directory are automatically loaded.
13
13
 
14
- # Custom directories with classes and modules you want to be autoloadable.
15
- # config.autoload_paths += %W(#{config.root}/extras)
16
-
17
- # Only load the plugins named here, in the order given (default is alphabetical).
18
- # :all can be used as a placeholder for all plugins not explicitly named.
19
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
-
21
- # Activate observers that should always be running.
22
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
-
24
14
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
15
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
16
  # config.time_zone = 'Central Time (US & Canada)'
@@ -29,31 +19,7 @@ module Dummy
29
19
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
20
  # config.i18n.default_locale = :de
31
21
 
32
- # Configure the default encoding used in templates for Ruby 1.9.
33
- config.encoding = 'utf-8'
34
-
35
- # Configure sensitive parameters which will be filtered from the log file.
36
- config.filter_parameters += [:password]
37
-
38
- # Enable escaping HTML in JSON.
39
- config.active_support.escape_html_entities_in_json = true
40
-
41
- # Use SQL instead of Active Record's schema dumper when creating the database.
42
- # This is necessary if your schema can't be completely dumped by the schema dumper,
43
- # like if you have constraints or database-specific column types
44
- # config.active_record.schema_format = :sql
45
-
46
- # Enforce whitelist mode for mass assignment.
47
- # This will create an empty whitelist of attributes available for mass-assignment for all models
48
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
49
- # parameters by using an attr_accessible or attr_protected declaration.
50
- config.active_record.whitelist_attributes = true
51
-
52
- # Enable the asset pipeline
53
- config.assets.enabled = true
54
-
55
- # Version of your assets, change this if you want to expire all your assets
56
- config.assets.version = '1.0'
22
+ config.i18n.enforce_available_locales = true
57
23
  end
58
24
  end
59
25
 
@@ -1,10 +1,5 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
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__)
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
4
+ # Initialize the Rails application.
5
5
  Dummy::Application.initialize!
@@ -1,37 +1,29 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
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
5
  # every request. This slows down response time but is perfect for development
6
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
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
17
17
  config.action_mailer.raise_delivery_errors = false
18
18
 
19
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
20
20
  config.active_support.deprecation = :log
21
21
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
24
 
25
- # Raise exception on mass assignment protection for Active Record models
26
- config.active_record.mass_assignment_sanitizer = :strict
27
-
28
- # Log the query plan for queries taking more than this (works
29
- # with SQLite, MySQL, and PostgreSQL)
30
- config.active_record.auto_explain_threshold_in_seconds = 0.5
31
-
32
- # Do not compress assets
33
- config.assets.compress = false
34
-
35
- # Expands the lines which load the assets
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
36
28
  config.assets.debug = true
37
29
  end
@@ -1,67 +1,80 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
6
 
7
- # 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 thread 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.
8
14
  config.consider_all_requests_local = false
9
15
  config.action_controller.perform_caching = true
10
16
 
11
- # Disable Rails's static asset server (Apache or nginx will already do this)
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
12
23
  config.serve_static_assets = false
13
24
 
14
- # Compress JavaScripts and CSS
15
- config.assets.compress = true
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
16
28
 
17
- # Don't fallback to assets pipeline if a precompiled asset is missed
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
18
30
  config.assets.compile = false
19
31
 
20
- # Generate digests for assets URLs
32
+ # Generate digests for assets URLs.
21
33
  config.assets.digest = true
22
34
 
23
- # Defaults to nil and saved in location specified by config.assets.prefix
24
- # config.assets.manifest = YOUR_PATH
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
25
37
 
26
- # Specifies the header that your server uses for sending files
38
+ # Specifies the header that your server uses for sending files.
27
39
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
28
40
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
29
41
 
30
42
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
43
  # config.force_ssl = true
32
44
 
33
- # See everything in the log (default is :info)
34
- # config.log_level = :debug
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
35
47
 
36
- # Prepend all log lines with the following tags
48
+ # Prepend all log lines with the following tags.
37
49
  # config.log_tags = [ :subdomain, :uuid ]
38
50
 
39
- # Use a different logger for distributed setups
51
+ # Use a different logger for distributed setups.
40
52
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
53
 
42
- # Use a different cache store in production
54
+ # Use a different cache store in production.
43
55
  # config.cache_store = :mem_cache_store
44
56
 
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
46
58
  # config.action_controller.asset_host = "http://assets.example.com"
47
59
 
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
49
62
  # config.assets.precompile += %w( search.js )
50
63
 
51
- # Disable delivery errors, bad email addresses will be ignored
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
52
66
  # config.action_mailer.raise_delivery_errors = false
53
67
 
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
68
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
58
- # the I18n.default_locale when a translation can not be found)
69
+ # the I18n.default_locale when a translation can not be found).
59
70
  config.i18n.fallbacks = true
60
71
 
61
- # Send deprecation notices to registered listeners
72
+ # Send deprecation notices to registered listeners.
62
73
  config.active_support.deprecation = :notify
63
74
 
64
- # Log the query plan for queries taking more than this (works
65
- # with SQLite, MySQL, and PostgreSQL)
66
- # config.active_record.auto_explain_threshold_in_seconds = 0.5
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
67
80
  end
@@ -1,5 +1,5 @@
1
1
  Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
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
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -7,31 +7,30 @@ Dummy::Application.configure do
7
7
  # and recreated between test runs. Don't rely on the data there!
8
8
  config.cache_classes = true
9
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"
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
13
14
 
14
- # Log error messages when you accidentally call methods on nil
15
- config.whiny_nils = true
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
16
18
 
17
- # Show full error reports and disable caching
19
+ # Show full error reports and disable caching.
18
20
  config.consider_all_requests_local = true
19
21
  config.action_controller.perform_caching = false
20
22
 
21
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
22
24
  config.action_dispatch.show_exceptions = false
23
25
 
24
- # Disable request forgery protection in test environment
25
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
26
28
 
27
29
  # Tell Action Mailer not to deliver emails to the real world.
28
30
  # The :test delivery method accumulates sent emails in the
29
31
  # ActionMailer::Base.deliveries array.
30
32
  config.action_mailer.delivery_method = :test
31
33
 
32
- # Raise exception on mass assignment protection for Active Record models
33
- config.active_record.mass_assignment_sanitizer = :strict
34
-
35
- # Print deprecation notices to the stderr
34
+ # Print deprecation notices to the stderr.
36
35
  config.active_support.deprecation = :stderr
37
36
  end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,37 +1,4 @@
1
- # Change the settings below to suit your needs
2
- # All settings are initially set to their default values
1
+ # Configuration file for the dummy app
3
2
  FinePrint.configure do |config|
4
- # Engine Configuration
5
-
6
- # Proc called with controller as argument that returns the current user.
7
- # Default: lambda { |controller| controller.current_user }
8
- config.current_user_proc = lambda { |controller| controller.current_user }
9
-
10
- # Proc called with user as argument that returns true iif the user is an admin.
11
- # Admins can create and edit agreements and terminate accepted agreements.
12
- # Default: lambda { |user| false } (no admins)
13
3
  config.user_admin_proc = lambda { |user| user.is_admin }
14
-
15
- # Proc called with user as argument that returns true iif the argument is a user
16
- # who can sign a contract. In many systems, a non-logged-in user is represented by nil.
17
- # However, some systems use something like an AnonymousUser class to represent this state.
18
- # If this proc returns false, FinePrint will not ask for signatures and will allow access
19
- # to any page, so it's up to the developer to make sure that unsigned users can't access
20
- # pages that require a contract signature to use.
21
- # Default: lambda { |user| user }
22
- config.can_sign_contracts_proc = lambda { |user| user }
23
-
24
- # Path to redirect users to when an error occurs (e.g. permission denied on admin pages).
25
- # Default: '/'
26
- config.redirect_path = '/'
27
-
28
- # Signature (fine_print_get_signatures) Configuration
29
-
30
- # Path to redirect users to when they need to agree to contract(s).
31
- # A list of contract names that must be agreed to will be available in the 'contracts' parameter.
32
- # Your code doesn't have to deal with all of them at once, e.g. you can get
33
- # the user to agree to the first one and then they'll just eventually be
34
- # redirected back to this page with the remaining contract names.
35
- # Default: '/'
36
- config.pose_contracts_path = '/'
37
4
  end
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end