wicked-focused 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +19 -0
- data/.travis.yml +4 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +22 -0
- data/Gemfile.lock +122 -0
- data/MIT-LICENSE +20 -0
- data/README.md +253 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/lib/wicked/action.rb +64 -0
- data/lib/wicked/controller/concerns/path.rb +29 -0
- data/lib/wicked/controller/concerns/render_redirect.rb +49 -0
- data/lib/wicked/controller/concerns/steps.rb +87 -0
- data/lib/wicked/engine.rb +4 -0
- data/lib/wicked/macros.rb +23 -0
- data/lib/wicked/wizard.rb +26 -0
- data/lib/wicked-focused.rb +25 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/bar_controller.rb +18 -0
- data/test/dummy/app/controllers/foo_controller.rb +19 -0
- data/test/dummy/app/controllers/jump_controller.rb +26 -0
- data/test/dummy/app/controllers/steps_controller.rb +18 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/bar.rb +9 -0
- data/test/dummy/app/views/bar/first.html.erb +5 -0
- data/test/dummy/app/views/bar/last_step.html.erb +3 -0
- data/test/dummy/app/views/bar/second.html.erb +3 -0
- data/test/dummy/app/views/foo/first.html.erb +1 -0
- data/test/dummy/app/views/foo/last_step.html.erb +1 -0
- data/test/dummy/app/views/foo/second.html.erb +1 -0
- data/test/dummy/app/views/jump/first.html.erb +1 -0
- data/test/dummy/app/views/jump/last_step.html.erb +1 -0
- data/test/dummy/app/views/jump/second.html.erb +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/step_positions/_step_position.html.erb +9 -0
- data/test/dummy/app/views/step_positions/first.html.erb +1 -0
- data/test/dummy/app/views/step_positions/last_step.html.erb +1 -0
- data/test/dummy/app/views/step_positions/second.html.erb +1 -0
- data/test/dummy/config/application.rb +45 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +22 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wicked.rb +2 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +8 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/index.html +1 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +202 -0
- data/test/dummy/public/stylesheets/.gitkeep +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/integration/helpers_test.rb +40 -0
- data/test/integration/jump_test.rb +16 -0
- data/test/integration/navigation_test.rb +88 -0
- data/test/integration/steps_test.rb +32 -0
- data/test/support/integration_case.rb +5 -0
- data/test/test_helper.rb +30 -0
- data/test/wicked_test.rb +7 -0
- data/wicked-focused.gemspec +138 -0
- metadata +270 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
module Wicked::Controller::Concerns::Steps
|
2
|
+
extend ActiveSupport::Concern
|
3
|
+
|
4
|
+
def jump_to(goto_step)
|
5
|
+
@skip_to = goto_step
|
6
|
+
end
|
7
|
+
|
8
|
+
def skip_step
|
9
|
+
@skip_to = @next_step
|
10
|
+
end
|
11
|
+
|
12
|
+
def step
|
13
|
+
@step
|
14
|
+
end
|
15
|
+
|
16
|
+
# will return true if step passed in is the currently rendered step
|
17
|
+
def current_step?(step_name)
|
18
|
+
return false if step_name.nil? || step.nil?
|
19
|
+
step == step_name
|
20
|
+
end
|
21
|
+
|
22
|
+
# will return true if the step passed in has already been executed by the wizard
|
23
|
+
def past_step?(step_name)
|
24
|
+
return false if steps.index(step).nil? || steps.index(step_name).nil?
|
25
|
+
steps.index(step) > steps.index(step_name)
|
26
|
+
end
|
27
|
+
|
28
|
+
# will return true if the step passed in has already been executed by the wizard
|
29
|
+
def future_step?(step_name)
|
30
|
+
return false if steps.index(step).nil? || steps.index(step_name).nil?
|
31
|
+
steps.index(step) < steps.index(step_name)
|
32
|
+
end
|
33
|
+
|
34
|
+
# will return true if the last step is the step passed in
|
35
|
+
def previous_step?(step_name)
|
36
|
+
return false if steps.index(step).nil? || steps.index(step_name).nil?
|
37
|
+
steps.index(step) - 1 == steps.index(step_name)
|
38
|
+
end
|
39
|
+
|
40
|
+
# will return true if the next step is the step passed in
|
41
|
+
def next_step?(step_name)
|
42
|
+
return false if steps.index(step).nil? || steps.index(step_name).nil?
|
43
|
+
steps.index(step) + 1 == steps.index(step_name)
|
44
|
+
end
|
45
|
+
|
46
|
+
module ClassMethods
|
47
|
+
attr_reader :wizard_steps
|
48
|
+
|
49
|
+
def steps(*args)
|
50
|
+
options = args.last.is_a?(Hash) ? callbacks.pop : {}
|
51
|
+
steps = args
|
52
|
+
@wizard_steps = args
|
53
|
+
prepend_before_filter(options) do
|
54
|
+
self.steps = steps
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def steps=(wizard_steps)
|
60
|
+
@wizard_steps = wizard_steps
|
61
|
+
end
|
62
|
+
|
63
|
+
def steps
|
64
|
+
@wizard_steps
|
65
|
+
end
|
66
|
+
alias :wizard_steps :steps
|
67
|
+
alias :steps_list :steps
|
68
|
+
|
69
|
+
def previous_step(current_step = nil)
|
70
|
+
return previous_step if current_step == nil
|
71
|
+
index = steps.index(current_step)
|
72
|
+
step = steps.at(index - 1) if index.present? && index != 0
|
73
|
+
step ||= steps.first
|
74
|
+
step
|
75
|
+
end
|
76
|
+
|
77
|
+
|
78
|
+
def next_step(current_step = nil)
|
79
|
+
return next_step if current_step == nil
|
80
|
+
index = steps.index(current_step)
|
81
|
+
step = steps.at(index + 1) if index.present?
|
82
|
+
step ||= :finish
|
83
|
+
step
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
class Module
|
2
|
+
def use_wicked_macros
|
3
|
+
use_focused_macros
|
4
|
+
extend Wicked::Macros
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
module Wicked
|
9
|
+
module Macros
|
10
|
+
def wicked_wizard
|
11
|
+
include Wicked::Wizard
|
12
|
+
end
|
13
|
+
|
14
|
+
def wicked_base_action &block
|
15
|
+
focused_action :action do
|
16
|
+
include Wicked::Action
|
17
|
+
|
18
|
+
instance_eval &block
|
19
|
+
end
|
20
|
+
wicked_wizard
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Wicked
|
2
|
+
module Wizard
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
included do
|
6
|
+
use_focused_macros
|
7
|
+
focused_action :index, "#{self.name}::Action".constantize do
|
8
|
+
run do
|
9
|
+
redirect_to wizard_path(steps.first)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
module ClassMethods
|
15
|
+
def wizard_actions *names
|
16
|
+
names.each do |name|
|
17
|
+
wizard_action name
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def wizard_action action, &block
|
22
|
+
focused_action action, "#{self.name}::Action".constantize, &block
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module Wicked
|
2
|
+
module Controller
|
3
|
+
module Concerns
|
4
|
+
end
|
5
|
+
end
|
6
|
+
module Wizard
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
class ApplicationController < ActionController::Base
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'focused_controller'
|
14
|
+
require 'focused_controller/macros'
|
15
|
+
require 'focused_controller/focused_action'
|
16
|
+
|
17
|
+
require 'wicked/controller/concerns/render_redirect'
|
18
|
+
require 'wicked/controller/concerns/steps'
|
19
|
+
require 'wicked/controller/concerns/path'
|
20
|
+
require 'wicked/action'
|
21
|
+
require 'wicked/wizard'
|
22
|
+
require 'wicked/macros'
|
23
|
+
require 'wicked/engine'
|
24
|
+
|
25
|
+
|
data/test/dummy/Rakefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
|
+
|
4
|
+
require File.expand_path('../config/application', __FILE__)
|
5
|
+
require 'rake'
|
6
|
+
|
7
|
+
Dummy::Application.load_tasks
|
@@ -0,0 +1,18 @@
|
|
1
|
+
## This controller uses includes
|
2
|
+
|
3
|
+
module BarController
|
4
|
+
use_wicked_macros
|
5
|
+
|
6
|
+
wicked_base_action do
|
7
|
+
steps :first, :second, :last_step
|
8
|
+
end
|
9
|
+
|
10
|
+
wizard_action :show do
|
11
|
+
wizard do
|
12
|
+
skip_step if params[:skip_step]
|
13
|
+
render_wizard
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
focused_action :update
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
## This controller uses inheritance
|
2
|
+
|
3
|
+
module FooController
|
4
|
+
class Action < FocusedAction
|
5
|
+
include Wicked::Action
|
6
|
+
|
7
|
+
steps :first, :second, :last_step
|
8
|
+
end
|
9
|
+
include Wicked::Wizard
|
10
|
+
|
11
|
+
wizard_action :show do
|
12
|
+
wizard do
|
13
|
+
skip_step if params[:skip_step]
|
14
|
+
render_wizard
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
wizard_action :update
|
19
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
## This controller uses includes
|
2
|
+
|
3
|
+
module JumpController
|
4
|
+
class Action < FocusedAction
|
5
|
+
include Wicked::Action
|
6
|
+
|
7
|
+
steps :first, :second, :last_step
|
8
|
+
end
|
9
|
+
include Wicked::Wizard
|
10
|
+
|
11
|
+
wizard_action :show do
|
12
|
+
wizard do
|
13
|
+
skip_step if params[:skip_step]
|
14
|
+
jump_to :last_step if params[:jump_to]
|
15
|
+
if params[:resource]
|
16
|
+
value = params[:resource][:save] == 'true'
|
17
|
+
@bar = Bar.new(value)
|
18
|
+
render_wizard(@bar)
|
19
|
+
else
|
20
|
+
render_wizard
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
wizard_action :update
|
26
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
## This controller uses includes
|
2
|
+
|
3
|
+
module StepPositionsController
|
4
|
+
class Action < FocusedAction
|
5
|
+
include Wicked::Action
|
6
|
+
|
7
|
+
steps :first, :second, :last_step
|
8
|
+
end
|
9
|
+
include Wicked::Wizard
|
10
|
+
|
11
|
+
wizard_action :show do
|
12
|
+
wizard do
|
13
|
+
render_wizard
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
wizard_action :update
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
first
|
@@ -0,0 +1 @@
|
|
1
|
+
last_step
|
@@ -0,0 +1 @@
|
|
1
|
+
second
|
@@ -0,0 +1 @@
|
|
1
|
+
first
|
@@ -0,0 +1 @@
|
|
1
|
+
last_step
|
@@ -0,0 +1 @@
|
|
1
|
+
second
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<% wizard_steps.each do |s| %>
|
2
|
+
<p>
|
3
|
+
<%= "#{s} step is the current step" if current_step?(s) %><br />
|
4
|
+
<%= "#{s} step is a past step" if past_step?(s) %><br />
|
5
|
+
<%= "#{s} step is a future step" if future_step?(s) %><br />
|
6
|
+
<%= "#{s} step was the previous step" if previous_step?(s) %><br />
|
7
|
+
<%= "#{s} step is the next step" if next_step?(s) %><br />
|
8
|
+
</p>
|
9
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'step_position' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'step_position' %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render 'step_position' %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require "active_model/railtie"
|
4
|
+
require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_view/railtie"
|
7
|
+
require "action_mailer/railtie"
|
8
|
+
|
9
|
+
Bundler.require
|
10
|
+
require "wicked-focused"
|
11
|
+
|
12
|
+
module Dummy
|
13
|
+
class Application < Rails::Application
|
14
|
+
# Settings in config/environments/* take precedence over those specified here.
|
15
|
+
# Application configuration should go into files in config/initializers
|
16
|
+
# -- all .rb files in that directory are automatically loaded.
|
17
|
+
|
18
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
19
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
20
|
+
|
21
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
22
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
23
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
24
|
+
|
25
|
+
# Activate observers that should always be running.
|
26
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
27
|
+
|
28
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
29
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
30
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
31
|
+
|
32
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
33
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
|
+
# config.i18n.default_locale = :de
|
35
|
+
|
36
|
+
# JavaScript files you want as :defaults (application.js is always included).
|
37
|
+
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
38
|
+
|
39
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
40
|
+
config.encoding = "utf-8"
|
41
|
+
|
42
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
43
|
+
config.filter_parameters += [:password]
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
development:
|
4
|
+
adapter: sqlite3
|
5
|
+
database: ":memory:"
|
6
|
+
pool: 5
|
7
|
+
timeout: 5000
|
8
|
+
|
9
|
+
# Warning: The database defined as "test" will be erased and
|
10
|
+
# re-generated from your development database when you run "rake".
|
11
|
+
# Do not set this db to the same as development or production.
|
12
|
+
test:
|
13
|
+
adapter: sqlite3
|
14
|
+
database: ":memory:"
|
15
|
+
pool: 5
|
16
|
+
timeout: 5000
|
17
|
+
|
18
|
+
production:
|
19
|
+
adapter: sqlite3
|
20
|
+
database: ":memory:"
|
21
|
+
pool: 5
|
22
|
+
timeout: 5000
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver 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_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
|
20
|
+
# Print deprecation notices to the Rails logger
|
21
|
+
config.active_support.deprecation = :log
|
22
|
+
|
23
|
+
# Only use best-standards-support built into browsers
|
24
|
+
config.action_dispatch.best_standards_support = :builtin
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# Specifies the header that your server uses for sending files
|
13
|
+
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
14
|
+
|
15
|
+
# For nginx:
|
16
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
17
|
+
|
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
|
20
|
+
|
21
|
+
# See everything in the log (default is :info)
|
22
|
+
# config.log_level = :debug
|
23
|
+
|
24
|
+
# Use a different logger for distributed setups
|
25
|
+
# config.logger = SyslogLogger.new
|
26
|
+
|
27
|
+
# Use a different cache store in production
|
28
|
+
# config.cache_store = :mem_cache_store
|
29
|
+
|
30
|
+
# Disable Rails's static asset server
|
31
|
+
# In production, Apache or nginx will already do this
|
32
|
+
config.serve_static_assets = false
|
33
|
+
|
34
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
35
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
36
|
+
|
37
|
+
# Disable delivery errors, bad email addresses will be ignored
|
38
|
+
# config.action_mailer.raise_delivery_errors = false
|
39
|
+
|
40
|
+
# Enable threaded mode
|
41
|
+
# config.threadsafe!
|
42
|
+
|
43
|
+
# 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)
|
45
|
+
config.i18n.fallbacks = true
|
46
|
+
|
47
|
+
# Send deprecation notices to registered listeners
|
48
|
+
config.active_support.deprecation = :notify
|
49
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Dummy::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
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
|
27
|
+
|
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
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
@@ -0,0 +1,7 @@
|
|
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!
|
@@ -0,0 +1,10 @@
|
|
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
|
@@ -0,0 +1,7 @@
|
|
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
|
+
Dummy::Application.config.secret_token = 'bedc31c5fff702ea808045bbbc5123455f1c00ecd005a1f667a5f04332100a6abf22cfcee2b3d39b8f677c03bb6503cf1c3b65c1287b9e13bd0d20c6431ec6ab'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
Dummy::Application.config.session_store :cookie_store, :key => '_dummy_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
|
+
# Dummy::Application.config.session_store :active_record_store
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/404.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|