disable_connection_pooling 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -0
  3. data/README.md +7 -2
  4. data/disable_connection_pooling.gemspec +2 -1
  5. data/lib/disable_connection_pooling/active_record_base.rb +2 -0
  6. data/lib/disable_connection_pooling/version.rb +1 -1
  7. data/spec/disable_connection_pooling_spec.rb +37 -0
  8. data/spec/rails/3.2/Gemfile +5 -0
  9. data/spec/rails/3.2/README.rdoc +261 -0
  10. data/spec/rails/3.2/Rakefile +7 -0
  11. data/spec/rails/3.2/app/assets/images/rails.png +0 -0
  12. data/spec/rails/3.2/app/assets/javascripts/application.js +13 -0
  13. data/spec/rails/3.2/app/assets/javascripts/items.js +2 -0
  14. data/spec/rails/3.2/app/assets/stylesheets/application.css +13 -0
  15. data/spec/rails/3.2/app/assets/stylesheets/items.css +4 -0
  16. data/spec/rails/3.2/app/assets/stylesheets/scaffold.css +56 -0
  17. data/spec/rails/3.2/app/controllers/application_controller.rb +3 -0
  18. data/spec/rails/3.2/app/controllers/items_controller.rb +83 -0
  19. data/spec/rails/3.2/app/helpers/application_helper.rb +2 -0
  20. data/spec/rails/3.2/app/helpers/items_helper.rb +2 -0
  21. data/spec/rails/3.2/app/mailers/.gitkeep +0 -0
  22. data/spec/rails/3.2/app/models/.gitkeep +0 -0
  23. data/spec/rails/3.2/app/models/item.rb +3 -0
  24. data/spec/rails/3.2/app/views/items/_form.html.erb +25 -0
  25. data/spec/rails/3.2/app/views/items/edit.html.erb +6 -0
  26. data/spec/rails/3.2/app/views/items/index.html.erb +25 -0
  27. data/spec/rails/3.2/app/views/items/new.html.erb +5 -0
  28. data/spec/rails/3.2/app/views/items/show.html.erb +15 -0
  29. data/spec/rails/3.2/app/views/layouts/application.html.erb +14 -0
  30. data/spec/rails/3.2/config.ru +4 -0
  31. data/spec/rails/3.2/config/application.rb +64 -0
  32. data/spec/rails/3.2/config/boot.rb +6 -0
  33. data/spec/rails/3.2/config/database.yml +9 -0
  34. data/spec/rails/3.2/config/environment.rb +5 -0
  35. data/spec/rails/3.2/config/environments/development.rb +32 -0
  36. data/spec/rails/3.2/config/environments/production.rb +54 -0
  37. data/spec/rails/3.2/config/environments/test.rb +37 -0
  38. data/spec/rails/3.2/config/initializers/backtrace_silencers.rb +7 -0
  39. data/spec/rails/3.2/config/initializers/inflections.rb +15 -0
  40. data/spec/rails/3.2/config/initializers/mime_types.rb +5 -0
  41. data/spec/rails/3.2/config/initializers/secret_token.rb +7 -0
  42. data/spec/rails/3.2/config/initializers/session_store.rb +8 -0
  43. data/spec/rails/3.2/config/initializers/wrap_parameters.rb +14 -0
  44. data/spec/rails/3.2/config/locales/en.yml +5 -0
  45. data/spec/rails/3.2/config/routes.rb +61 -0
  46. data/spec/rails/3.2/db/migrate/20140214122413_create_items.rb +10 -0
  47. data/spec/rails/3.2/db/schema.rb +23 -0
  48. data/spec/rails/3.2/db/seeds.rb +7 -0
  49. data/spec/rails/3.2/lib/assets/.gitkeep +0 -0
  50. data/spec/rails/3.2/lib/tasks/.gitkeep +0 -0
  51. data/spec/rails/3.2/log/.gitkeep +0 -0
  52. data/spec/rails/3.2/public/404.html +26 -0
  53. data/spec/rails/3.2/public/422.html +26 -0
  54. data/spec/rails/3.2/public/500.html +25 -0
  55. data/spec/rails/3.2/public/favicon.ico +0 -0
  56. data/spec/rails/3.2/public/index.html +241 -0
  57. data/spec/rails/3.2/public/robots.txt +5 -0
  58. data/spec/rails/3.2/script/rails +6 -0
  59. data/spec/rails/3.2/vendor/assets/javascripts/.gitkeep +0 -0
  60. data/spec/rails/3.2/vendor/assets/stylesheets/.gitkeep +0 -0
  61. data/spec/rails/3.2/vendor/plugins/.gitkeep +0 -0
  62. data/spec/rails/4.0/Gemfile +6 -0
  63. data/spec/rails/4.0/README.rdoc +28 -0
  64. data/spec/rails/4.0/Rakefile +6 -0
  65. data/spec/rails/4.0/app/assets/images/.keep +0 -0
  66. data/spec/rails/4.0/app/assets/javascripts/application.js +13 -0
  67. data/spec/rails/4.0/app/assets/javascripts/items.js +2 -0
  68. data/spec/rails/4.0/app/assets/stylesheets/application.css +13 -0
  69. data/spec/rails/4.0/app/assets/stylesheets/items.css +4 -0
  70. data/spec/rails/4.0/app/assets/stylesheets/scaffold.css +56 -0
  71. data/spec/rails/4.0/app/controllers/application_controller.rb +5 -0
  72. data/spec/rails/4.0/app/controllers/concerns/.keep +0 -0
  73. data/spec/rails/4.0/app/controllers/items_controller.rb +74 -0
  74. data/spec/rails/4.0/app/helpers/application_helper.rb +2 -0
  75. data/spec/rails/4.0/app/helpers/items_helper.rb +2 -0
  76. data/spec/rails/4.0/app/mailers/.keep +0 -0
  77. data/spec/rails/4.0/app/models/.keep +0 -0
  78. data/spec/rails/4.0/app/models/concerns/.keep +0 -0
  79. data/spec/rails/4.0/app/models/item.rb +2 -0
  80. data/spec/rails/4.0/app/views/items/_form.html.erb +25 -0
  81. data/spec/rails/4.0/app/views/items/edit.html.erb +6 -0
  82. data/spec/rails/4.0/app/views/items/index.html.erb +29 -0
  83. data/spec/rails/4.0/app/views/items/index.json.jbuilder +4 -0
  84. data/spec/rails/4.0/app/views/items/new.html.erb +5 -0
  85. data/spec/rails/4.0/app/views/items/show.html.erb +14 -0
  86. data/spec/rails/4.0/app/views/items/show.json.jbuilder +1 -0
  87. data/spec/rails/4.0/app/views/layouts/application.html.erb +14 -0
  88. data/spec/rails/4.0/bin/bundle +3 -0
  89. data/spec/rails/4.0/bin/rails +4 -0
  90. data/spec/rails/4.0/bin/rake +4 -0
  91. data/spec/rails/4.0/config.ru +4 -0
  92. data/spec/rails/4.0/config/application.rb +33 -0
  93. data/spec/rails/4.0/config/boot.rb +4 -0
  94. data/spec/rails/4.0/config/database.yml +9 -0
  95. data/spec/rails/4.0/config/environment.rb +5 -0
  96. data/spec/rails/4.0/config/environments/development.rb +25 -0
  97. data/spec/rails/4.0/config/environments/production.rb +65 -0
  98. data/spec/rails/4.0/config/environments/test.rb +36 -0
  99. data/spec/rails/4.0/config/initializers/backtrace_silencers.rb +7 -0
  100. data/spec/rails/4.0/config/initializers/filter_parameter_logging.rb +4 -0
  101. data/spec/rails/4.0/config/initializers/inflections.rb +16 -0
  102. data/spec/rails/4.0/config/initializers/mime_types.rb +5 -0
  103. data/spec/rails/4.0/config/initializers/secret_token.rb +12 -0
  104. data/spec/rails/4.0/config/initializers/session_store.rb +3 -0
  105. data/spec/rails/4.0/config/initializers/wrap_parameters.rb +14 -0
  106. data/spec/rails/4.0/config/locales/en.yml +23 -0
  107. data/spec/rails/4.0/config/routes.rb +58 -0
  108. data/spec/rails/4.0/db/migrate/20140214124018_create_items.rb +10 -0
  109. data/spec/rails/4.0/db/schema.rb +23 -0
  110. data/spec/rails/4.0/db/seeds.rb +7 -0
  111. data/spec/rails/4.0/lib/assets/.keep +0 -0
  112. data/spec/rails/4.0/lib/tasks/.keep +0 -0
  113. data/spec/rails/4.0/log/.keep +0 -0
  114. data/spec/rails/4.0/public/404.html +58 -0
  115. data/spec/rails/4.0/public/422.html +58 -0
  116. data/spec/rails/4.0/public/500.html +57 -0
  117. data/spec/rails/4.0/public/favicon.ico +0 -0
  118. data/spec/rails/4.0/public/robots.txt +5 -0
  119. data/spec/rails/4.0/vendor/assets/javascripts/.keep +0 -0
  120. data/spec/rails/4.0/vendor/assets/stylesheets/.keep +0 -0
  121. data/spec/spec_helper.rb +44 -0
  122. metadata +246 -5
  123. data/spec/dummy_spec.rb +0 -5
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
File without changes
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '4.0.2'
4
+ gem 'mysql2'
5
+ gem 'jbuilder', '~> 1.2'
6
+ gem 'disable_connection_pooling'
@@ -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,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,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,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,74 @@
1
+ class ItemsController < ApplicationController
2
+ before_action :set_item, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /items
5
+ # GET /items.json
6
+ def index
7
+ @items = Item.all
8
+ end
9
+
10
+ # GET /items/1
11
+ # GET /items/1.json
12
+ def show
13
+ end
14
+
15
+ # GET /items/new
16
+ def new
17
+ @item = Item.new
18
+ end
19
+
20
+ # GET /items/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /items
25
+ # POST /items.json
26
+ def create
27
+ @item = Item.new(item_params)
28
+
29
+ respond_to do |format|
30
+ if @item.save
31
+ format.html { redirect_to @item, notice: 'Item was successfully created.' }
32
+ format.json { render action: 'show', status: :created, location: @item }
33
+ else
34
+ format.html { render action: 'new' }
35
+ format.json { render json: @item.errors, status: :unprocessable_entity }
36
+ end
37
+ end
38
+ end
39
+
40
+ # PATCH/PUT /items/1
41
+ # PATCH/PUT /items/1.json
42
+ def update
43
+ respond_to do |format|
44
+ if @item.update(item_params)
45
+ format.html { redirect_to @item, notice: 'Item was successfully updated.' }
46
+ format.json { head :no_content }
47
+ else
48
+ format.html { render action: 'edit' }
49
+ format.json { render json: @item.errors, status: :unprocessable_entity }
50
+ end
51
+ end
52
+ end
53
+
54
+ # DELETE /items/1
55
+ # DELETE /items/1.json
56
+ def destroy
57
+ @item.destroy
58
+ respond_to do |format|
59
+ format.html { redirect_to items_url }
60
+ format.json { head :no_content }
61
+ end
62
+ end
63
+
64
+ private
65
+ # Use callbacks to share common setup or constraints between actions.
66
+ def set_item
67
+ @item = Item.find(params[:id])
68
+ end
69
+
70
+ # Never trust parameters from the scary internet, only allow the white list through.
71
+ def item_params
72
+ params.require(:item).permit(:name, :description)
73
+ end
74
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module ItemsHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ class Item < ActiveRecord::Base
2
+ end
@@ -0,0 +1,25 @@
1
+ <%= form_for(@item) do |f| %>
2
+ <% if @item.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@item.errors.count, "error") %> prohibited this item from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @item.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :name %><br>
16
+ <%= f.text_field :name %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :description %><br>
20
+ <%= f.text_area :description %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing item</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @item %> |
6
+ <%= link_to 'Back', items_path %>
@@ -0,0 +1,29 @@
1
+ <h1>Listing items</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Name</th>
7
+ <th>Description</th>
8
+ <th></th>
9
+ <th></th>
10
+ <th></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @items.each do |item| %>
16
+ <tr>
17
+ <td><%= item.name %></td>
18
+ <td><%= item.description %></td>
19
+ <td><%= link_to 'Show', item %></td>
20
+ <td><%= link_to 'Edit', edit_item_path(item) %></td>
21
+ <td><%= link_to 'Destroy', item, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New Item', new_item_path %>
@@ -0,0 +1,4 @@
1
+ json.array!(@items) do |item|
2
+ json.extract! item, :id, :name, :description
3
+ json.url item_url(item, format: :json)
4
+ end
@@ -0,0 +1,5 @@
1
+ <h1>New item</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', items_path %>
@@ -0,0 +1,14 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Name:</strong>
5
+ <%= @item.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Description:</strong>
10
+ <%= @item.description %>
11
+ </p>
12
+
13
+ <%= link_to 'Edit', edit_item_path(@item) %> |
14
+ <%= link_to 'Back', items_path %>
@@ -0,0 +1 @@
1
+ json.extract! @item, :id, :name, :description, :created_at, :updated_at
@@ -0,0 +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" %>
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,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 Rails.application
@@ -0,0 +1,33 @@
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 "sprockets/railtie"
8
+ # require "rails/test_unit/railtie"
9
+
10
+ # Require the gems listed in Gemfile, including any gems
11
+ # you've limited to :test, :development, or :production.
12
+ Bundler.require(:default, Rails.env)
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
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+
28
+ # Disable the asset pipeline.
29
+ config.assets.enabled = false
30
+
31
+ config.active_record.disable_connection_pooling = false
32
+ end
33
+ end
@@ -0,0 +1,4 @@
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'])
@@ -0,0 +1,9 @@
1
+ production:
2
+ adapter: mysql2
3
+ encoding: utf8
4
+ reconnect: true
5
+ database: rails40_dummy
6
+ pool: 5
7
+ username: root
8
+ password:
9
+ port: 3306