pluggable_js 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/CHANGELOG.md +23 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE +20 -0
  6. data/README.md +47 -0
  7. data/Rakefile +1 -0
  8. data/features/pluggable_js.feature +15 -0
  9. data/features/step_definitions/pluggable_js_steps.rb +15 -0
  10. data/features/support/env.rb +19 -0
  11. data/lib/generators/pluggable_js/USAGE +8 -0
  12. data/lib/generators/pluggable_js/pluggable_js_generator.rb +23 -0
  13. data/lib/generators/pluggable_js/templates/function_caller.js.coffee +11 -0
  14. data/lib/pluggable_js/config.rb +16 -0
  15. data/lib/pluggable_js/helpers.rb +25 -0
  16. data/lib/pluggable_js/railtie.rb +7 -0
  17. data/lib/pluggable_js/version.rb +3 -0
  18. data/lib/pluggable_js.rb +10 -0
  19. data/pluggable_js.gemspec +31 -0
  20. data/test/dummy/README.rdoc +28 -0
  21. data/test/dummy/Rakefile +6 -0
  22. data/test/dummy/app/assets/images/.keep +0 -0
  23. data/test/dummy/app/assets/javascripts/application.js +14 -0
  24. data/test/dummy/app/assets/javascripts/pluggable/posts/index.js.coffee +11 -0
  25. data/test/dummy/app/assets/javascripts/pluggable/posts/new.js.coffee +11 -0
  26. data/test/dummy/app/assets/javascripts/posts.js.coffee +5 -0
  27. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  28. data/test/dummy/app/controllers/application_controller.rb +5 -0
  29. data/test/dummy/app/controllers/concerns/.keep +0 -0
  30. data/test/dummy/app/controllers/posts_controller.rb +7 -0
  31. data/test/dummy/app/helpers/application_helper.rb +2 -0
  32. data/test/dummy/app/mailers/.keep +0 -0
  33. data/test/dummy/app/models/.keep +0 -0
  34. data/test/dummy/app/models/concerns/.keep +0 -0
  35. data/test/dummy/app/views/layouts/application.html.erb +15 -0
  36. data/test/dummy/app/views/posts/index.html.erb +2 -0
  37. data/test/dummy/app/views/posts/new.html.erb +2 -0
  38. data/test/dummy/bin/bundle +3 -0
  39. data/test/dummy/bin/rails +4 -0
  40. data/test/dummy/bin/rake +4 -0
  41. data/test/dummy/config/application.rb +23 -0
  42. data/test/dummy/config/boot.rb +5 -0
  43. data/test/dummy/config/database.yml +25 -0
  44. data/test/dummy/config/environment.rb +5 -0
  45. data/test/dummy/config/environments/development.rb +29 -0
  46. data/test/dummy/config/environments/production.rb +80 -0
  47. data/test/dummy/config/environments/test.rb +36 -0
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  49. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/dummy/config/initializers/inflections.rb +16 -0
  51. data/test/dummy/config/initializers/mime_types.rb +5 -0
  52. data/test/dummy/config/initializers/secret_token.rb +12 -0
  53. data/test/dummy/config/initializers/session_store.rb +3 -0
  54. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  55. data/test/dummy/config/locales/en.yml +23 -0
  56. data/test/dummy/config/routes.rb +3 -0
  57. data/test/dummy/config.ru +4 -0
  58. data/test/dummy/db/development.sqlite3 +0 -0
  59. data/test/dummy/db/test.sqlite3 +0 -0
  60. data/test/dummy/lib/assets/.keep +0 -0
  61. data/test/dummy/public/404.html +58 -0
  62. data/test/dummy/public/422.html +58 -0
  63. data/test/dummy/public/500.html +57 -0
  64. data/test/dummy/public/favicon.ico +0 -0
  65. metadata +282 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6817aa80ad45a4ecc1698a6810bc46c37b60cfd0
4
+ data.tar.gz: 329eb1d15fb3a57f487322ee15040b113eabe7a4
5
+ SHA512:
6
+ metadata.gz: ffd735361c98f0a9b6122c9b642efa680011f35349001aed3633267e63115b18e28b6dd649f2315aa05c6502464a08c3981531f2807629e14197f4ce93a21175
7
+ data.tar.gz: 93473f70466749116f88366280ab4b6793b03c226abd5ae42ccd9819fe2841a716e992b3eb948d31c7b2686cde684087236ece42bbc09e03292380243178ac8a
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ .DS_Store
2
+ *.gem
3
+ *.rbc
4
+ .bundle
5
+ .config
6
+ .yardoc
7
+ .ruby-gemset
8
+ .ruby-version
9
+ Gemfile.lock
10
+ InstalledFiles
11
+ _yardoc
12
+ coverage
13
+ doc/
14
+ lib/bundler/man
15
+ pkg
16
+ rdoc
17
+ spec/reports
18
+ test/tmp
19
+ test/dummy/tmp
20
+ test/dummy/log
21
+ test/version_tmp
22
+ tmp
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ ## v0.0.1.rc
2
+
3
+ * initial release
4
+
5
+ ## v0.0.1.rc2
6
+
7
+ * extended readme
8
+
9
+ ## v0.0.1
10
+
11
+ * added tests
12
+
13
+ ## v0.0.2
14
+
15
+ * edited dependencies
16
+
17
+ ## v0.0.3
18
+
19
+ * edited rails as >= 3.1 dependency
20
+
21
+ ## v0.0.4
22
+
23
+ * added necessary folders to gitignore for dummy app
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pluggable_js.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Andrey Peresleguine
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # PluggableJs
2
+
3
+ Sometimes you need to use javascript only in specific pages, but you don't want to change DOM or write code in a view. Maybe you have one container with the same class in different templates, but part of bound logic is needed only in one. Or maybe some javascript causes exceptions in other views.
4
+
5
+ This gem provides simple functionality of loading javascript only in certain pages based on controller and action parameters. Keep your js code in controller related files as action based functions (still in asset pipeline). It will be triggered only if needed.
6
+
7
+ ## Installation
8
+
9
+ 1. Add `gem 'pluggable_js'` to Gemfile and run `bundle` command to install it
10
+ 2. Add `<%= javascript_pluggable_tag %>` to application layout file after `<%= javascript_include_tag 'application' %>` line
11
+ 3. Add `pluggable/*` to assets precompile configuration in production.rb (and staging.rb if you have one), e.g.: `config.assets.precompile += %w(pluggable/*)`
12
+ 4. Be sure that `pluggable` folder is out of `require_tree` statement in application.js
13
+
14
+ ## Usage
15
+
16
+ Choose controller and actions you want to use for pluggable js and run generator, e.g.:
17
+
18
+ rails generate pluggable_js Post index new
19
+
20
+ It will create two files (just function callers):
21
+
22
+ app/assets/javascripts/pluggable/posts/index.js.coffee
23
+ app/assets/javascripts/pluggable/posts/new.js.coffee
24
+
25
+ Now you simply have to define `Post.index` and `Post.new` functions in posts.js.coffee:
26
+
27
+ ```coffeescript
28
+ window.Post ||= {}
29
+ Post.index = () ->
30
+ # your code goes here
31
+ Post.new = () ->
32
+ # and here
33
+ ```
34
+
35
+ They will be triggered only when matching controller and action parameters.
36
+
37
+ ## Config
38
+
39
+ Let's say you've created action `search` that renders `index` template. Most likely we still need to trigger `Post.index()` function. In such situation you may create `config/initializers/pluggable_js.rb` and use pair actions config:
40
+
41
+ ```ruby
42
+ PluggableJs.config do |config|
43
+ config.pair_actions = { 'search' => 'index' }
44
+ end
45
+ ```
46
+
47
+ `{ 'create' => 'new', 'update' => 'edit' }` is a default REST configuration.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,15 @@
1
+ Feature: PluggableJs
2
+ In order to use some page specific javascript
3
+ I want to visit different pages and see different working scripts
4
+
5
+ @javascript
6
+ Scenario: Posts List
7
+ When I go to list of posts
8
+ Then I should see 'My life for aiur!'
9
+ And I should not see 'You wanna piece of me, boy?'
10
+
11
+ @javascript
12
+ Scenario: New Post
13
+ When I go to new post
14
+ Then I should see 'You wanna piece of me, boy?'
15
+ And I should not see 'My life for aiur!'
@@ -0,0 +1,15 @@
1
+ When(/^I go to list of posts$/) do
2
+ visit posts_path
3
+ end
4
+
5
+ When(/^I go to new post$/) do
6
+ visit new_post_path
7
+ end
8
+
9
+ Then(/^I should see '(.*?)'$/) do |text|
10
+ page.should have_content text
11
+ end
12
+
13
+ And(/^I should not see '(.*?)'$/) do |text|
14
+ page.should_not have_content text
15
+ end
@@ -0,0 +1,19 @@
1
+ require 'bundler'
2
+ begin
3
+ Bundler.setup(:default, :development)
4
+ rescue Bundler::BundlerError => e
5
+ $stderr.puts e.message
6
+ $stderr.puts "Run `bundle install` to install missing gems"
7
+ exit e.status_code
8
+ end
9
+
10
+ $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
11
+ require 'rspec/expectations'
12
+
13
+ ENV["RAILS_ENV"] ||= "test"
14
+ require File.expand_path("../../../test/dummy/config/environment.rb", __FILE__)
15
+ ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "../../../test/dummy"
16
+ require 'cucumber/rails'
17
+
18
+ require 'capybara-webkit'
19
+ Capybara.javascript_driver = :webkit
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Creates js files containing function callers based on controller and action parameters.
3
+
4
+ Example:
5
+ $ rails generate pluggable_js Post index new
6
+
7
+ create app/assets/javascripts/pluggable/posts/index.js.coffee
8
+ create app/assets/javascripts/pluggable/posts/show.js.coffee
@@ -0,0 +1,23 @@
1
+ class PluggableJsGenerator < Rails::Generators::Base
2
+ source_root File.expand_path('../templates', __FILE__)
3
+ argument :controller, type: :string
4
+ argument :actions, type: :array, default: [], banner: 'action action'
5
+
6
+ def create_pluggable_js_files
7
+ actions.each do |action|
8
+ @action = action
9
+ template 'function_caller.js.coffee', File.join('app/assets/javascripts/pluggable', controller_name, "#{action}.js.coffee")
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def model_name
16
+ controller.classify
17
+ end
18
+
19
+ def controller_name
20
+ controller.tableize
21
+ end
22
+
23
+ end
@@ -0,0 +1,11 @@
1
+ # Define somewhere in your controller related js file (e.g. <%= controller_name %>.js.coffee):
2
+ #
3
+ # window.<%= model_name %> ||= {}
4
+ # <%= model_name %>.<%= @action %> = () ->
5
+ # # your code goes here
6
+
7
+ jQuery ->
8
+ # whatever you want will be triggered from here
9
+ # only if this filepath matches current
10
+ # controller and action parameters
11
+ <%= model_name %>.<%= @action %>()
@@ -0,0 +1,16 @@
1
+ module PluggableJs
2
+ module Config
3
+ DEFAULT_PAIR_ACTIONS = { 'create' => 'new', 'update' => 'edit' }
4
+
5
+ class << self
6
+ def pair_actions=(hash = {})
7
+ @pair_actions = DEFAULT_PAIR_ACTIONS.merge hash
8
+ end
9
+
10
+ def pair_actions
11
+ @pair_actions ||= DEFAULT_PAIR_ACTIONS
12
+ end
13
+ end
14
+
15
+ end
16
+ end
@@ -0,0 +1,25 @@
1
+ module PluggableJs
2
+ module Helpers
3
+
4
+ def javascript_pluggable_tag
5
+ controller = params[:controller]
6
+ action = define_pair_action
7
+
8
+ if File.exist?(Rails.root + "app/assets/javascripts/pluggable/#{controller}/#{action}.js.coffee")
9
+ javascript_include_tag "pluggable/#{controller}/#{action}"
10
+ end
11
+ end
12
+
13
+ private
14
+
15
+ def define_pair_action
16
+ action = params[:action]
17
+ if Config.pair_actions.has_key?(action)
18
+ Config.pair_actions[action]
19
+ else
20
+ action
21
+ end
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,7 @@
1
+ module PluggableJs
2
+ class Railtie < Rails::Railtie
3
+ initializer "pluggable_js.helpers" do
4
+ ActionView::Base.send :include, Helpers
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module PluggableJs
2
+ VERSION = "0.0.4"
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'pluggable_js/version'
2
+ require 'pluggable_js/helpers'
3
+ require 'pluggable_js/config'
4
+ require 'pluggable_js/railtie' if defined?(Rails)
5
+
6
+ module PluggableJs
7
+ def self.config(&block)
8
+ block.call(Config)
9
+ end
10
+ end
@@ -0,0 +1,31 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pluggable_js/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'pluggable_js'
8
+ spec.version = PluggableJs::VERSION
9
+ spec.authors = ['Andrey Peresleguine']
10
+ spec.email = ['peresleguine@gmail.com']
11
+ spec.description = %q{Convention of how to load javascript only in certain pages based on controller and action parameters.}
12
+ spec.summary = %q{Pluggable javascript.}
13
+ spec.homepage = 'https://github.com/peresleguine/pluggable_js'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'coffee-rails'
22
+ spec.add_dependency 'jquery-rails'
23
+ spec.add_dependency 'rails', '>= 3.1'
24
+
25
+ spec.add_development_dependency 'bundler', '~> 1.3'
26
+ spec.add_development_dependency 'cucumber-rails'
27
+ spec.add_development_dependency 'rspec'
28
+ spec.add_development_dependency 'sqlite3'
29
+ spec.add_development_dependency 'database_cleaner'
30
+ spec.add_development_dependency 'capybara-webkit'
31
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+
6
+ Dummy::Application.load_tasks
File without changes
@@ -0,0 +1,14 @@
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
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require_directory
@@ -0,0 +1,11 @@
1
+ # Define somewhere in your controller related js file (e.g. posts.js.coffee):
2
+ #
3
+ # window.Post ||= {}
4
+ # Post.index = () ->
5
+ # # your code goes here
6
+
7
+ jQuery ->
8
+ # whatever you want will be triggered from here
9
+ # only if this filepath matches current
10
+ # controller and action parameters
11
+ Post.index()
@@ -0,0 +1,11 @@
1
+ # Define somewhere in your controller related js file (e.g. posts.js.coffee):
2
+ #
3
+ # window.Post ||= {}
4
+ # Post.new = () ->
5
+ # # your code goes here
6
+
7
+ jQuery ->
8
+ # whatever you want will be triggered from here
9
+ # only if this filepath matches current
10
+ # controller and action parameters
11
+ Post.new()
@@ -0,0 +1,5 @@
1
+ window.Post ||= {}
2
+ Post.index = () ->
3
+ $('.zealot-quote').text('My life for aiur!')
4
+ Post.new = () ->
5
+ $('.marine-quote').text('You wanna piece of me, boy?')
@@ -0,0 +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
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ class PostsController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def new
6
+ end
7
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= javascript_pluggable_tag %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+
12
+ <%= yield %>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,2 @@
1
+ <div class='zealot-quote'></div>
2
+ <div class='marine-quote'></div>
@@ -0,0 +1,2 @@
1
+ <div class='zealot-quote'></div>
2
+ <div class='marine-quote'></div>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require 'pluggable_js'
7
+ require 'jquery-rails'
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
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
@@ -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!
@@ -0,0 +1,29 @@
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 web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
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
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+ end