bootstrap-grid-system 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +89 -0
  4. data/Rakefile +32 -0
  5. data/lib/bootstrap_grid_system/version.rb +3 -0
  6. data/lib/bootstrap_grid_system.rb +127 -0
  7. data/lib/tasks/bootstrap_grid_system_tasks.rake +4 -0
  8. data/test/bootstrap_grid_system_test.rb +7 -0
  9. data/test/dummy/README.rdoc +28 -0
  10. data/test/dummy/Rakefile +6 -0
  11. data/test/dummy/app/assets/javascripts/application.js +13 -0
  12. data/test/dummy/app/assets/javascripts/test.js +2 -0
  13. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  14. data/test/dummy/app/assets/stylesheets/test.css +4 -0
  15. data/test/dummy/app/controllers/application_controller.rb +5 -0
  16. data/test/dummy/app/controllers/test_controller.rb +4 -0
  17. data/test/dummy/app/helpers/application_helper.rb +2 -0
  18. data/test/dummy/app/helpers/test_helper.rb +2 -0
  19. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  20. data/test/dummy/app/views/test/index.html.erb +15 -0
  21. data/test/dummy/bin/bundle +3 -0
  22. data/test/dummy/bin/rails +4 -0
  23. data/test/dummy/bin/rake +4 -0
  24. data/test/dummy/config/application.rb +23 -0
  25. data/test/dummy/config/boot.rb +5 -0
  26. data/test/dummy/config/database.yml +25 -0
  27. data/test/dummy/config/environment.rb +5 -0
  28. data/test/dummy/config/environments/development.rb +37 -0
  29. data/test/dummy/config/environments/production.rb +78 -0
  30. data/test/dummy/config/environments/test.rb +39 -0
  31. data/test/dummy/config/initializers/assets.rb +8 -0
  32. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  34. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  35. data/test/dummy/config/initializers/inflections.rb +16 -0
  36. data/test/dummy/config/initializers/mime_types.rb +4 -0
  37. data/test/dummy/config/initializers/session_store.rb +3 -0
  38. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  39. data/test/dummy/config/locales/en.yml +23 -0
  40. data/test/dummy/config/routes.rb +58 -0
  41. data/test/dummy/config/secrets.yml +22 -0
  42. data/test/dummy/config.ru +4 -0
  43. data/test/dummy/db/development.sqlite3 +0 -0
  44. data/test/dummy/log/development.log +418 -0
  45. data/test/dummy/public/404.html +67 -0
  46. data/test/dummy/public/422.html +67 -0
  47. data/test/dummy/public/500.html +66 -0
  48. data/test/dummy/public/favicon.ico +0 -0
  49. data/test/dummy/test/controllers/test_controller_test.rb +9 -0
  50. data/test/dummy/test/helpers/test_helper_test.rb +4 -0
  51. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  52. data/test/dummy/tmp/cache/assets/development/sprockets/1d49437364bff753ad2f70fdb5ef7612 +0 -0
  53. data/test/dummy/tmp/cache/assets/development/sprockets/293460f7bea2aea456231b769212f36f +0 -0
  54. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  55. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  56. data/test/dummy/tmp/cache/assets/development/sprockets/5daa64d9601a1dd14726112003d08364 +0 -0
  57. data/test/dummy/tmp/cache/assets/development/sprockets/9f0902c766a7e3fededcdcb9650526da +0 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/b45890d98668c132fee5cae4b15320d9 +0 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  61. data/test/dummy/tmp/cache/assets/development/sprockets/daa0e3c217673cb0ebb89d97438a1b80 +0 -0
  62. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  63. data/test/test_helper.rb +16 -0
  64. metadata +190 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5dd9e2c85629e80c6656896144847d626f861f64
4
+ data.tar.gz: ba2186ca554a90a608812b27223c78d5aeaf180d
5
+ SHA512:
6
+ metadata.gz: 84c23f4c6ac67b936a20fdf341dfc8a8a70ad9470bdd88e4d0f3d946cd8ce89de78d4391f674bcb64cd2b12bb42aea9aef3d49a1969c68481cc9539c154050bf
7
+ data.tar.gz: 35fcf72bdc814bfabfe733af05f83db5d97b30bb4df30dc42dab269112607952047989e714712ed36528f336a6f887ffcfd544d50049836caf2559ab647ae675
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2014 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,89 @@
1
+ #Bootstrap Grid System
2
+ The Bootstrap Grid System gem is a small and very simple tag generator for Bootstrap gem.
3
+ ##Dependencies
4
+ Ruby 1.9+
5
+ Rails 4.0+
6
+ Twitter Bootstrap 3.0+
7
+ ##Installation
8
+ Add the gem to your Gemfile
9
+ `gem 'bootstrap-grid-system'`
10
+ Bundle install
11
+ `bundle install`
12
+ ##Examples
13
+ ###Bootstrap row
14
+ Use `bootstrap_row` to wrap the content in a div block with "row" class
15
+ ```
16
+ <%= bootstrap_row { "Example" } %>
17
+ ```
18
+ This generates the following HTML:
19
+ ```
20
+ <div class="row">Example</div>
21
+ ```
22
+ ###Bootstrap col
23
+ Use `bootstrap_col` to wrap the content in a div block with "col-md-12" class
24
+ ```
25
+ <%= bootstrap_col { "Example" } %>
26
+ ```
27
+ This generates the following HTML:
28
+ ```
29
+ <div class="col-md-12">Example</div>
30
+ ```
31
+ To change the default number of columns, use the `:col` or `:offset_col` options
32
+ ```
33
+ <%= bootstrap_col(col: 2, offset_col: 4) { "Example" } %>
34
+ ```
35
+ This generates the following HTML:
36
+ ```
37
+ <div class="col-md-2 col-md-offset-4">Example</div>
38
+ ```
39
+ To change the default grid class, use the `:grid_system` option
40
+ ```
41
+ <%= bootstrap_col(grid_system: :lg) { "Example" } %>
42
+ ```
43
+ This generates the following HTML:
44
+ ```
45
+ <div class="col-lg-12">Example</div>
46
+ ```
47
+ ###Bootstrap row with col
48
+ Use `bootstrap_row_with_col` to wrap the content in a div block with "row" class and div with class "col-md-12" inside
49
+ ```
50
+ <%= bootstrap_row_with_col { "Example" } %>
51
+ ```
52
+ ```
53
+ <div class="row">
54
+ <div class="col-md-12">Example</div>
55
+ </div>
56
+ ```
57
+ To change the default number of columns, use the `:col` or `:offset_col` options
58
+ ```
59
+ <%= bootstrap_row_with_col(col: 2, offset_col: 4) { "Example" } %>
60
+ ```
61
+ This generates the following HTML:
62
+ ```
63
+ <div class="row">
64
+ <div class="col-md-2 col-md-offset-4">Example</div>
65
+ </div>
66
+ ```
67
+ To change the default grid class, use the `:grid_system` option
68
+ ```
69
+ <%= bootstrap_row_with_col(grid_system: :lg) { "Example" } %>
70
+ ```
71
+ This generates the following HTML:
72
+ ```
73
+ <div class="row">
74
+ <div class="col-lg-12">Example</div>
75
+ </div>
76
+ ```
77
+ ###Standard html options
78
+ Use `:id` or `:class` options to add your value
79
+ ```
80
+ <%= bootstrap_row_with_col(id: "foo", class: "bar") { "Example" } %>
81
+ ```
82
+ This generates the following HTML:
83
+ ```
84
+ <div class="row bar" id="foo">
85
+ <div class="col-md-12">Example</div>
86
+ </div>
87
+ ```
88
+ ##License
89
+ This project rocks and uses MIT-LICENSE.
data/Rakefile ADDED
@@ -0,0 +1,32 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'BootstrapGridSystem'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+ Bundler::GemHelper.install_tasks
21
+
22
+ require 'rake/testtask'
23
+
24
+ Rake::TestTask.new(:test) do |t|
25
+ t.libs << 'lib'
26
+ t.libs << 'test'
27
+ t.pattern = 'test/**/*_test.rb'
28
+ t.verbose = false
29
+ end
30
+
31
+
32
+ task default: :test
@@ -0,0 +1,3 @@
1
+ module BootstrapGridSystem
2
+ VERSION = "0.1.2"
3
+ end
@@ -0,0 +1,127 @@
1
+ # Provides a number of methods for creating a simple Bootstrap blocks
2
+ module BootstrapGridSystem
3
+ # Creates a HTML div block with bootstrap row class.
4
+ #
5
+ # === Options
6
+ # You can use only symbols for the attribute names.
7
+ #
8
+ # <tt>:row_disabled</tt> if set to true, the content will build without bootstrap row div block, it will return
9
+ # empty content.
10
+ #
11
+ # === Examples
12
+ # bootstrap_row { "Test" }
13
+ # # => <div class="row">Test</div>
14
+ #
15
+ # bootstrap_row(class: "foo") { "Test" }
16
+ # # => <div class="row foo">Test</div>
17
+ #
18
+ # bootstrap_row(row_disabled: true) { "Test" }
19
+ # # => Test
20
+ #
21
+ def bootstrap_row(options = {})
22
+ if options.delete :row_disabled
23
+ yield
24
+ else
25
+ options[:class] = ["row", options[:class]].compact.join(" ")
26
+ content_tag(:div, options) { yield }
27
+ end
28
+ end
29
+
30
+ # Creates a HTML div block with bootstrap grid column class.
31
+ #
32
+ # === Options
33
+ # You can use only symbols for the attribute names.
34
+ #
35
+ # <tt>:grid_system</tt> if the set value from bootstrap grid system you can chenge default value "sm" to "xs",
36
+ # "sm", "md" or "lg". You can use string and symbols for the values
37
+ #
38
+ # <tt>:offset_col</tt> if the set value in the range from 1 to 12 it generate bootstrap offset class in HTML div
39
+ # block with bootstrap grid column.
40
+ #
41
+ # === Examples
42
+ # bootstrap_col(col: 6) { "Test" }
43
+ # # => <div class="col-sm-6">Test</div>
44
+ #
45
+ # bootstrap_col(col: 6, offset_col: 4) { "Test" }
46
+ # # => <div class="col-sm-6 col-sm-offset-4">Test</div>
47
+ #
48
+ # bootstrap_col(col: 6, class: "foo") { "Test" }
49
+ # # => <div class="col-sm-6 foo">Test</div>
50
+ #
51
+ # bootstrap_col(col: 6, grid_system: :lg) { "Test" }
52
+ # # => <div class="col-lg-6">Test</div>
53
+ #
54
+ def bootstrap_col(options = {})
55
+ grid_system = options.delete :grid_system
56
+ col = grid_system_class options.delete(:col) || 12, grid_system
57
+ offset_col = grid_system_offset_class options.delete(:offset_col), grid_system
58
+ if col || offset_col
59
+ options[:class] = [col, offset_col, options[:class]].compact.join(" ")
60
+ content_tag(:div, options) { yield }
61
+ else
62
+ yield
63
+ end
64
+ end
65
+
66
+ # Creates a HTML div block with bootstrap row class and HTML div block with bootstrap grid column class inside.
67
+ #
68
+ # === Options
69
+ # You can use only symbols for the attribute names.
70
+ #
71
+ # <tt>:row_disabled</tt> if set to true, it will create only HTML div block with bootstrap grid column class
72
+ # and without HTML div block with bootstrap row class.
73
+ #
74
+ # === Examples
75
+ # bootstrap_row_with_col(col: 6) { "Test" }
76
+ # # => <div class="row">
77
+ # <div class="col-sm-6">
78
+ # Test
79
+ # </div>
80
+ # </div>
81
+ #
82
+ # bootstrap_row_with_col(col: 6, offset_col: 4) { "Test" }
83
+ # # => <div class="row">
84
+ # <div class="col-sm-6 col-sm-offset-4">
85
+ # Test
86
+ # </div>
87
+ # </div>
88
+ #
89
+ # bootstrap_row_with_col(col: 6, class: "foo") { "Test" }
90
+ # # => <div class="row foo">
91
+ # <div class="col-sm-6">
92
+ # Test
93
+ # </div>
94
+ # </div>
95
+ #
96
+ # bootstrap_row_with_col(col: 6, grid_system: :lg) { "Test" }
97
+ # # => <div class="row">
98
+ # <div class="col-lg-6">
99
+ # Test
100
+ # </div>
101
+ # </div>
102
+ #
103
+ def bootstrap_row_with_col(options = {})
104
+ col_tag = bootstrap_col(options.slice(:col, :offset_col, :grid_system)) { yield }
105
+ bootstrap_row(options.except(:col, :offset_col, :grid_system)) { col_tag }
106
+ end
107
+
108
+ # Creates a HTML class with Bootstrap col.
109
+ #
110
+ def grid_system_class(col = nil, grid_system = nil)
111
+ "col-#{(grid_system || default_grid_system).to_s}-#{col}" if col
112
+ end
113
+
114
+ # Creates a HTML class with Bootstrap offset-col.
115
+ #
116
+ def grid_system_offset_class(col = nil, grid_system = nil)
117
+ "col-#{(grid_system || default_grid_system).to_s}-offset-#{col}" if col
118
+ end
119
+
120
+ private
121
+
122
+ def default_grid_system
123
+ "md"
124
+ end
125
+ end
126
+
127
+ ActionView::Base.send :include, BootstrapGridSystem
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bootstrap_grid_system do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class BootstrapGridSystemTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, BootstrapGridSystem
6
+ end
7
+ 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
+ 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,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,4 @@
1
+ class TestController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module TestHelper
2
+ end
@@ -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,15 @@
1
+ <h1>Test#index</h1>
2
+ <p>Find me in app/views/test/index.html.erb</p>
3
+ <p>Bootstrap row</p>
4
+ <%= bootstrap_row { "Example" } %>
5
+ <%= bootstrap_row(id: "foo", class: "bar") { "Example" } %>
6
+ <p>Bootstrap col</p>
7
+ <%= bootstrap_col { "Example" } %>
8
+ <%= bootstrap_col(col: 2, offset_col: 4) { "Example" } %>
9
+ <%= bootstrap_col(grid_system: :lg) { "Example" } %>
10
+ <%= bootstrap_col(id: "foo", class: "bar") { "Example" } %>
11
+ <p>Bootstrap row with col</p>
12
+ <%= bootstrap_row_with_col { "Example" } %>
13
+ <%= bootstrap_row_with_col(col: 2, offset_col: 4) { "Example" } %>
14
+ <%= bootstrap_row_with_col(grid_system: :lg) { "Example" } %>
15
+ <%= bootstrap_row_with_col(id: "foo", class: "bar") { "Example" } %>
@@ -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 "bootstrap_grid_system"
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
+ end
22
+ end
23
+
@@ -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,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
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,37 @@
1
+ Rails.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
+
30
+ # Adds additional error checking when serving assets at runtime.
31
+ # Checks for improperly declared sprockets dependencies.
32
+ # Raises helpful error messages.
33
+ config.assets.raise_runtime_errors = true
34
+
35
+ # Raises error for missing translations
36
+ # config.action_view.raise_on_missing_translations = true
37
+ end
@@ -0,0 +1,78 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
36
+
37
+ # Specifies the header that your server uses for sending files.
38
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
39
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
40
+
41
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
42
+ # config.force_ssl = true
43
+
44
+ # Set to :debug to see everything in the log.
45
+ config.log_level = :info
46
+
47
+ # Prepend all log lines with the following tags.
48
+ # config.log_tags = [ :subdomain, :uuid ]
49
+
50
+ # Use a different logger for distributed setups.
51
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
52
+
53
+ # Use a different cache store in production.
54
+ # config.cache_store = :mem_cache_store
55
+
56
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
57
+ # config.action_controller.asset_host = "http://assets.example.com"
58
+
59
+ # Ignore bad email addresses and do not raise email delivery errors.
60
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
61
+ # config.action_mailer.raise_delivery_errors = false
62
+
63
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64
+ # the I18n.default_locale when a translation cannot be found).
65
+ config.i18n.fallbacks = true
66
+
67
+ # Send deprecation notices to registered listeners.
68
+ config.active_support.deprecation = :notify
69
+
70
+ # Disable automatic flushing of the log to improve performance.
71
+ # config.autoflush_log = false
72
+
73
+ # Use default logging formatter so that PID and timestamp are not suppressed.
74
+ config.log_formatter = ::Logger::Formatter.new
75
+
76
+ # Do not dump schema after migrations.
77
+ config.active_record.dump_schema_after_migration = false
78
+ end
@@ -0,0 +1,39 @@
1
+ Rails.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
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+
37
+ # Raises error for missing translations
38
+ # config.action_view.raise_on_missing_translations = true
39
+ end