wicked-with-previous-support 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. data/.rvmrc +19 -0
  2. data/CHANGELOG.md +22 -0
  3. data/Gemfile +20 -0
  4. data/Gemfile.lock +113 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.md +20 -0
  7. data/Rakefile +50 -0
  8. data/VERSION +1 -0
  9. data/app/controllers/wicked/wizard_controller.rb +38 -0
  10. data/lib/wicked/controller/concerns/path.rb +31 -0
  11. data/lib/wicked/controller/concerns/render_redirect.rb +46 -0
  12. data/lib/wicked/controller/concerns/steps.rb +46 -0
  13. data/lib/wicked/engine.rb +4 -0
  14. data/lib/wicked/wizard.rb +24 -0
  15. data/lib/wicked.rb +14 -0
  16. data/test/dummy/Rakefile +7 -0
  17. data/test/dummy/app/controllers/application_controller.rb +3 -0
  18. data/test/dummy/app/controllers/bar_controller.rb +14 -0
  19. data/test/dummy/app/controllers/foo_controller.rb +13 -0
  20. data/test/dummy/app/helpers/application_helper.rb +2 -0
  21. data/test/dummy/app/views/bar/first.html.erb +6 -0
  22. data/test/dummy/app/views/bar/last_step.html.erb +1 -0
  23. data/test/dummy/app/views/bar/second.html.erb +1 -0
  24. data/test/dummy/app/views/foo/first.html.erb +1 -0
  25. data/test/dummy/app/views/foo/last_step.html.erb +0 -0
  26. data/test/dummy/app/views/foo/second.html.erb +1 -0
  27. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  28. data/test/dummy/config/application.rb +45 -0
  29. data/test/dummy/config/boot.rb +10 -0
  30. data/test/dummy/config/database.yml +22 -0
  31. data/test/dummy/config/environment.rb +5 -0
  32. data/test/dummy/config/environments/development.rb +26 -0
  33. data/test/dummy/config/environments/production.rb +49 -0
  34. data/test/dummy/config/environments/test.rb +35 -0
  35. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  36. data/test/dummy/config/initializers/inflections.rb +10 -0
  37. data/test/dummy/config/initializers/mime_types.rb +5 -0
  38. data/test/dummy/config/initializers/secret_token.rb +7 -0
  39. data/test/dummy/config/initializers/session_store.rb +8 -0
  40. data/test/dummy/config/locales/en.yml +5 -0
  41. data/test/dummy/config/routes.rb +61 -0
  42. data/test/dummy/config.ru +4 -0
  43. data/test/dummy/public/404.html +26 -0
  44. data/test/dummy/public/422.html +26 -0
  45. data/test/dummy/public/500.html +26 -0
  46. data/test/dummy/public/favicon.ico +0 -0
  47. data/test/dummy/public/index.html +1 -0
  48. data/test/dummy/public/javascripts/application.js +2 -0
  49. data/test/dummy/public/javascripts/controls.js +965 -0
  50. data/test/dummy/public/javascripts/dragdrop.js +974 -0
  51. data/test/dummy/public/javascripts/effects.js +1123 -0
  52. data/test/dummy/public/javascripts/prototype.js +6001 -0
  53. data/test/dummy/public/javascripts/rails.js +202 -0
  54. data/test/dummy/public/stylesheets/.gitkeep +0 -0
  55. data/test/dummy/script/rails +6 -0
  56. data/test/integration/helpers_test.rb +26 -0
  57. data/test/integration/navigation_test.rb +72 -0
  58. data/test/support/integration_case.rb +5 -0
  59. data/test/test_helper.rb +30 -0
  60. data/test/wicked_test.rb +7 -0
  61. data/wicked.gemspec +120 -0
  62. metadata +201 -0
data/.rvmrc ADDED
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+
3
+ ruby_string="ruby-1.9.2-p290"
4
+ gemset_name="wicked"
5
+
6
+ if rvm list strings | grep -q "${ruby_string}" ; then
7
+
8
+ rvm use "${ruby_string}@${gemset_name}" --create
9
+
10
+ # Complain if bundler isn't installed
11
+ if [[ -z "`gem which bundler 2>&1 | grep -v ERROR`" ]]; then
12
+ echo "You need bundler:"
13
+ echo ""
14
+ echo " gem install bundler"
15
+ echo ""
16
+ fi
17
+ else
18
+ echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory."
19
+ fi
data/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ ## 0.1.2 (3/16/2012)
2
+
3
+ * next_wizard_path takes options (thanks @Flink)
4
+
5
+
6
+ ## 0.1.1 (3/16/2012)
7
+
8
+ * fixed include bug
9
+
10
+
11
+ ## 0.1.0 (3/11/2012)
12
+
13
+ * Allow including `Wicked::Wizard` into controllers
14
+ * Added Tests for Helpers
15
+
16
+ ## 0.0.2
17
+
18
+ * Fixed url bug
19
+
20
+ ## 0.0.1
21
+
22
+ * First Release
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "activesupport" , ">= 3.0.7"
4
+ gem "rails" , ">= 3.0.7"
5
+
6
+
7
+
8
+ group :development do
9
+ gem 'jeweler', "~> 1.6.4"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "rcov", ">= 0"
12
+ gem "capybara", ">= 0.4.0"
13
+ gem "sqlite3"
14
+ gem "launchy"
15
+ end
16
+
17
+
18
+ # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
19
+ # gem 'ruby-debug'
20
+ # gem 'ruby-debug19'
data/Gemfile.lock ADDED
@@ -0,0 +1,113 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.11)
6
+ actionpack (= 3.0.11)
7
+ mail (~> 2.2.19)
8
+ actionpack (3.0.11)
9
+ activemodel (= 3.0.11)
10
+ activesupport (= 3.0.11)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.5.0)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.14)
16
+ rack-test (~> 0.5.7)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.11)
19
+ activesupport (= 3.0.11)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.5.0)
22
+ activerecord (3.0.11)
23
+ activemodel (= 3.0.11)
24
+ activesupport (= 3.0.11)
25
+ arel (~> 2.0.10)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.11)
28
+ activemodel (= 3.0.11)
29
+ activesupport (= 3.0.11)
30
+ activesupport (3.0.11)
31
+ addressable (2.2.7)
32
+ arel (2.0.10)
33
+ builder (2.1.2)
34
+ capybara (1.1.2)
35
+ mime-types (>= 1.16)
36
+ nokogiri (>= 1.3.3)
37
+ rack (>= 1.0.0)
38
+ rack-test (>= 0.5.4)
39
+ selenium-webdriver (~> 2.0)
40
+ xpath (~> 0.1.4)
41
+ childprocess (0.2.4)
42
+ ffi (~> 1.0.6)
43
+ erubis (2.6.6)
44
+ abstract (>= 1.0.0)
45
+ ffi (1.0.11)
46
+ git (1.2.5)
47
+ i18n (0.5.0)
48
+ jeweler (1.6.4)
49
+ bundler (~> 1.0)
50
+ git (>= 1.2.5)
51
+ rake
52
+ json (1.6.4)
53
+ launchy (2.0.5)
54
+ addressable (~> 2.2.6)
55
+ mail (2.2.19)
56
+ activesupport (>= 2.3.6)
57
+ i18n (>= 0.4.0)
58
+ mime-types (~> 1.16)
59
+ treetop (~> 1.4.8)
60
+ mime-types (1.17.2)
61
+ multi_json (1.0.4)
62
+ nokogiri (1.5.0)
63
+ polyglot (0.3.3)
64
+ rack (1.2.4)
65
+ rack-mount (0.6.14)
66
+ rack (>= 1.0.0)
67
+ rack-test (0.5.7)
68
+ rack (>= 1.0)
69
+ rails (3.0.11)
70
+ actionmailer (= 3.0.11)
71
+ actionpack (= 3.0.11)
72
+ activerecord (= 3.0.11)
73
+ activeresource (= 3.0.11)
74
+ activesupport (= 3.0.11)
75
+ bundler (~> 1.0)
76
+ railties (= 3.0.11)
77
+ railties (3.0.11)
78
+ actionpack (= 3.0.11)
79
+ activesupport (= 3.0.11)
80
+ rake (>= 0.8.7)
81
+ rdoc (~> 3.4)
82
+ thor (~> 0.14.4)
83
+ rake (0.9.2.2)
84
+ rcov (0.9.11)
85
+ rdoc (3.12)
86
+ json (~> 1.4)
87
+ rubyzip (0.9.5)
88
+ selenium-webdriver (2.15.0)
89
+ childprocess (>= 0.2.1)
90
+ ffi (~> 1.0.9)
91
+ multi_json (~> 1.0.4)
92
+ rubyzip
93
+ sqlite3 (1.3.5)
94
+ thor (0.14.6)
95
+ treetop (1.4.10)
96
+ polyglot
97
+ polyglot (>= 0.3.1)
98
+ tzinfo (0.3.31)
99
+ xpath (0.1.4)
100
+ nokogiri (~> 1.3)
101
+
102
+ PLATFORMS
103
+ ruby
104
+
105
+ DEPENDENCIES
106
+ activesupport (>= 3.0.7)
107
+ bundler (~> 1.0.0)
108
+ capybara (>= 0.4.0)
109
+ jeweler (~> 1.6.4)
110
+ launchy
111
+ rails (>= 3.0.7)
112
+ rcov
113
+ sqlite3
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2011 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Wicked
2
+
3
+ Use wicked to make your Rails controllers into step-by-step wizards. To see Wicked in action check out the example [Rails app](https://github.com/schneems/wicked_example) or [watch the screencast](http://schneems.com/post/18437886598/wizard-ify-your-rails-controllers-with-wicked).
4
+
5
+ # Why This fork is for
6
+
7
+ This is a fork from the original wicked : https://github.com/schneems/wicked, and it's purpose is adding the ability to browse backwards in the wizard, and in this fork I'm introducing the following methods:
8
+
9
+ View/URL Helpers
10
+
11
+ ```ruby
12
+ previous_wizard_path # Url of the next step
13
+ ```
14
+ Controller Tidbits:
15
+
16
+ ```ruby
17
+ previous_step # Gets symbol of next step
18
+ ```
19
+
20
+
data/Rakefile ADDED
@@ -0,0 +1,50 @@
1
+ # encoding: UTF-8
2
+ require 'rubygems'
3
+ require 'bundler'
4
+
5
+ begin
6
+ Bundler.setup(:default, :development, :test)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+
13
+ require 'rake'
14
+ require 'rdoc/task'
15
+
16
+ require 'rake/testtask'
17
+
18
+ Rake::TestTask.new(:test) do |t|
19
+ t.libs << 'lib'
20
+ t.libs << 'test'
21
+ t.pattern = 'test/**/*_test.rb'
22
+ t.verbose = false
23
+ end
24
+
25
+ task :default => :test
26
+
27
+ Rake::RDocTask.new(:rdoc) do |rdoc|
28
+ rdoc.rdoc_dir = 'rdoc'
29
+ rdoc.title = 'Wicked'
30
+ rdoc.options << '--line-numbers' << '--inline-source'
31
+ rdoc.rdoc_files.include('README.rdoc')
32
+ rdoc.rdoc_files.include('lib/**/*.rb')
33
+ end
34
+
35
+
36
+ require 'jeweler'
37
+ Jeweler::Tasks.new do |gem|
38
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
39
+ gem.name = "wicked"
40
+ gem.homepage = "http://github.com/schneems/wicked"
41
+ gem.license = "MIT"
42
+ gem.summary = %Q{Use Wicked to turn your controller into a wizard}
43
+ gem.description = %Q{Wicked is a Rails engine for producing easy wizard controllers}
44
+ gem.email = "richard.schneeman@gmail.com"
45
+ gem.authors = ["schneems"]
46
+ # dependencies defined in Gemfile
47
+ end
48
+ Jeweler::RubygemsDotOrgTasks.new
49
+
50
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
@@ -0,0 +1,38 @@
1
+ # Please don't re-use any patterns found in this controller,
2
+ # they work, but are not very good practices.
3
+ # If you have a better way to do this, please let me know
4
+
5
+ class Wicked::WizardController < ApplicationController
6
+ include Wicked::Wizard
7
+
8
+ # def index
9
+ # # redirect_to_first_step
10
+ # end
11
+
12
+ # steps :confirm_password, :invite_fb
13
+
14
+ # @example show action
15
+ # def show
16
+ # case step
17
+ # when :confirm_password
18
+ # redirect_to_next(@next_step) and return nil unless @user.facebook?
19
+ # when :invite_fb
20
+ # redirect_to_next(@next_step) and return nil unless @user.facebook?
21
+ # end
22
+ # render_wizard
23
+ # end
24
+
25
+
26
+ # @example update action
27
+ # def update
28
+ # case step
29
+ # when :confirm_password
30
+ # @user.update_attributes(params[:user])
31
+ # when :confirm_profile
32
+ # @user.update_attributes(params[:user])
33
+ # end
34
+ # sign_in(@user, :bypass => true) # needed for devise
35
+ # render_wizard
36
+ # end
37
+ end
38
+
@@ -0,0 +1,31 @@
1
+ module Wicked::Controller::Concerns::Path
2
+ extend ActiveSupport::Concern
3
+
4
+
5
+ def next_wizard_path(options = {})
6
+ wizard_path(@next_step, options)
7
+ end
8
+
9
+ def previous_wizard_path(options = {})
10
+ wizard_path(previous_step(@step), options)
11
+ end
12
+
13
+ def controller
14
+ params[:controller]
15
+ end
16
+
17
+ def action
18
+ params[:action]
19
+ end
20
+
21
+
22
+ def wizard_path(goto_step = nil, options = {})
23
+ options = {
24
+ :controller => controller,
25
+ :action => 'show',
26
+ :id => goto_step || params[:id],
27
+ :only_path => true
28
+ }.merge options
29
+ url_for(options)
30
+ end
31
+ end
@@ -0,0 +1,46 @@
1
+ module Wicked::Controller::Concerns::RenderRedirect
2
+ extend ActiveSupport::Concern
3
+
4
+
5
+ # scary and gross, allows for double render
6
+ def _reset_invocation_response
7
+ self.instance_variable_set(:@_response_body, nil)
8
+ response.instance_variable_set :@header, Rack::Utils::HeaderHash.new("cookie" => [], 'Content-Type' => 'text/html')
9
+ end
10
+
11
+
12
+ def render_wizard(resource = nil)
13
+ _reset_invocation_response
14
+ @skip_to = @next_step if resource && resource.save
15
+ if @skip_to.present?
16
+ redirect_to wizard_path @skip_to
17
+ else
18
+ render_step @step
19
+ end
20
+ end
21
+
22
+ def render_step(the_step)
23
+ if the_step.nil? || the_step == :finish
24
+ redirect_to_finish_wizard
25
+ else
26
+ render the_step
27
+ end
28
+ end
29
+
30
+ def redirect_to_next(next_step)
31
+ if next_step.nil?
32
+ redirect_to_finish_wizard
33
+ else
34
+ redirect_to wizard_path(next_step)
35
+ end
36
+ end
37
+
38
+ def finish_wizard_path
39
+ '/'
40
+ end
41
+
42
+ def redirect_to_finish_wizard
43
+ redirect_to finish_wizard_path
44
+ end
45
+
46
+ end
@@ -0,0 +1,46 @@
1
+ module Wicked::Controller::Concerns::Steps
2
+ extend ActiveSupport::Concern
3
+
4
+
5
+ def jump_to(goto_step)
6
+ @skip_to = goto_step
7
+ end
8
+
9
+ def skip_step
10
+ @skip_to = @next_step
11
+ end
12
+
13
+ def step
14
+ @step
15
+ end
16
+
17
+ module ClassMethods
18
+ def steps=(steps)
19
+ @wizard_steps = steps
20
+ end
21
+
22
+ def steps(*steps_to_set)
23
+ @wizard_steps = steps_to_set unless steps_to_set.blank?
24
+ @wizard_steps
25
+ end
26
+ end
27
+
28
+ def steps
29
+ self.class.steps
30
+ end
31
+
32
+
33
+ def next_step(current_step)
34
+ index = steps.index(current_step)
35
+ step = steps.at(index + 1) if index.present?
36
+ step ||= :finish
37
+ step
38
+ end
39
+
40
+ def previous_step(current_step)
41
+ index = steps.index(current_step)
42
+ step = steps.at(index - 1) if index.present?
43
+ step ||= steps.at(0)
44
+ step
45
+ end
46
+ end
@@ -0,0 +1,4 @@
1
+ module Wicked
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
@@ -0,0 +1,24 @@
1
+ module Wicked
2
+ module Wizard
3
+ extend ActiveSupport::Concern
4
+
5
+ # Include the modules!!
6
+ include Wicked::Controller::Concerns::Path
7
+ include Wicked::Controller::Concerns::RenderRedirect
8
+ include Wicked::Controller::Concerns::Steps
9
+
10
+ included do
11
+ # Give our Views helper methods!
12
+ helper_method :wizard_path, :next_wizard_path
13
+ # Set @step and @next_step variables
14
+ before_filter :setup_wizard
15
+ end
16
+
17
+ private
18
+ def setup_wizard
19
+ @step = params[:id].try(:to_sym) || steps.first
20
+ @next_step = next_step(@step)
21
+ end
22
+ public
23
+ end
24
+ end
data/lib/wicked.rb ADDED
@@ -0,0 +1,14 @@
1
+ module Wicked
2
+ module Controller
3
+ module Concerns
4
+ end
5
+ end
6
+ module Wizard
7
+ end
8
+ end
9
+
10
+ require 'wicked/controller/concerns/render_redirect'
11
+ require 'wicked/controller/concerns/steps'
12
+ require 'wicked/controller/concerns/path'
13
+ require 'wicked/wizard'
14
+ require 'wicked/engine'
@@ -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,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,14 @@
1
+ ## This controller uses includes
2
+
3
+ class BarController < ApplicationController
4
+ include Wicked::Wizard
5
+ steps :first, :second, :last_step
6
+
7
+ def show
8
+ skip_step if params[:skip_step]
9
+ render_wizard
10
+ end
11
+
12
+ def update
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ ## This controller uses inheritance
2
+
3
+ class FooController < Wicked::WizardController
4
+ steps :first, :second, :last_step
5
+
6
+ def show
7
+ skip_step if params[:skip_step]
8
+ render_wizard
9
+ end
10
+
11
+ def update
12
+ end
13
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,6 @@
1
+ first
2
+
3
+
4
+ <%= link_to 'last', wizard_path(:last_step) %>
5
+ <%= link_to 'current', wizard_path %>
6
+ <%= link_to 'skip', next_wizard_path %>
@@ -0,0 +1 @@
1
+ last_step
@@ -0,0 +1 @@
1
+ second
@@ -0,0 +1 @@
1
+ first
File without changes
@@ -0,0 +1 @@
1
+ second
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -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"
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,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
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__)
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
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: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!