junctions 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +7 -0
  2. data/lib/junctions/brand_methods.rb +35 -0
  3. data/lib/junctions/engine.rb +127 -0
  4. data/lib/junctions/version.rb +3 -0
  5. data/lib/junctions.rb +1 -0
  6. data/test/dummy/README.rdoc +28 -0
  7. data/test/dummy/Rakefile +6 -0
  8. data/test/dummy/app/assets/javascripts/application.js +13 -0
  9. data/test/dummy/app/assets/javascripts/easy_checks.js +2 -0
  10. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  11. data/test/dummy/app/assets/stylesheets/easy_checks.css +4 -0
  12. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  13. data/test/dummy/app/controllers/application_controller.rb +5 -0
  14. data/test/dummy/app/controllers/easy_checks_controller.rb +58 -0
  15. data/test/dummy/app/helpers/application_helper.rb +2 -0
  16. data/test/dummy/app/helpers/easy_checks_helper.rb +2 -0
  17. data/test/dummy/app/models/easy_check.rb +2 -0
  18. data/test/dummy/app/views/easy_checks/_form.html.erb +17 -0
  19. data/test/dummy/app/views/easy_checks/edit.html.erb +6 -0
  20. data/test/dummy/app/views/easy_checks/index.html.erb +25 -0
  21. data/test/dummy/app/views/easy_checks/new.html.erb +5 -0
  22. data/test/dummy/app/views/easy_checks/show.html.erb +4 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/bin/bundle +3 -0
  25. data/test/dummy/bin/rails +4 -0
  26. data/test/dummy/bin/rake +4 -0
  27. data/test/dummy/bin/setup +29 -0
  28. data/test/dummy/config/application.rb +26 -0
  29. data/test/dummy/config/boot.rb +5 -0
  30. data/test/dummy/config/brands/databases/core/database.yml +50 -0
  31. data/test/dummy/config/brands/databases/dumdeedee/database.yml +50 -0
  32. data/test/dummy/config/brands/environments/core/development.rb +13 -0
  33. data/test/dummy/config/brands/environments/core/production.rb +77 -0
  34. data/test/dummy/config/brands/environments/core/test.rb +42 -0
  35. data/test/dummy/config/brands/environments/dumdeedee/development.rb +4 -0
  36. data/test/dummy/config/brands/environments/dumdeedee/production.rb +77 -0
  37. data/test/dummy/config/brands/environments/dumdeedee/test.rb +42 -0
  38. data/test/dummy/config/database.yml +50 -0
  39. data/test/dummy/config/environment.rb +5 -0
  40. data/test/dummy/config/environments/development.rb +41 -0
  41. data/test/dummy/config/environments/production.rb +77 -0
  42. data/test/dummy/config/environments/test.rb +42 -0
  43. data/test/dummy/config/initializers/assets.rb +11 -0
  44. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  45. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  46. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  47. data/test/dummy/config/initializers/inflections.rb +16 -0
  48. data/test/dummy/config/initializers/mime_types.rb +4 -0
  49. data/test/dummy/config/initializers/session_store.rb +3 -0
  50. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  51. data/test/dummy/config/locales/en.yml +23 -0
  52. data/test/dummy/config/routes.rb +7 -0
  53. data/test/dummy/config/secrets.yml +22 -0
  54. data/test/dummy/config.ru +4 -0
  55. data/test/dummy/db/migrate/20141118121139_create_easy_checks.rb +8 -0
  56. data/test/dummy/db/schema.rb +36 -0
  57. data/test/dummy/lib/brands/app/views/dumdeedee/easy_checks/index.html.erb +25 -0
  58. data/test/dummy/public/404.html +67 -0
  59. data/test/dummy/public/422.html +67 -0
  60. data/test/dummy/public/500.html +66 -0
  61. data/test/dummy/test/controllers/easy_checks_controller_test.rb +49 -0
  62. data/test/dummy/test/fixtures/easy_checks.yml +11 -0
  63. data/test/dummy/test/models/easy_check_test.rb +7 -0
  64. data/test/integration/navigation_test.rb +10 -0
  65. data/test/junctions_test.rb +7 -0
  66. data/test/lib/generators/junctions/model_generator_test.rb +36 -0
  67. data/test/test_helper.rb +17 -0
  68. metadata +200 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6c9ff0e5eba4046ba01c51716d02ef558f6d76d614569d3d07c0a7d2386187c1
4
+ data.tar.gz: a72f7cd80a90bd1f4df1813b3b4b25a0ed6f36cfe9b67b115db0bd1b0143eee7
5
+ SHA512:
6
+ metadata.gz: 4b196f9d119271254f7e6f414ea9967a738b4b4e68dad08527964fef5cfced61dc30a7120489d358d576055d0201f6f46cefda54ff4e6f8840bc6b727fa09c77
7
+ data.tar.gz: 75209ec68e5f176183ba356ab6e34bffae6f86e36005498736336485f2a3a5276e16b007799248b608e5195868ec3a3dbf6d95eaa7776fbe380a50fe33a95331
@@ -0,0 +1,35 @@
1
+ module Junctions
2
+ module BrandMethods
3
+ class << self
4
+ def brand_classes
5
+ Junctions::Engine::brand_list.reverse
6
+ end
7
+
8
+ def activate_for_brand(brand_class, base, base_name)
9
+ name=base_name.gsub("Core::", "#{brand_class}::")
10
+ begin
11
+ require_dependency(name.underscore)
12
+ base.instance_eval {
13
+ include name.constantize
14
+ # puts("Included #{name} in #{self.class.name}.") if Rails.env.development?
15
+ } if name.gsub(/::[^:]*$/, '').constantize.const_defined?(name.demodulize)
16
+ rescue MissingSourceFile => e
17
+ # puts("No brand extensions for #{name}.") if Rails.env.development?
18
+ rescue Exception => e
19
+ puts(e.message)
20
+ puts(e.backtrace)
21
+ end unless base_name==name
22
+ end
23
+
24
+ def activate(base, name)
25
+ brand_classes.each { |brand_class| activate_for_brand(brand_class.camelize, base, name) }
26
+ end
27
+
28
+ def include_environment
29
+ brand_classes.each do |brand_class|
30
+ require "config/brands/environments/#{brand_class}/#{Rails.env}"
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,127 @@
1
+ module Junctions
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Junctions
4
+
5
+ @brand_list=nil
6
+ class << self
7
+ attr_accessor :brand_list
8
+
9
+ def get_initializer_roots(*args)
10
+ args.map do |arg|
11
+ root=ENV[arg]
12
+ root && root.split(',') or nil
13
+ end.flatten.compact << 'core'
14
+ end
15
+
16
+ def brand_list
17
+ @brand_list||=get_initializer_roots('brand')
18
+ end
19
+ end
20
+
21
+
22
+ private
23
+ def all_features(&blk)
24
+ [:cells,:controllers,:decorators,:helpers,:mailers,:models,:notifications,:observers,:policies,:reports].each do |feature|
25
+ yield feature
26
+ end
27
+ end
28
+
29
+ def base_config(config)
30
+ config.paths.add 'lib/brands', eager_load: true, glob: '*'
31
+ config.paths.add 'lib/brands/lib', eager_load: true, glob: '*'
32
+ all_features do |feature|
33
+ config.paths.add "lib/brands/app/#{feature}", eager_load: true, glob: '*'
34
+ config.paths.add "app/#{feature}", eager_load: true, glob: '*'
35
+ end
36
+ end
37
+
38
+ def brand_config(config, brand)
39
+ config.paths.add "lib/brands/#{brand}", eager_load: true, glob: '*'
40
+ config.paths.add "lib/brands/lib/#{brand}", eager_load: true, glob: '*'
41
+ all_features do |feature|
42
+ config.paths.add "lib/brands/app/#{feature}/#{brand}"
43
+ config.paths.add "app/#{feature}/#{brand}"
44
+ end
45
+ end
46
+
47
+ def view_config(brand)
48
+ [
49
+ Pathname.new("app/views/#{brand}").expand_path,
50
+ Pathname.new("lib/brands/app/views/#{brand}").expand_path
51
+ ]
52
+ end
53
+
54
+ def for_all_brands_reversed(&blk)
55
+ brand_list.reverse.each do |brand|
56
+ yield brand
57
+ end
58
+ end
59
+
60
+ def for_all_brands(&blk)
61
+ brand_list.each do |brand|
62
+ yield brand
63
+ end
64
+ end
65
+
66
+ def already_in_root?(app)
67
+ root.to_s.match app.root.to_s
68
+ end
69
+
70
+ public
71
+ def brand_list
72
+ self.class.brand_list
73
+ end
74
+
75
+
76
+ initializer :load_environment_config, before: :load_environment_hook, group: :all do |app|
77
+ for_all_brands_reversed do |brand|
78
+ app.config.paths['config/environments'] << "config/brands/environments/#{brand}"
79
+ app.config.paths['config/initializers'] << "config/brands/initializers/#{brand}"
80
+ #TODO This isn't being loaded for the rake db:create, although the rake db:migrate is using it
81
+ #TODO Find out and fix the config/database, config/routes.rb not loading the latest instance
82
+ #TODO unless you overwrite it.
83
+ app.config.paths['config/database'] = "config/brands/databases/#{brand}/database.yml"
84
+ app.config.paths['config.routes.rb'] = "config/brands/routes/#{brand}/routes.rb"
85
+ end
86
+ # app.config.paths['config/database'],old_db='',app.config.paths['config/database']
87
+ # app.config.paths['config/routes.rb'],old_routes='',app.config.paths['config/routes']
88
+ # for_all_brands do |brand|
89
+ # app.config.paths['config/database'] = "config/brands/databases/#{brand}/database.yml"
90
+ # app.config.paths['config.routes.rb'] = "config/brands/routes/#{brand}/routes.rb"
91
+ # end
92
+ # app.config.paths['config/database'] << old_db
93
+ # app.config.paths['config/routes.rb'] << old_routes
94
+ end
95
+
96
+ initializer :append_migrations do |app|
97
+ unless already_in_root?(app)
98
+ config.paths['db/migrate'].expanded.each do |expanded_path|
99
+ app.config.paths['db/migrate'] << expanded_path
100
+ end
101
+ end
102
+ end
103
+
104
+ initializer :add_eager_load_lib do |app|
105
+ for_all_brands_reversed do |brand|
106
+ brand_config(app.config,brand)
107
+ end
108
+ base_config(app.config)
109
+ app.config.paths.add 'lib/brands/app', eager_load: true, glob: '*'
110
+ end
111
+
112
+ initializer :add_brand_view_paths do |app|
113
+ unless already_in_root?(app)
114
+ for_all_brands_reversed do |brand|
115
+ view_config(brand).each do |brand_view|
116
+ ActiveSupport.on_load(:action_controller){
117
+ prepend_view_path(brand_view) if respond_to?(:prepend_view_path)
118
+ }
119
+ ActiveSupport.on_load(:action_mailer){
120
+ prepend_view_path(brand_view)
121
+ }
122
+ end
123
+ end
124
+ end
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,3 @@
1
+ module Junctions
2
+ VERSION = "0.0.1"
3
+ end
data/lib/junctions.rb ADDED
@@ -0,0 +1 @@
1
+ require "junctions/version"
@@ -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
+ Rails.application.load_tasks
@@ -0,0 +1,13 @@
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_tree .
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,15 @@
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 bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -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
@@ -0,0 +1,58 @@
1
+ class EasyChecksController < ApplicationController
2
+ before_action :set_easy_check, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /easy_checks
5
+ def index
6
+ @easy_checks = EasyCheck.all
7
+ end
8
+
9
+ # GET /easy_checks/1
10
+ def show
11
+ end
12
+
13
+ # GET /easy_checks/new
14
+ def new
15
+ @easy_check = EasyCheck.new
16
+ end
17
+
18
+ # GET /easy_checks/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /easy_checks
23
+ def create
24
+ @easy_check = EasyCheck.new(easy_check_params)
25
+
26
+ if @easy_check.save
27
+ redirect_to @easy_check, notice: 'Easy check was successfully created.'
28
+ else
29
+ render :new
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /easy_checks/1
34
+ def update
35
+ if @easy_check.update(easy_check_params)
36
+ redirect_to @easy_check, notice: 'Easy check was successfully updated.'
37
+ else
38
+ render :edit
39
+ end
40
+ end
41
+
42
+ # DELETE /easy_checks/1
43
+ def destroy
44
+ @easy_check.destroy
45
+ redirect_to easy_checks_url, notice: 'Easy check was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_easy_check
51
+ @easy_check = EasyCheck.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def easy_check_params
56
+ params[:easy_check]
57
+ end
58
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module EasyChecksHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class EasyCheck < ActiveRecord::Base
2
+ end
@@ -0,0 +1,17 @@
1
+ <%= form_for(@easy_check) do |f| %>
2
+ <% if @easy_check.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@easy_check.errors.count, "error") %> prohibited this easy_check from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @easy_check.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="actions">
15
+ <%= f.submit %>
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Easy Check</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @easy_check %> |
6
+ <%= link_to 'Back', easy_checks_path %>
@@ -0,0 +1,25 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Easy Checks</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th colspan="3"></th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <tbody>
13
+ <% @easy_checks.each do |easy_check| %>
14
+ <tr>
15
+ <td><%= link_to 'Show', easy_check %></td>
16
+ <td><%= link_to 'Edit', edit_easy_check_path(easy_check) %></td>
17
+ <td><%= link_to 'Destroy', easy_check, method: :delete, data: { confirm: 'Are you sure?' } %></td>
18
+ </tr>
19
+ <% end %>
20
+ </tbody>
21
+ </table>
22
+
23
+ <br>
24
+
25
+ <%= link_to 'New Easy check', new_easy_check_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Easy Check</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', easy_checks_path %>
@@ -0,0 +1,4 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <%= link_to 'Edit', edit_easy_check_path(@easy_check) %> |
4
+ <%= link_to 'Back', easy_checks_path %>
@@ -0,0 +1,14 @@
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
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -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,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "junctions"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+
22
+ # Do not swallow errors in after_commit/after_rollback callbacks.
23
+ config.active_record.raise_in_transactional_callbacks = true
24
+ end
25
+ end
26
+
@@ -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.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,50 @@
1
+ # MySQL. Versions 5.0+ are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+ #
12
+ default: &default
13
+ adapter: sqlite3
14
+ database: db/dummy.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ development:
19
+ <<: *default
20
+ database: dummy_development
21
+
22
+ # Warning: The database defined as "test" will be erased and
23
+ # re-generated from your development database when you run "rake".
24
+ # Do not set this db to the same as development or production.
25
+ test:
26
+ <<: *default
27
+ database: dummy_test
28
+
29
+ # As with config/secrets.yml, you never want to store sensitive information,
30
+ # like your database password, in your source code. If your source code is
31
+ # ever seen by anyone, they now have access to your database.
32
+ #
33
+ # Instead, provide the password as a unix environment variable when you boot
34
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
35
+ # for a full rundown on how to provide these environment variables in a
36
+ # production deployment.
37
+ #
38
+ # On Heroku and other platform providers, you may have a full connection URL
39
+ # available as an environment variable. For example:
40
+ #
41
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
42
+ #
43
+ # You can use this database configuration with:
44
+ #
45
+ # production:
46
+ # url: <%= ENV['DATABASE_URL'] %>
47
+ #
48
+ production:
49
+ <<: *default
50
+ database: dummy_production
@@ -0,0 +1,50 @@
1
+ # MySQL. Versions 5.0+ are recommended.
2
+ #
3
+ # Install the MYSQL driver
4
+ # gem install mysql2
5
+ #
6
+ # Ensure the MySQL gem is defined in your Gemfile
7
+ # gem 'mysql2'
8
+ #
9
+ # And be sure to use new-style password hashing:
10
+ # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
+ #
12
+ default: &default
13
+ adapter: sqlite3
14
+ database: db/dumdeedee.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ development:
19
+ <<: *default
20
+ database: dumdeedee_development
21
+
22
+ # Warning: The database defined as "test" will be erased and
23
+ # re-generated from your development database when you run "rake".
24
+ # Do not set this db to the same as development or production.
25
+ test:
26
+ <<: *default
27
+ database: dumdeedee_test
28
+
29
+ # As with config/secrets.yml, you never want to store sensitive information,
30
+ # like your database password, in your source code. If your source code is
31
+ # ever seen by anyone, they now have access to your database.
32
+ #
33
+ # Instead, provide the password as a unix environment variable when you boot
34
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
35
+ # for a full rundown on how to provide these environment variables in a
36
+ # production deployment.
37
+ #
38
+ # On Heroku and other platform providers, you may have a full connection URL
39
+ # available as an environment variable. For example:
40
+ #
41
+ # DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase"
42
+ #
43
+ # You can use this database configuration with:
44
+ #
45
+ # production:
46
+ # url: <%= ENV['DATABASE_URL'] %>
47
+ #
48
+ production:
49
+ <<: *default
50
+ database: dumdeedee_production
@@ -0,0 +1,13 @@
1
+ Rails.application.configure do
2
+ #expand and override config/environments/development.rb
3
+ config.cache_classes = false
4
+ config.eager_load = false
5
+ config.consider_all_requests_local = true
6
+ config.action_controller.perform_caching = false
7
+ config.action_mailer.raise_delivery_errors = false
8
+ config.active_support.deprecation = :log
9
+ config.active_record.migration_error = :page_load
10
+ config.assets.debug = true
11
+ config.assets.digest = true
12
+ config.assets.raise_runtime_errors = true
13
+ end