secure_headers 1.3.3 → 1.4.0

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 (64) hide show
  1. data/.travis.yml +0 -3
  2. data/Gemfile +2 -3
  3. data/HISTORY.md +7 -0
  4. data/app/controllers/content_security_policy_controller.rb +1 -0
  5. data/fixtures/rails_3_2_12/Gemfile +0 -6
  6. data/fixtures/rails_3_2_12/app/controllers/things_controller.rb +0 -1
  7. data/fixtures/rails_3_2_12/app/views/layouts/application.html.erb +0 -3
  8. data/fixtures/rails_3_2_12/app/views/things/index.html.erb +1 -21
  9. data/fixtures/rails_3_2_12/config/application.rb +0 -54
  10. data/fixtures/rails_3_2_12/config/environments/test.rb +2 -2
  11. data/fixtures/rails_3_2_12/config/routes.rb +0 -57
  12. data/fixtures/rails_3_2_12/spec/controllers/other_things_controller_spec.rb +5 -0
  13. data/fixtures/rails_3_2_12/spec/controllers/things_controller_spec.rb +5 -0
  14. data/fixtures/rails_3_2_12_no_init/Gemfile +0 -7
  15. data/fixtures/rails_3_2_12_no_init/app/controllers/things_controller.rb +1 -1
  16. data/fixtures/rails_3_2_12_no_init/app/views/layouts/application.html.erb +0 -2
  17. data/fixtures/rails_3_2_12_no_init/app/views/things/index.html.erb +0 -21
  18. data/fixtures/rails_3_2_12_no_init/config/application.rb +0 -51
  19. data/fixtures/rails_3_2_12_no_init/config/environments/test.rb +2 -2
  20. data/fixtures/rails_3_2_12_no_init/config/routes.rb +0 -57
  21. data/fixtures/rails_3_2_12_no_init/spec/controllers/other_things_controller_spec.rb +5 -0
  22. data/fixtures/rails_3_2_12_no_init/spec/controllers/things_controller_spec.rb +5 -0
  23. data/lib/secure_headers/headers/content_security_policy.rb +2 -0
  24. data/lib/secure_headers/headers/x_download_options.rb +39 -0
  25. data/lib/secure_headers/headers/x_xss_protection.rb +2 -1
  26. data/lib/secure_headers/railtie.rb +6 -2
  27. data/lib/secure_headers/version.rb +1 -1
  28. data/lib/secure_headers.rb +9 -2
  29. data/spec/lib/secure_headers/headers/x_download_options_spec.rb +32 -0
  30. data/spec/lib/secure_headers/headers/x_xss_protection_spec.rb +2 -1
  31. data/spec/lib/secure_headers_spec.rb +23 -2
  32. data/spec/spec_helper.rb +1 -0
  33. metadata +5 -33
  34. data/Guardfile +0 -6
  35. data/fixtures/rails_3_2_12/app/models/thing.rb +0 -3
  36. data/fixtures/rails_3_2_12/config/database.yml +0 -25
  37. data/fixtures/rails_3_2_12/config/environments/development.rb +0 -37
  38. data/fixtures/rails_3_2_12/config/environments/production.rb +0 -67
  39. data/fixtures/rails_3_2_12/config/initializers/backtrace_silencers.rb +0 -7
  40. data/fixtures/rails_3_2_12/config/initializers/inflections.rb +0 -15
  41. data/fixtures/rails_3_2_12/config/initializers/mime_types.rb +0 -5
  42. data/fixtures/rails_3_2_12/config/initializers/secret_token.rb +0 -7
  43. data/fixtures/rails_3_2_12/config/initializers/session_store.rb +0 -8
  44. data/fixtures/rails_3_2_12/config/initializers/wrap_parameters.rb +0 -14
  45. data/fixtures/rails_3_2_12/config/locales/en.yml +0 -5
  46. data/fixtures/rails_3_2_12/db/schema.rb +0 -16
  47. data/fixtures/rails_3_2_12/db/seeds.rb +0 -7
  48. data/fixtures/rails_3_2_12_no_init/app/models/thing.rb +0 -3
  49. data/fixtures/rails_3_2_12_no_init/app/views/things/_form.html.erb +0 -17
  50. data/fixtures/rails_3_2_12_no_init/app/views/things/edit.html.erb +0 -6
  51. data/fixtures/rails_3_2_12_no_init/app/views/things/new.html.erb +0 -5
  52. data/fixtures/rails_3_2_12_no_init/app/views/things/show.html.erb +0 -5
  53. data/fixtures/rails_3_2_12_no_init/config/database.yml +0 -25
  54. data/fixtures/rails_3_2_12_no_init/config/environments/development.rb +0 -37
  55. data/fixtures/rails_3_2_12_no_init/config/environments/production.rb +0 -67
  56. data/fixtures/rails_3_2_12_no_init/config/initializers/backtrace_silencers.rb +0 -7
  57. data/fixtures/rails_3_2_12_no_init/config/initializers/inflections.rb +0 -15
  58. data/fixtures/rails_3_2_12_no_init/config/initializers/mime_types.rb +0 -5
  59. data/fixtures/rails_3_2_12_no_init/config/initializers/secret_token.rb +0 -7
  60. data/fixtures/rails_3_2_12_no_init/config/initializers/session_store.rb +0 -8
  61. data/fixtures/rails_3_2_12_no_init/config/initializers/wrap_parameters.rb +0 -14
  62. data/fixtures/rails_3_2_12_no_init/config/locales/en.yml +0 -5
  63. data/fixtures/rails_3_2_12_no_init/db/schema.rb +0 -16
  64. data/fixtures/rails_3_2_12_no_init/db/seeds.rb +0 -7
@@ -0,0 +1,32 @@
1
+ module SecureHeaders
2
+ describe XDownloadOptions do
3
+ specify { expect(XDownloadOptions.new.name).to eq(XDO_HEADER_NAME)}
4
+ specify { expect(XDownloadOptions.new.value).to eq("noopen")}
5
+ specify { expect(XDownloadOptions.new('noopen').value).to eq('noopen')}
6
+ specify { expect(XDownloadOptions.new(:value => 'noopen').value).to eq('noopen') }
7
+
8
+ context "invalid configuration values" do
9
+ it "accepts noopen" do
10
+ expect {
11
+ XDownloadOptions.new("noopen")
12
+ }.not_to raise_error
13
+
14
+ expect {
15
+ XDownloadOptions.new(:value => "noopen")
16
+ }.not_to raise_error
17
+ end
18
+
19
+ it "accepts nil" do
20
+ expect {
21
+ XDownloadOptions.new
22
+ }.not_to raise_error
23
+ end
24
+
25
+ it "doesn't accept anything besides noopen" do
26
+ expect {
27
+ XContentTypeOptions.new("open")
28
+ }.to raise_error
29
+ end
30
+ end
31
+ end
32
+ end
@@ -4,6 +4,7 @@ module SecureHeaders
4
4
  specify { expect(XXssProtection.new.value).to eq("1")}
5
5
  specify { expect(XXssProtection.new("0").value).to eq("0")}
6
6
  specify { expect(XXssProtection.new(:value => 1, :mode => 'block').value).to eq('1; mode=block') }
7
+ specify { expect(XXssProtection.new(:value => 1, :mode => 'block', :report_uri => 'https://www.secure.com/reports').value).to eq('1; mode=block; report=https://www.secure.com/reports') }
7
8
 
8
9
  context "with invalid configuration" do
9
10
  it "should raise an error when providing a string that is not valid" do
@@ -50,4 +51,4 @@ module SecureHeaders
50
51
 
51
52
  end
52
53
  end
53
- end
54
+ end
@@ -54,6 +54,7 @@ describe SecureHeaders do
54
54
  config.x_content_type_options = nil
55
55
  config.x_xss_protection = nil
56
56
  config.csp = nil
57
+ config.x_download_options = nil
57
58
  end
58
59
  end
59
60
 
@@ -63,12 +64,13 @@ describe SecureHeaders do
63
64
  subject.set_x_frame_options_header
64
65
  subject.set_x_content_type_options_header
65
66
  subject.set_x_xss_protection_header
67
+ subject.set_x_download_options_header
66
68
  end
67
69
 
68
70
  describe "#ensure_security_headers" do
69
71
  it "sets a before filter" do
70
72
  options = {}
71
- expect(DummyClass).to receive(:before_filter).exactly(5).times
73
+ expect(DummyClass).to receive(:before_filter).exactly(6).times
72
74
  DummyClass.ensure_security_headers(options)
73
75
  end
74
76
  end
@@ -92,13 +94,14 @@ describe SecureHeaders do
92
94
  USER_AGENTS.each do |name, useragent|
93
95
  it "sets all default headers for #{name} (smoke test)" do
94
96
  stub_user_agent(useragent)
95
- number_of_headers = 5
97
+ number_of_headers = 6
96
98
  expect(subject).to receive(:set_header).exactly(number_of_headers).times # a request for a given header
97
99
  subject.set_csp_header
98
100
  subject.set_x_frame_options_header
99
101
  subject.set_hsts_header
100
102
  subject.set_x_xss_protection_header
101
103
  subject.set_x_content_type_options_header
104
+ subject.set_x_download_options_header
102
105
  end
103
106
  end
104
107
 
@@ -113,6 +116,11 @@ describe SecureHeaders do
113
116
  subject.set_x_xss_protection_header(false)
114
117
  end
115
118
 
119
+ it "does not set the X-Download-Options header if disabled" do
120
+ should_not_assign_header(XDO_HEADER_NAME)
121
+ subject.set_x_download_options_header(false)
122
+ end
123
+
116
124
  it "does not set the X-Frame-Options header if disabled" do
117
125
  should_not_assign_header(XFO_HEADER_NAME)
118
126
  subject.set_x_frame_options_header(false)
@@ -143,6 +151,7 @@ describe SecureHeaders do
143
151
  config.x_content_type_options = false
144
152
  config.x_xss_protection = false
145
153
  config.csp = false
154
+ config.x_download_options = false
146
155
  end
147
156
  expect(subject).not_to receive(:set_header)
148
157
  set_security_headers(subject)
@@ -163,6 +172,18 @@ describe SecureHeaders do
163
172
  end
164
173
  end
165
174
 
175
+ describe "#set_x_download_options_header" do
176
+ it "sets the X-Download-Options header" do
177
+ should_assign_header(XDO_HEADER_NAME, SecureHeaders::XDownloadOptions::Constants::DEFAULT_VALUE)
178
+ subject.set_x_download_options_header
179
+ end
180
+
181
+ it "allows a custom X-Download-Options header" do
182
+ should_assign_header(XDO_HEADER_NAME, "noopen")
183
+ subject.set_x_download_options_header(:value => 'noopen')
184
+ end
185
+ end
186
+
166
187
  describe "#set_strict_transport_security" do
167
188
  it "sets the Strict-Transport-Security header" do
168
189
  should_assign_header(HSTS_HEADER_NAME, SecureHeaders::StrictTransportSecurity::Constants::DEFAULT_VALUE)
data/spec/spec_helper.rb CHANGED
@@ -8,3 +8,4 @@ include ::SecureHeaders::ContentSecurityPolicy::Constants
8
8
  include ::SecureHeaders::XFrameOptions::Constants
9
9
  include ::SecureHeaders::XXssProtection::Constants
10
10
  include ::SecureHeaders::XContentTypeOptions::Constants
11
+ include ::SecureHeaders::XDownloadOptions::Constants
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: secure_headers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-15 00:00:00.000000000 Z
12
+ date: 2014-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -39,7 +39,6 @@ files:
39
39
  - .ruby-version
40
40
  - .travis.yml
41
41
  - Gemfile
42
- - Guardfile
43
42
  - HISTORY.md
44
43
  - LICENSE
45
44
  - README.md
@@ -55,29 +54,16 @@ files:
55
54
  - fixtures/rails_3_2_12/app/controllers/other_things_controller.rb
56
55
  - fixtures/rails_3_2_12/app/controllers/things_controller.rb
57
56
  - fixtures/rails_3_2_12/app/models/.gitkeep
58
- - fixtures/rails_3_2_12/app/models/thing.rb
59
57
  - fixtures/rails_3_2_12/app/views/layouts/application.html.erb
60
58
  - fixtures/rails_3_2_12/app/views/other_things/index.html.erb
61
59
  - fixtures/rails_3_2_12/app/views/things/index.html.erb
62
60
  - fixtures/rails_3_2_12/config.ru
63
61
  - fixtures/rails_3_2_12/config/application.rb
64
62
  - fixtures/rails_3_2_12/config/boot.rb
65
- - fixtures/rails_3_2_12/config/database.yml
66
63
  - fixtures/rails_3_2_12/config/environment.rb
67
- - fixtures/rails_3_2_12/config/environments/development.rb
68
- - fixtures/rails_3_2_12/config/environments/production.rb
69
64
  - fixtures/rails_3_2_12/config/environments/test.rb
70
- - fixtures/rails_3_2_12/config/initializers/backtrace_silencers.rb
71
- - fixtures/rails_3_2_12/config/initializers/inflections.rb
72
- - fixtures/rails_3_2_12/config/initializers/mime_types.rb
73
- - fixtures/rails_3_2_12/config/initializers/secret_token.rb
74
65
  - fixtures/rails_3_2_12/config/initializers/secure_headers.rb
75
- - fixtures/rails_3_2_12/config/initializers/session_store.rb
76
- - fixtures/rails_3_2_12/config/initializers/wrap_parameters.rb
77
- - fixtures/rails_3_2_12/config/locales/en.yml
78
66
  - fixtures/rails_3_2_12/config/routes.rb
79
- - fixtures/rails_3_2_12/db/schema.rb
80
- - fixtures/rails_3_2_12/db/seeds.rb
81
67
  - fixtures/rails_3_2_12/lib/assets/.gitkeep
82
68
  - fixtures/rails_3_2_12/lib/tasks/.gitkeep
83
69
  - fixtures/rails_3_2_12/log/.gitkeep
@@ -95,32 +81,15 @@ files:
95
81
  - fixtures/rails_3_2_12_no_init/app/controllers/other_things_controller.rb
96
82
  - fixtures/rails_3_2_12_no_init/app/controllers/things_controller.rb
97
83
  - fixtures/rails_3_2_12_no_init/app/models/.gitkeep
98
- - fixtures/rails_3_2_12_no_init/app/models/thing.rb
99
84
  - fixtures/rails_3_2_12_no_init/app/views/layouts/application.html.erb
100
85
  - fixtures/rails_3_2_12_no_init/app/views/other_things/index.html.erb
101
- - fixtures/rails_3_2_12_no_init/app/views/things/_form.html.erb
102
- - fixtures/rails_3_2_12_no_init/app/views/things/edit.html.erb
103
86
  - fixtures/rails_3_2_12_no_init/app/views/things/index.html.erb
104
- - fixtures/rails_3_2_12_no_init/app/views/things/new.html.erb
105
- - fixtures/rails_3_2_12_no_init/app/views/things/show.html.erb
106
87
  - fixtures/rails_3_2_12_no_init/config.ru
107
88
  - fixtures/rails_3_2_12_no_init/config/application.rb
108
89
  - fixtures/rails_3_2_12_no_init/config/boot.rb
109
- - fixtures/rails_3_2_12_no_init/config/database.yml
110
90
  - fixtures/rails_3_2_12_no_init/config/environment.rb
111
- - fixtures/rails_3_2_12_no_init/config/environments/development.rb
112
- - fixtures/rails_3_2_12_no_init/config/environments/production.rb
113
91
  - fixtures/rails_3_2_12_no_init/config/environments/test.rb
114
- - fixtures/rails_3_2_12_no_init/config/initializers/backtrace_silencers.rb
115
- - fixtures/rails_3_2_12_no_init/config/initializers/inflections.rb
116
- - fixtures/rails_3_2_12_no_init/config/initializers/mime_types.rb
117
- - fixtures/rails_3_2_12_no_init/config/initializers/secret_token.rb
118
- - fixtures/rails_3_2_12_no_init/config/initializers/session_store.rb
119
- - fixtures/rails_3_2_12_no_init/config/initializers/wrap_parameters.rb
120
- - fixtures/rails_3_2_12_no_init/config/locales/en.yml
121
92
  - fixtures/rails_3_2_12_no_init/config/routes.rb
122
- - fixtures/rails_3_2_12_no_init/db/schema.rb
123
- - fixtures/rails_3_2_12_no_init/db/seeds.rb
124
93
  - fixtures/rails_3_2_12_no_init/lib/assets/.gitkeep
125
94
  - fixtures/rails_3_2_12_no_init/lib/tasks/.gitkeep
126
95
  - fixtures/rails_3_2_12_no_init/log/.gitkeep
@@ -135,6 +104,7 @@ files:
135
104
  - lib/secure_headers/headers/content_security_policy.rb
136
105
  - lib/secure_headers/headers/strict_transport_security.rb
137
106
  - lib/secure_headers/headers/x_content_type_options.rb
107
+ - lib/secure_headers/headers/x_download_options.rb
138
108
  - lib/secure_headers/headers/x_frame_options.rb
139
109
  - lib/secure_headers/headers/x_xss_protection.rb
140
110
  - lib/secure_headers/padrino.rb
@@ -145,6 +115,7 @@ files:
145
115
  - spec/lib/secure_headers/headers/content_security_policy_spec.rb
146
116
  - spec/lib/secure_headers/headers/strict_transport_security_spec.rb
147
117
  - spec/lib/secure_headers/headers/x_content_type_options_spec.rb
118
+ - spec/lib/secure_headers/headers/x_download_options_spec.rb
148
119
  - spec/lib/secure_headers/headers/x_frame_options_spec.rb
149
120
  - spec/lib/secure_headers/headers/x_xss_protection_spec.rb
150
121
  - spec/lib/secure_headers_spec.rb
@@ -181,6 +152,7 @@ test_files:
181
152
  - spec/lib/secure_headers/headers/content_security_policy_spec.rb
182
153
  - spec/lib/secure_headers/headers/strict_transport_security_spec.rb
183
154
  - spec/lib/secure_headers/headers/x_content_type_options_spec.rb
155
+ - spec/lib/secure_headers/headers/x_download_options_spec.rb
184
156
  - spec/lib/secure_headers/headers/x_frame_options_spec.rb
185
157
  - spec/lib/secure_headers/headers/x_xss_protection_spec.rb
186
158
  - spec/lib/secure_headers_spec.rb
data/Guardfile DELETED
@@ -1,6 +0,0 @@
1
- guard 'rspec' do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch(%r{^app/controllers/(.+)\.rb$}) { |m| "spec/controllers/#{m[1]}_spec.rb" }
5
- watch('spec/spec_helper.rb') { "spec" }
6
- end
@@ -1,3 +0,0 @@
1
- class Thing < ActiveRecord::Base
2
- # attr_accessible :title, :body
3
- end
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,37 +0,0 @@
1
- Rails3212::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
- # 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
36
- config.assets.debug = true
37
- end
@@ -1,67 +0,0 @@
1
- Rails3212::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 nil and saved in location specified by config.assets.prefix
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
- # Prepend all log lines with the following tags
37
- # config.log_tags = [ :subdomain, :uuid ]
38
-
39
- # Use a different logger for distributed setups
40
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
-
42
- # Use a different cache store in production
43
- # config.cache_store = :mem_cache_store
44
-
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
- # config.action_controller.asset_host = "http://assets.example.com"
47
-
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
- # config.assets.precompile += %w( search.js )
50
-
51
- # Disable delivery errors, bad email addresses will be ignored
52
- # config.action_mailer.raise_delivery_errors = false
53
-
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
- # 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)
59
- config.i18n.fallbacks = true
60
-
61
- # Send deprecation notices to registered listeners
62
- config.active_support.deprecation = :notify
63
-
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
67
- 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!
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
- # Make sure the secret is at least 30 characters and all random,
6
- # no regular words or you'll be exposed to dictionary attacks.
7
- Rails3212::Application.config.secret_token = '8dd5aabfbd49f9bce1c5b7dee79d7349cb869f54984ead01f7a272e6f75a58413f621733855906dc9cc249b9486d95583519096d92e77b910f82ba4a90326db7'
@@ -1,8 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails3212::Application.config.session_store :cookie_store, :key => '_rails_3_2_12_session'
4
-
5
- # Use the database for sessions instead of the cookie-based default,
6
- # which shouldn't be used to store highly confidential information
7
- # (create the session table with "rails generate session_migration")
8
- # Rails3212::Application.config.session_store :active_record_store
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
- #
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters :format => [:json]
9
- end
10
-
11
- # Disable root element in JSON by default.
12
- ActiveSupport.on_load(:active_record) do
13
- self.include_root_in_json = false
14
- end
@@ -1,5 +0,0 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
-
4
- en:
5
- hello: "Hello world"
@@ -1,16 +0,0 @@
1
- # encoding: UTF-8
2
- # This file is auto-generated from the current state of the database. Instead
3
- # of editing this file, please use the migrations feature of Active Record to
4
- # incrementally modify your database, and then regenerate this schema definition.
5
- #
6
- # Note that this schema.rb definition is the authoritative source for your
7
- # database schema. If you need to create the application database on another
8
- # system, you should be using db:schema:load, not running all the migrations
9
- # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
- # you'll amass, the slower it'll run and the greater likelihood for issues).
11
- #
12
- # It's strongly recommended to check this file into your version control system.
13
-
14
- ActiveRecord::Schema.define(:version => 0) do
15
-
16
- end
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
- # Mayor.create(name: 'Emanuel', city: cities.first)
@@ -1,3 +0,0 @@
1
- class Thing < ActiveRecord::Base
2
- # attr_accessible :title, :body
3
- end
@@ -1,17 +0,0 @@
1
- <%= form_for(@thing) do |f| %>
2
- <% if @thing.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@thing.errors.count, "error") %> prohibited this thing from being saved:</h2>
5
-
6
- <ul>
7
- <% @thing.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="actions">
15
- <%= f.submit %>
16
- </div>
17
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing thing</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @thing %> |
6
- <%= link_to 'Back', things_path %>
@@ -1,5 +0,0 @@
1
- <h1>New thing</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', things_path %>
@@ -1,5 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
-
4
- <%= link_to 'Edit', edit_thing_path(@thing) %> |
5
- <%= link_to 'Back', things_path %>
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,37 +0,0 @@
1
- Rails3212::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
- # 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
36
- config.assets.debug = true
37
- end
@@ -1,67 +0,0 @@
1
- Rails3212::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 nil and saved in location specified by config.assets.prefix
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
- # Prepend all log lines with the following tags
37
- # config.log_tags = [ :subdomain, :uuid ]
38
-
39
- # Use a different logger for distributed setups
40
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
41
-
42
- # Use a different cache store in production
43
- # config.cache_store = :mem_cache_store
44
-
45
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
46
- # config.action_controller.asset_host = "http://assets.example.com"
47
-
48
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
49
- # config.assets.precompile += %w( search.js )
50
-
51
- # Disable delivery errors, bad email addresses will be ignored
52
- # config.action_mailer.raise_delivery_errors = false
53
-
54
- # Enable threaded mode
55
- # config.threadsafe!
56
-
57
- # 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)
59
- config.i18n.fallbacks = true
60
-
61
- # Send deprecation notices to registered listeners
62
- config.active_support.deprecation = :notify
63
-
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
67
- end