stackable_flash 0.0.7 → 0.1.1

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 +7 -0
  2. data/.gitignore +1 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +7 -5
  5. data/CHANGELOG +4 -0
  6. data/README.md +64 -8
  7. data/lib/stackable_flash.rb +21 -9
  8. data/lib/stackable_flash/flash_stack.rb +9 -6
  9. data/lib/stackable_flash/railtie.rb +1 -1
  10. data/lib/stackable_flash/stack_layer.rb +8 -14
  11. data/lib/stackable_flash/test_helpers.rb +1 -0
  12. data/lib/stackable_flash/version.rb +1 -1
  13. data/spec/dummy/Rakefile +7 -7
  14. data/spec/dummy/app/assets/javascripts/application.js +15 -15
  15. data/spec/dummy/app/assets/stylesheets/application.css +13 -13
  16. data/spec/dummy/app/controllers/application_controller.rb +3 -3
  17. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  18. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  19. data/spec/dummy/config.ru +4 -4
  20. data/spec/dummy/config/application.rb +62 -62
  21. data/spec/dummy/config/boot.rb +9 -9
  22. data/spec/dummy/config/database.yml +25 -25
  23. data/spec/dummy/config/environment.rb +5 -5
  24. data/spec/dummy/config/environments/development.rb +30 -30
  25. data/spec/dummy/config/environments/production.rb +67 -67
  26. data/spec/dummy/config/environments/test.rb +34 -34
  27. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  28. data/spec/dummy/config/initializers/inflections.rb +15 -15
  29. data/spec/dummy/config/initializers/mime_types.rb +5 -5
  30. data/spec/dummy/config/initializers/secret_token.rb +7 -7
  31. data/spec/dummy/config/initializers/session_store.rb +8 -8
  32. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  33. data/spec/dummy/config/locales/en.yml +5 -5
  34. data/spec/dummy/config/routes.rb +1 -1
  35. data/spec/dummy/public/404.html +26 -26
  36. data/spec/dummy/public/422.html +26 -26
  37. data/spec/dummy/public/500.html +25 -25
  38. data/spec/dummy/script/rails +6 -6
  39. data/spec/spec_helper.rb +4 -0
  40. data/spec/stackable_flash/flash_stack_spec.rb +0 -3
  41. data/spec/stackable_flash/rspec_matchers_spec.rb +0 -3
  42. data/spec/stackable_flash/stackable_flash_spec.rb +66 -0
  43. data/stackable_flash.gemspec +43 -6
  44. metadata +58 -43
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e318b882bf80aa565f9a7790ba2eb145531c7c88
4
+ data.tar.gz: 69edded26007e9e2293d73ef9cd882c9a793d22d
5
+ SHA512:
6
+ metadata.gz: 4b426181a3964f8f6c6e0a62ee420bf86cfc6b5db57e157a9af814359841d0f97898080c125750666b9b5c8f167249ed62ff0c6a4b0f6b36c6df18d841eee5cd
7
+ data.tar.gz: f3e4de1337bfcbb43965b326cb0d0ddca4b3d202cc188f7c1113fa11358cfdf6947bf257281b4c6afd3a25cc4dabca15a916cd621581371bda7d5a3ba4eabb3f
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ spec/reports
12
12
  test/tmp
13
13
  test/version_tmp
14
14
  tmp
15
+ spec/dummy/log/*
15
16
 
16
17
  # YARD artifacts
17
18
  _yardoc
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -1,8 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.9.3
4
- - 1.9.2
5
- - jruby-19mode
6
- - rbx-19mode
3
+ - 2.0.0
4
+ - 2.1.10
5
+ - 2.2.7
6
+ - 2.3.4
7
+ - 2.4.1
7
8
  - ruby-head
8
- - jruby-head
9
+
10
+ script: bundle exec rspec
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ Version 0.1.0 - MAY.23.2017
2
+ - Remove usage of alias_method_chain
3
+ - Dropped support for Ruby 1.9.3 (Now requires >= 2.0)
4
+
1
5
  Version 0.0.7 - AUG.22.2012
2
6
  - Working Config class
3
7
 
data/README.md CHANGED
@@ -1,7 +1,35 @@
1
1
  stackable_flash
2
2
  ===============
3
3
 
4
- Allows flashes to stack intelligently, while preserving existing behavior of Rails' FlashHash.
4
+ * Allows flashes to stack intelligently like arrays.
5
+ * Follows the *principle of least surprise* for existing behavior of Rails' FlashHash.
6
+
7
+ | Project | Stackable Flash |
8
+ |------------------------ | ----------------- |
9
+ | gem name | stackable_flash |
10
+ | license | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) |
11
+ | expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
12
+ | download rank | [![Total Downloads](https://img.shields.io/gem/rt/stackable_flash.svg)](https://rubygems.org/gems/stackable_flash) |
13
+ | version | [![Gem Version](https://badge.fury.io/rb/stackable_flash.png)](http://badge.fury.io/rb/stackable_flash) |
14
+ | dependencies | [![Dependency Status](https://gemnasium.com/pboling/stackable_flash.png)](https://gemnasium.com/pboling/stackable_flash) |
15
+ | code quality | [![Code Climate](https://codeclimate.com/github/pboling/stackable_flash.png)](https://codeclimate.com/github/pboling/stackable_flash) |
16
+ | inline documenation | [![Inline docs](http://inch-ci.org/github/pboling/stackable_flash.png)](http://inch-ci.org/github/pboling/stackable_flash) |
17
+ | continuous integration | [![Build Status](https://secure.travis-ci.org/pboling/stackable_flash.png?branch=master)](https://travis-ci.org/pboling/stackable_flash) |
18
+ | test coverage | [![Coverage Status](https://coveralls.io/repos/pboling/stackable_flash/badge.png)](https://coveralls.io/r/pboling/stackable_flash) |
19
+ | homepage | [on Github.com][homepage] |
20
+ | documentation | [on Rdoc.info][documentation] |
21
+ | live chat | [![Join the chat at https://gitter.im/pboling/stackable_flash](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pboling/stackable_flash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
22
+ | Spread ~♡ⓛⓞⓥⓔ♡~ | [on Coderwall][coderwall] |
23
+
24
+ [semver]: http://semver.org/
25
+ [pvc]: http://docs.rubygems.org/read/chapter/16#page74
26
+ [railsbling]: http://www.railsbling.com
27
+ [peterboling]: http://www.peterboling.com
28
+ [coderwall]: http://coderwall.com/pboling
29
+ [documentation]: http://rdoc.info/github/pboling/stackable_flash/frames
30
+ [homepage]: https://github.com/pboling/stackable_flash
31
+
32
+ ## Description
5
33
 
6
34
  Stackable Flash overrides the `:[]=` method of Rails' FlashHash with the result being that each flash key is an array.
7
35
  It is designed following the "Principle of least surprise", so in most ways the flash works as it always has.
@@ -78,12 +106,20 @@ You can even start out with it off set a flash, turn it on, and add to the stack
78
106
 
79
107
  There are block helpers which I am sure some enterprising individual will have a use for:
80
108
 
81
- StackableFlash.stacked({:stack_with_proc => Proc.new {|arr| arr.map! {|x| "<p>#{x}</p>"}.join } } ) do
82
- flash[:notice] = 'original'
83
- flash[:notice] << 'message'
84
- flash[:notice] # => ['original','message']
109
+ StackableFlash.stacked do
110
+ flash[:notice] = 'a simple string' # You can continue to use flash as if this gem did not exist
111
+ flash[:notice] << 'another' # will stack the strings
112
+ flash[:notice] # => ['a simple string','another'],
85
113
  # Uses the :stack_with_proc to transform
86
- flash[:notice].stack # => '<p>original</p><p>message</p>'
114
+ flash[:notice].stack # => "a simple string<br/>another" (default config uses <br/>),
115
+ flash[:notice] = '' # will overwrite everything above, and set back to empty string
116
+ end
117
+
118
+ StackableFlash.stacked({:stack_with_proc => Proc.new {|arr| arr.map! {|x| "<p>#{x}</p>"}.join } } ) do
119
+ flash[:error] = 'original'
120
+ flash[:error] << 'message'
121
+ flash[:error] # => ['original','message']
122
+ flash[:error].stack # => '<p>original</p><p>message</p>'
87
123
  end
88
124
 
89
125
  And
@@ -98,7 +134,8 @@ And
98
134
 
99
135
  ## Sightings
100
136
 
101
- This gem is used by the cacheable_flash gem to provide stacking flashes. You can check it out for a working example.
137
+ This gem is used by the [cacheable_flash](https://github.com/pboling/cacheable-flash) gem to provide stacking flashes.
138
+ You can check it out for a working example.
102
139
 
103
140
  ## Contributing
104
141
 
@@ -109,8 +146,27 @@ This gem is used by the cacheable_flash gem to provide stacking flashes. You ca
109
146
  5. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
110
147
  6. Create new Pull Request
111
148
 
149
+ ## Versioning
150
+
151
+ This library aims to adhere to [Semantic Versioning 2.0.0][semver].
152
+ Violations of this scheme should be reported as bugs. Specifically,
153
+ if a minor or patch version is released that breaks backward
154
+ compatibility, a new version should be immediately released that
155
+ restores compatibility. Breaking changes to the public API will
156
+ only be introduced with new major versions.
157
+
158
+ As a result of this policy, you can (and should) specify a
159
+ dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
160
+
161
+ For example:
162
+
163
+ spec.add_dependency 'stackable_flash', '~> 4.0'
164
+
165
+ [semver]: http://semver.org/
166
+ [pvc]: http://docs.rubygems.org/read/chapter/16#page74
167
+
112
168
  ## Copyright
113
169
 
114
170
  Licensed under the MIT License.
115
171
 
116
- * Copyright (c) 2012 Peter H. Boling (http://peterboling.com). See LICENSE for further details.
172
+ * Copyright (c) 2012-17 Peter H. Boling (http://railsbling.com). See LICENSE for further details.
@@ -16,12 +16,22 @@ module StackableFlash
16
16
 
17
17
  # Regardless of the value of StackableFlash.stacking you can do a local override to force stacking.
18
18
  #
19
- # StackableFlash.stacked do
20
- # flash[:notice] = 'a simple string' # Use flash as if this gem did not exist
21
- # flash[:notice] = 'another' # will stack the strings
22
- # flash[:notice] # => ['a simple string','another'],
23
- # # but returned as "a simple string<br/>another" with default config
24
- # end
19
+ # StackableFlash.stacked do
20
+ # flash[:notice] = 'a simple string' # You can continue to use flash as if this gem did not exist
21
+ # flash[:notice] << 'another' # will stack the strings
22
+ # flash[:notice] # => ['a simple string','another'],
23
+ # # Uses the default :stack_with_proc to transform
24
+ # flash[:notice].stack # => "a simple string<br/>another" (default config uses <br/>),
25
+ # flash[:notice] = '' # will overwrite everything above, and set back to empty string
26
+ # end
27
+ #
28
+ # StackableFlash.stacked({:stack_with_proc => Proc.new {|arr| arr.map! {|x| "<p>#{x}</p>"}.join } } ) do
29
+ # flash[:error] = 'original'
30
+ # flash[:error] << 'message'
31
+ # flash[:error] # => ['original','message']
32
+ # # Uses the custom :stack_with_proc above to transform
33
+ # flash[:error].stack # => '<p>original</p><p>message</p>'
34
+ # end
25
35
  #
26
36
  def self.stacked(config_options = {}, &block)
27
37
  flashing({:forcing => true}) do
@@ -35,9 +45,11 @@ module StackableFlash
35
45
  # Regardless of the value of StackableFlash.stacking you can do a local override to force non-stacking.
36
46
  #
37
47
  # StackableFlash.not_stacked do
38
- # flash[:notice] = 'a simple string' # Use flash as if this gem did not exist
39
- # flash[:notice] = '' # will overwrite the string above
40
- # flash[:notice] # => ''
48
+ # flash[:notice] = 'a simple string' # You can continue to use flash as if this gem did not exist
49
+ # flash[:notice] << 'another' # will concatenate the strings
50
+ # flash[:notice] # => "a simple stringanother"
51
+ # flash[:notice].stack # => "a simple stringanother"
52
+ # flash[:notice] = '' # will overwrite everything above, and set back to empty string
41
53
  # end
42
54
  #
43
55
  def self.not_stacked &block
@@ -7,23 +7,26 @@ module StackableFlash
7
7
  # flash[:notice] = 'First Part'
8
8
  # flash[:notice] += ' Second Part'
9
9
  # => ['First Part Second Part']
10
- define_method "+_with_stacking", lambda {|to_add|
10
+
11
+ def +(to_add)
11
12
  if StackableFlash.stacking
13
+
12
14
  if to_add.kind_of?(Array)
13
- self.send("+_without_stacking", to_add)
15
+ super(to_add)
14
16
  else
17
+
15
18
  # Make sure it responds to +, otherwise just push it onto the stack
16
19
  if self.last.respond_to?(:+)
17
- self[self.length -1] = self.last + to_add
20
+ self[self.length - 1] = self.last + to_add
18
21
  else
19
22
  self << to_add
20
23
  end
21
24
  end
25
+
22
26
  else
23
- self.send("+_without_stacking", to_add)
27
+ super(to_add)
24
28
  end
25
- }
26
- alias_method_chain :+, :stacking
29
+ end
27
30
 
28
31
  def stack
29
32
  if StackableFlash.stacking
@@ -16,7 +16,7 @@ module StackableFlash
16
16
  require 'action_controller'
17
17
  ActionController::Flash::FlashHash
18
18
  end
19
- base.send :include, StackableFlash::StackLayer
19
+ base.send :prepend, StackableFlash::StackLayer
20
20
  end
21
21
 
22
22
  end
@@ -2,27 +2,21 @@ require "stackable_flash/flash_stack"
2
2
 
3
3
  module StackableFlash
4
4
  module StackLayer
5
- def self.included(base)
6
- base.class_eval do
7
- alias_method_chain :[]=, :stacking
8
- alias_method_chain :[], :stacking
9
- end
10
- end
11
5
 
12
- define_method "[]_with_stacking" do |key|
6
+ def [](key)
13
7
  if StackableFlash.stacking
14
8
  #Do it in a non-stacking block so we get normal behavior from flash[:notice] calls
15
9
  StackableFlash.not_stacked do
16
- actual = send("[]_without_stacking", key)
10
+ actual = super(key)
17
11
  if actual.nil?
18
- send("[]_with_stacking=", key, StackableFlash::FlashStack.new)
12
+ send(:[]=, key, StackableFlash::FlashStack.new)
19
13
  end
20
14
  end
21
15
  else
22
16
  # All StackableFlash functionality is completely bypassed
23
- send("[]_without_stacking", key)
17
+ super(key)
24
18
  end
25
- return send("[]_without_stacking", key)
19
+ return super(key)
26
20
  end
27
21
 
28
22
  # Make an array at the key, while providing a seamless upgrade to existing flashes
@@ -48,9 +42,9 @@ module StackableFlash
48
42
  #
49
43
  # The same line of code does all of the above.
50
44
  # Leave existing behavior in place, but send the full array as the value so it doesn't get killed.
51
- define_method "[]_with_stacking=" do |key, value|
45
+ def []=(key, value)
52
46
  if StackableFlash.stacking
53
- send("[]_without_stacking=", key,
47
+ super(key,
54
48
  StackableFlash::FlashStack.new.replace(
55
49
  value.kind_of?(Array) ?
56
50
  value :
@@ -60,7 +54,7 @@ module StackableFlash
60
54
  )
61
55
  else
62
56
  # All StackableFlash functionality is completely bypassed
63
- send("[]_without_stacking=", key, value)
57
+ super(key, value)
64
58
  end
65
59
  end
66
60
 
@@ -1,6 +1,7 @@
1
1
  module StackableFlash
2
2
  module TestHelpers
3
3
 
4
+ # slash is shorthand for stackable_flash
4
5
  def flash_in_stack(slash_for_status, expecting)
5
6
  return true if slash_for_status == expecting
6
7
  if slash_for_status.kind_of?(Array)
@@ -1,3 +1,3 @@
1
1
  module StackableFlash
2
- VERSION = "0.0.7"
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::Application.load_tasks
@@ -1,15 +1,15 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
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.
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.
12
- //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require_tree .
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
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.
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.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -1,13 +1,13 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -1,3 +1,3 @@
1
- class ApplicationController < ActionController::Base
2
- protect_from_forgery
3
- end
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -1,2 +1,2 @@
1
- module ApplicationHelper
2
- end
1
+ module ApplicationHelper
2
+ end
@@ -1,14 +1,14 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application", :stackable_flash %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", :media => "all" %>
6
+ <%= javascript_include_tag "application", :stackable_flash %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -1,4 +1,4 @@
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
+ # 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,62 +1,62 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- # Pick the frameworks you want:
4
- #require "active_record/railtie"
5
- require "action_controller/railtie"
6
- #require "action_mailer/railtie"
7
- #require "active_resource/railtie"
8
- require "sprockets/railtie"
9
- # require "rails/test_unit/railtie"
10
-
11
- Bundler.require
12
- require "stackable_flash"
13
-
14
- module Dummy
15
- class Application < Rails::Application
16
- # Settings in config/environments/* take precedence over those specified here.
17
- # Application configuration should go into files in config/initializers
18
- # -- 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
- # Configure the default encoding used in templates for Ruby 1.9.
39
- config.encoding = "utf-8"
40
-
41
- # Configure sensitive parameters which will be filtered from the log file.
42
- config.filter_parameters += [:password]
43
-
44
- # Use SQL instead of Active Record's schema dumper when creating the database.
45
- # This is necessary if your schema can't be completely dumped by the schema dumper,
46
- # like if you have constraints or database-specific column types
47
- # config.active_record.schema_format = :sql
48
-
49
- # Enforce whitelist mode for mass assignment.
50
- # This will create an empty whitelist of attributes available for mass-assignment for all models
51
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
52
- # parameters by using an attr_accessible or attr_protected declaration.
53
- # config.active_record.whitelist_attributes = true
54
-
55
- # Enable the asset pipeline
56
- config.assets.enabled = true
57
-
58
- # Version of your assets, change this if you want to expire all your assets
59
- config.assets.version = '1.0'
60
- end
61
- end
62
-
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ #require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ #require "action_mailer/railtie"
7
+ #require "active_resource/railtie"
8
+ require "sprockets/railtie"
9
+ # require "rails/test_unit/railtie"
10
+
11
+ Bundler.require
12
+ require "stackable_flash"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- 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
+ # Configure the default encoding used in templates for Ruby 1.9.
39
+ config.encoding = "utf-8"
40
+
41
+ # Configure sensitive parameters which will be filtered from the log file.
42
+ config.filter_parameters += [:password]
43
+
44
+ # Use SQL instead of Active Record's schema dumper when creating the database.
45
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
46
+ # like if you have constraints or database-specific column types
47
+ # config.active_record.schema_format = :sql
48
+
49
+ # Enforce whitelist mode for mass assignment.
50
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
51
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
52
+ # parameters by using an attr_accessible or attr_protected declaration.
53
+ # config.active_record.whitelist_attributes = true
54
+
55
+ # Enable the asset pipeline
56
+ config.assets.enabled = true
57
+
58
+ # Version of your assets, change this if you want to expire all your assets
59
+ config.assets.version = '1.0'
60
+ end
61
+ end
62
+