prefab 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +43 -0
  3. data/.travis.yml +9 -0
  4. data/Gemfile +26 -0
  5. data/LICENSE +21 -0
  6. data/MIT-LICENSE +20 -0
  7. data/README.md +134 -0
  8. data/Rakefile +154 -0
  9. data/lib/generators/api/USAGE +8 -0
  10. data/lib/generators/api/api_generator.rb +11 -0
  11. data/lib/generators/api/templates/api.rb +8 -0
  12. data/lib/generators/api/templates/api_spec.rb +5 -0
  13. data/lib/generators/datatable/USAGE +8 -0
  14. data/lib/generators/datatable/datatable_generator.rb +12 -0
  15. data/lib/generators/datatable/templates/datatable.rb +55 -0
  16. data/lib/generators/datatable/templates/javascript.js.coffee +8 -0
  17. data/lib/generators/report/USAGE +8 -0
  18. data/lib/generators/report/report_generator.rb +12 -0
  19. data/lib/generators/report/templates/report.rb +54 -0
  20. data/lib/generators/report/templates/report_spec.rb +14 -0
  21. data/lib/generators/service/USAGE +8 -0
  22. data/lib/generators/service/service_generator.rb +11 -0
  23. data/lib/generators/service/templates/service.rb +4 -0
  24. data/lib/generators/service/templates/service_spec.rb +8 -0
  25. data/lib/prefab.rb +18 -0
  26. data/lib/prefab/install/install_generator.rb +43 -0
  27. data/lib/prefab/install/templates/assets/stylesheets/bootstrap-variables.less +829 -0
  28. data/lib/prefab/install/templates/assets/stylesheets/bootstrap-variables.scss +833 -0
  29. data/lib/prefab/install/templates/assets/stylesheets/starter.css +22 -0
  30. data/lib/prefab/install/templates/assets/stylesheets/starter.less +23 -0
  31. data/lib/prefab/install/templates/assets/stylesheets/starter.scss +22 -0
  32. data/lib/prefab/install/templates/form_builders/form_builder/_form.html.erb +28 -0
  33. data/lib/prefab/install/templates/form_builders/form_builder/_form.html.haml +19 -0
  34. data/lib/prefab/install/templates/form_builders/form_builder/_form.html.slim +18 -0
  35. data/lib/prefab/install/templates/layouts/starter.html.erb +51 -0
  36. data/lib/prefab/install/templates/layouts/starter.html.haml +40 -0
  37. data/lib/prefab/install/templates/layouts/starter.html.slim +44 -0
  38. data/lib/prefab/install/templates/lib/templates/erb/controller/view.html.erb +4 -0
  39. data/lib/prefab/install/templates/lib/templates/erb/scaffold/edit.html.erb +13 -0
  40. data/lib/prefab/install/templates/lib/templates/erb/scaffold/index.html.erb +33 -0
  41. data/lib/prefab/install/templates/lib/templates/erb/scaffold/new.html.erb +9 -0
  42. data/lib/prefab/install/templates/lib/templates/erb/scaffold/show.html.erb +19 -0
  43. data/lib/prefab/install/templates/lib/templates/haml/controller/view.html.haml +3 -0
  44. data/lib/prefab/install/templates/lib/templates/haml/scaffold/edit.html.haml +10 -0
  45. data/lib/prefab/install/templates/lib/templates/haml/scaffold/index.html.haml +26 -0
  46. data/lib/prefab/install/templates/lib/templates/haml/scaffold/new.html.haml +7 -0
  47. data/lib/prefab/install/templates/lib/templates/haml/scaffold/show.html.haml +14 -0
  48. data/lib/prefab/install/templates/lib/templates/slim/controller/view.html.slim +5 -0
  49. data/lib/prefab/install/templates/lib/templates/slim/scaffold/edit.html.slim +12 -0
  50. data/lib/prefab/install/templates/lib/templates/slim/scaffold/index.html.slim +31 -0
  51. data/lib/prefab/install/templates/lib/templates/slim/scaffold/new.html.slim +9 -0
  52. data/lib/prefab/install/templates/lib/templates/slim/scaffold/show.html.slim +16 -0
  53. data/lib/prefab/version.rb +3 -0
  54. data/lib/templates/active_record/model/model.rb +26 -0
  55. data/lib/templates/haml/scaffold/_form.html.haml +16 -0
  56. data/lib/templates/haml/scaffold/edit.html.haml +9 -0
  57. data/lib/templates/haml/scaffold/index.html.haml +22 -0
  58. data/lib/templates/haml/scaffold/new.html.haml +7 -0
  59. data/lib/templates/haml/scaffold/show.html.haml +12 -0
  60. data/lib/templates/rails/scaffold_controller/controller.rb +68 -0
  61. data/lib/templates/rspec/model/model_spec.rb +13 -0
  62. data/prefab.gemspec +29 -0
  63. data/test/dummy/Rakefile +7 -0
  64. data/test/dummy/app/assets/javascripts/application.js +13 -0
  65. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  66. data/test/dummy/config.ru +4 -0
  67. data/test/dummy/config/application.rb +68 -0
  68. data/test/dummy/config/boot.rb +6 -0
  69. data/test/dummy/config/environment.rb +5 -0
  70. data/test/dummy/config/environments/test.rb +34 -0
  71. data/test/generators/prefab/install_generator_test.rb +86 -0
  72. data/test/test_helper.rb +7 -0
  73. metadata +198 -0
@@ -0,0 +1,12 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ = link_to @<%= singular_table_name %>, :class => 'btn btn-primary' do
6
+ span.glyphicon.glyphicon-info-sign
7
+ | Show
8
+ h1
9
+ | Editing
10
+ | <%= singular_table_name %>
11
+
12
+ = render 'form'
@@ -0,0 +1,31 @@
1
+ .page-header
2
+ = link_to new_<%= singular_table_name %>_path, :class => 'btn btn-primary' do
3
+ span.glyphicon.glyphicon-plus
4
+ | New <%= human_name %>
5
+ h1
6
+ | Listing <%= plural_table_name %>
7
+
8
+ .table-responsive
9
+ table.table.table-striped.table-bordered.table-hover
10
+ thead
11
+ tr
12
+ <%- for attribute in attributes -%>
13
+ th
14
+ | <%= attribute.human_name %>
15
+ <%- end -%>
16
+ th
17
+ th
18
+ th
19
+ tbody
20
+ - @<%= plural_table_name %>.each do | <%= singular_table_name %> |
21
+ tr
22
+ <%- for attribute in attributes -%>
23
+ td
24
+ = <%= singular_table_name %>.<%= attribute.name %>
25
+ <%- end -%>
26
+ td
27
+ = link_to 'Show', <%= singular_table_name %>
28
+ td
29
+ = link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
30
+ td
31
+ = link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }
@@ -0,0 +1,9 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ h1
6
+ | New
7
+ | <%= singular_table_name %>
8
+
9
+ = render 'form'
@@ -0,0 +1,16 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ = link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-primary' do
6
+ span.glyphicon.glyphicon-pencil
7
+ | Edit
8
+ h1
9
+ | Show <%= singular_table_name %>
10
+ dl.dl-horizontal
11
+ <%- for attribute in attributes -%>
12
+ dt
13
+ | <%= attribute.human_name %>:
14
+ dd
15
+ = @<%= singular_table_name %>.<%= attribute.name %>
16
+ <%- end -%>
@@ -0,0 +1,3 @@
1
+ module Prefab
2
+ VERSION = '1.0.0'
3
+ end
@@ -0,0 +1,26 @@
1
+ <% module_namespacing do -%>
2
+ class <%= class_name %> < <%= parent_class_name.classify %>
3
+ <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
4
+ belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
5
+ <% end -%>
6
+
7
+ <% if !accessible_attributes.empty? -%>
8
+ attr_accessible <%= accessible_attributes.map {|a| ":#{a.name}" }.sort.join(', ') %>
9
+ <% else -%>
10
+ # attr_accessible :title, :body
11
+ <% end -%>
12
+
13
+ <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
14
+ delegate :name, to: :<%= attribute.name %>, allow_nil: true, prefix: true
15
+ <% end -%>
16
+
17
+ def to_s
18
+ <%- if attributes.map{ |a| a.name }.include?('name') -%>
19
+ name
20
+ <%- else -%>
21
+ "<%= class_name %> #{id}"
22
+ <%- end -%>
23
+ end
24
+
25
+ end
26
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ = simple_form_for(<%= singular_table_name %>, :html => {:class => 'form-horizontal'}, :wrapper => :bootstrap, defaults: {label_html: {class: 'col-md-6'}}, role: 'form') do |f|
2
+ = f.error_notification
3
+
4
+ .row
5
+ .col-md-6
6
+ <%- attributes.each do |attribute| -%>
7
+ <%- if attribute.name.include?('_at') || attribute.name.include?('_on') -%>
8
+ = f.input :<%= attribute.name %>, :as => :string, :input_html => { :class => "datepicker" }
9
+ <%- else -%>
10
+ = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
11
+ <%- end -%>
12
+ <%- end -%>
13
+
14
+ .row
15
+ .col-md-6.col-md-offset-6
16
+ = f.button :submit, :class => 'btn btn-primary'
@@ -0,0 +1,9 @@
1
+ .page-header
2
+ %h1
3
+ Edit <%= singular_table_name.titleize %>
4
+ .pull-right
5
+ = link_to 'Show', <%= singular_table_name %>, class: 'btn btn-info'
6
+ = link_to t('back',to: "<%= plural_table_name.titleize %>").html_safe, <%= index_helper %>_path, class: 'btn btn-default'
7
+ = render 'form'
8
+
9
+
@@ -0,0 +1,22 @@
1
+ .page-header
2
+ %h1
3
+ <%= plural_table_name.capitalize.gsub("_","") %>
4
+ .pull-right
5
+ = link_to t('new', model_name: "<%= singular_table_name.gsub("_"," ").titleize %>").html_safe, new_<%= singular_table_name %>_path, :class => 'btn btn-primary'
6
+
7
+ %table#<%= plural_table_name %>.table.table-bordered.table-striped.dataTable{:data => {:source => list_<%= plural_table_name %>_url(:format => 'json', :protocol => protocol)}}
8
+ %thead
9
+ %tr
10
+ <% for attribute in attributes -%>
11
+ %th <%= attribute.human_name %>
12
+ <% end -%>
13
+ %th
14
+ %tbody
15
+ - <%= plural_table_name %>.each do |<%= singular_table_name %>|
16
+ %tr
17
+ <% for attribute in attributes -%>
18
+ %td= <%= singular_table_name %>.<%= attribute.name %>
19
+ <% end -%>
20
+ %td
21
+ = link_to t('edit').html_safe, edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class => 'btn btn-default btn-xs'
22
+ = link_to t('destroy').html_safe, <%= singular_table_name %>, :method => :delete, :data => { :confirm => 'Are you sure?' }, :class => 'btn btn-xs btn-danger'
@@ -0,0 +1,7 @@
1
+ .page-header
2
+ %h1
3
+ New <%= singular_table_name.titleize %>
4
+ .pull-right
5
+ = link_to t('back',to: "<%= plural_table_name.titleize %>").html_safe, <%= index_helper %>_path, :class => 'btn btn-default'
6
+ = render 'form'
7
+
@@ -0,0 +1,12 @@
1
+ .page-header
2
+ %h1
3
+ <%= singular_table_name.titleize %>
4
+ .pull-right
5
+ = link_to raw(t('edit')), edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class => 'btn btn-primary'
6
+ = link_to raw(t('back',to: "<%= plural_table_name.titleize %>")), <%= index_helper %>_path, :class => 'btn btn-default'
7
+ %dl
8
+ <% for attribute in attributes -%>
9
+ %dt <%= attribute.human_name %>:
10
+ %dd= <%= singular_table_name %>.<%= attribute.name %>
11
+ <% end -%>
12
+
@@ -0,0 +1,68 @@
1
+ <% if namespaced? -%>
2
+ require_dependency "<%= namespaced_file_path %>/application_controller"
3
+
4
+ <% end -%>
5
+ <% module_namespacing do -%>
6
+ class <%= controller_class_name %>Controller < ApplicationController
7
+ before_filter :authenticate_user!
8
+ respond_to :html, :json
9
+
10
+ expose(:<%= plural_table_name %>) { <%= orm_class.all(class_name) %> }
11
+ expose(:<%= singular_table_name %>) { params[:id].present? ? <%= class_name %>.find(params[:id]) : <%= class_name %>.new(params[:<%= singular_table_name %>]) }
12
+
13
+ def list
14
+ respond_to do |format|
15
+ format.json { render json: <%= class_name.pluralize %>Datatable.new(view_context) }
16
+ end
17
+ end
18
+
19
+ # POST <%= route_url %>
20
+ # POST <%= route_url %>.json
21
+ def create
22
+ respond_to do |format|
23
+ if <%= orm_instance.save %>
24
+ format.html { redirect_to <%= singular_table_name %>, notice: <%= "'#{human_name} was successfully created.'" %> }
25
+ format.json { render json: <%= "#{singular_table_name}" %>, status: ':created', location: <%= "#{singular_table_name}" %> }
26
+ else
27
+ format.html { render action: 'new' }
28
+ format.json { render json: <%= "#{orm_instance.errors}" %>, status: ':unprocessable_entity' }
29
+ end
30
+ end
31
+ end
32
+
33
+ # PUT <%= route_url %>/1
34
+ # PUT <%= route_url %>/1.json
35
+ def update
36
+ respond_to do |format|
37
+ if <%= orm_instance.update("#{singular_table_name}_params") %>
38
+ format.html { redirect_to <%= singular_table_name %>, notice: <%= "'#{human_name} was successfully updated.'" %> }
39
+ format.json { head :no_content }
40
+ else
41
+ format.html { render action: 'edit' }
42
+ format.json { render json: <%= "#{orm_instance.errors}" %>, status: ':unprocessable_entity' }
43
+ end
44
+ end
45
+ end
46
+
47
+ # DELETE <%= route_url %>/1
48
+ # DELETE <%= route_url %>/1.json
49
+ def destroy
50
+ <%= orm_instance.destroy %>
51
+
52
+ respond_to do |format|
53
+ format.html { redirect_to <%= index_helper %>_url }
54
+ format.json { head :no_content }
55
+ end
56
+ end
57
+
58
+ private
59
+ # Only allow a trusted parameter "white list" through.
60
+ def <%= "#{singular_table_name}_params" %>
61
+ <%- if attributes_names.empty? -%>
62
+ params[:<%= singular_table_name %>]
63
+ <%- else -%>
64
+ params.require(:<%= singular_table_name %>).permit(<%= attributes_names.map { |name| ":#{name}" }.join(', ') %>)
65
+ <%- end -%>
66
+ end
67
+ end
68
+ <% end -%>
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= class_name %> do
4
+ let(:<%= class_name.underscore %>) { Fabricate(:<%= class_name.underscore %>) }
5
+
6
+ context 'delegation' do
7
+ <% attributes.select {|attr| attr.reference? }.each do |attribute| -%>
8
+ it "should delegate association" do
9
+ <%= class_name.underscore %>.<%= attribute.name %>_name.should be
10
+ end
11
+ <% end -%>
12
+ end
13
+ end
data/prefab.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "prefab/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "prefab"
8
+ spec.version = Prefab::VERSION
9
+ spec.authors = ["John Perkins"]
10
+ spec.email = ["jeperkins4@gmail.com"]
11
+ spec.summary = %q{Prefab provides Twitter Bootstrap generators for Rails 4 (supported Rails >= 3.1).}
12
+ spec.description = %q{Prefab provides Twitter Bootstrap generators for Rails 4 (supported Rails >= 3.1). Checkout http://getbootstrap.com.}
13
+ spec.homepage = "https://github.com/jeperkins4/prefab"
14
+ spec.license = "MIT"
15
+
16
+ spec.rubyforge_project = "prefab"
17
+
18
+ spec.files = `git ls-files`.split($/)
19
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency "rake"
25
+ spec.add_development_dependency 'rspec'
26
+ spec.add_development_dependency 'debugger'
27
+
28
+ spec.add_runtime_dependency "railties", ">= 3.1.0"
29
+ end
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env rake
2
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
3
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
+
5
+ require File.expand_path('../config/application', __FILE__)
6
+
7
+ Dummy::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
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require_tree .
@@ -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
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,68 @@
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 'active_resource/railtie'
8
+ require 'sprockets/railtie'
9
+ # require 'rails/test_unit/railtie'
10
+
11
+ if defined?(Bundler)
12
+ # If you precompile assets before deploying to production, use this line
13
+ Bundler.require(*Rails.groups(assets: %w(development test)))
14
+ # If you want your assets lazily compiled in production, use this line
15
+ # Bundler.require(:default, :assets, Rails.env)
16
+ end
17
+
18
+ module Dummy
19
+ class Application < Rails::Application
20
+ # Settings in config/environments/* take precedence over those specified here.
21
+ # Application configuration should go into files in config/initializers
22
+ # -- all .rb files in that directory are automatically loaded.
23
+
24
+ # Custom directories with classes and modules you want to be autoloadable.
25
+ # config.autoload_paths += %W(#{config.root}/extras)
26
+
27
+ # Only load the plugins named here, in the order given (default is alphabetical).
28
+ # :all can be used as a placeholder for all plugins not explicitly named.
29
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
30
+
31
+ # Activate observers that should always be running.
32
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33
+
34
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
36
+ # config.time_zone = 'Central Time (US & Canada)'
37
+
38
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
40
+ # config.i18n.default_locale = :de
41
+
42
+ # Configure the default encoding used in templates for Ruby 1.9.
43
+ config.encoding = 'utf-8'
44
+
45
+ # Configure sensitive parameters which will be filtered from the log file.
46
+ config.filter_parameters += [:password]
47
+
48
+ # Enable escaping HTML in JSON.
49
+ config.active_support.escape_html_entities_in_json = true
50
+
51
+ # Use SQL instead of Active Record's schema dumper when creating the database.
52
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
53
+ # like if you have constraints or database-specific column types
54
+ # config.active_record.schema_format = :sql
55
+
56
+ # Enforce whitelist mode for mass assignment.
57
+ # This will create an empty whitelist of attributes available for mass-assignment for all models
58
+ # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
59
+ # parameters by using an attr_accessible or attr_protected declaration.
60
+ # config.active_record.whitelist_attributes = true
61
+
62
+ # Enable the asset pipeline
63
+ config.assets.enabled = true
64
+
65
+ # Version of your assets, change this if you want to expire all your assets
66
+ config.assets.version = '1.0'
67
+ end
68
+ end
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+
6
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
@@ -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,34 @@
1
+ Dummy::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
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = 'public, max-age=3600'
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Print deprecation notices to the stderr
33
+ config.active_support.deprecation = :stderr
34
+ end