venice-chr 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Gemfile +40 -0
  4. data/Gemfile.lock +481 -0
  5. data/Procfile +1 -0
  6. data/README.md +62 -0
  7. data/Rakefile +8 -0
  8. data/app/assets/fonts/ProximaNovaRegular.eot +0 -0
  9. data/app/assets/fonts/ProximaNovaRegular.ttf +0 -0
  10. data/app/assets/fonts/ProximaNovaRegular.woff +0 -0
  11. data/app/assets/fonts/ProximaNovaSemibold.eot +0 -0
  12. data/app/assets/fonts/ProximaNovaSemibold.ttf +0 -0
  13. data/app/assets/fonts/ProximaNovaSemibold.woff +0 -0
  14. data/app/assets/images/.keep +0 -0
  15. data/app/assets/javascripts/admin/settings/config.coffee +9 -0
  16. data/app/assets/javascripts/admin/settings/general.coffee +52 -0
  17. data/app/assets/javascripts/admin.coffee +39 -0
  18. data/app/assets/javascripts/application.coffee +2 -0
  19. data/app/assets/stylesheets/admin.scss +50 -0
  20. data/app/assets/stylesheets/application.scss +4 -0
  21. data/app/assets/stylesheets/themes/venice/base.scss +163 -0
  22. data/app/assets/stylesheets/themes/venice/desktop.scss +132 -0
  23. data/app/assets/stylesheets/themes/venice/mobile.scss +95 -0
  24. data/app/assets/stylesheets/themes/venice.scss +12 -0
  25. data/app/controllers/admin/base_controller.rb +17 -0
  26. data/app/controllers/admin/devise_overrides/passwords_controller.rb +11 -0
  27. data/app/controllers/admin/devise_overrides/sessions_controller.rb +20 -0
  28. data/app/controllers/application_controller.rb +7 -0
  29. data/app/controllers/concerns/load_settings.rb +23 -0
  30. data/app/helpers/application_helper.rb +102 -0
  31. data/app/helpers/body_class_helper.rb +15 -0
  32. data/app/mailers/.keep +0 -0
  33. data/app/models/.keep +0 -0
  34. data/app/models/concerns/.keep +0 -0
  35. data/app/models/venice_settings.rb +2 -0
  36. data/app/views/admin/devise_overrides/passwords/edit.html.erb +31 -0
  37. data/app/views/admin/devise_overrides/passwords/new.html.erb +19 -0
  38. data/app/views/admin/devise_overrides/sessions/new.html.erb +29 -0
  39. data/app/views/admin/index.html.erb +5 -0
  40. data/app/views/application/_footer.html.erb +3 -0
  41. data/app/views/application/_header.html.erb +17 -0
  42. data/app/views/application/_javascript.html.erb +7 -0
  43. data/app/views/kaminari/_first_page.html.erb +15 -0
  44. data/app/views/kaminari/_gap.html.erb +8 -0
  45. data/app/views/kaminari/_last_page.html.erb +15 -0
  46. data/app/views/kaminari/_next_page.html.erb +15 -0
  47. data/app/views/kaminari/_page.html.erb +12 -0
  48. data/app/views/kaminari/_paginator.html.erb +23 -0
  49. data/app/views/kaminari/_prev_page.html.erb +15 -0
  50. data/app/views/layouts/admin.html.erb +21 -0
  51. data/app/views/layouts/application.html.erb +22 -0
  52. data/bin/bundle +3 -0
  53. data/bin/deploy-heroku +35 -0
  54. data/bin/rails +8 -0
  55. data/bin/rake +8 -0
  56. data/bin/setup +35 -0
  57. data/bin/spring +15 -0
  58. data/bin/venice +12 -0
  59. data/config/application.rb +40 -0
  60. data/config/boot.rb +3 -0
  61. data/config/environment.rb +5 -0
  62. data/config/environments/development.rb +40 -0
  63. data/config/environments/production.rb +96 -0
  64. data/config/environments/staging.rb +9 -0
  65. data/config/environments/test.rb +44 -0
  66. data/config/initializers/assets.rb +11 -0
  67. data/config/initializers/backtrace_silencers.rb +7 -0
  68. data/config/initializers/bypass_ssl_verification_for_open_uri.rb +1 -0
  69. data/config/initializers/carrierwave.rb +21 -0
  70. data/config/initializers/cookies_serializer.rb +3 -0
  71. data/config/initializers/devise.rb +262 -0
  72. data/config/initializers/errors.rb +34 -0
  73. data/config/initializers/filter_parameter_logging.rb +4 -0
  74. data/config/initializers/inflections.rb +16 -0
  75. data/config/initializers/json_encoding.rb +1 -0
  76. data/config/initializers/kaminari_config.rb +10 -0
  77. data/config/initializers/mime_types.rb +4 -0
  78. data/config/initializers/session_store.rb +3 -0
  79. data/config/initializers/wrap_parameters.rb +9 -0
  80. data/config/locales/devise.en.yml +60 -0
  81. data/config/locales/en.yml +23 -0
  82. data/config/mongoid.yml +106 -0
  83. data/config/routes.rb +35 -0
  84. data/config/secrets.yml +14 -0
  85. data/config/smtp.rb +9 -0
  86. data/config/unicorn.rb +17 -0
  87. data/config.ru +4 -0
  88. data/db/seeds.rb +10 -0
  89. data/lib/assets/.keep +0 -0
  90. data/lib/tasks/.keep +0 -0
  91. data/lib/venice/kit.rb +39 -0
  92. data/lib/venice/version.rb +3 -0
  93. data/lib/venice.rb +2 -0
  94. data/public/404.html +69 -0
  95. data/public/422.html +69 -0
  96. data/public/500.html +68 -0
  97. data/public/favicon.ico +0 -0
  98. data/public/robots.txt +5 -0
  99. data/vendor/assets/javascripts/.keep +0 -0
  100. data/vendor/assets/stylesheets/.keep +0 -0
  101. data/venice-chr.gemspec +23 -0
  102. metadata +187 -0
File without changes
@@ -0,0 +1,2 @@
1
+ class VeniceSettings
2
+ end
@@ -0,0 +1,31 @@
1
+ <% set_meta_tags title: 'Venice — Change Password' %>
2
+
3
+ <div class='signin-modal'>
4
+ <h2>Change password</h2>
5
+ <p class='notice'><%= notice %></p>
6
+ <p class='alert'><%= alert %></p>
7
+
8
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
9
+ <%= f.hidden_field :reset_password_token %>
10
+
11
+ <label for='admin_user_password' class='form-input input-required input-string'>
12
+ <div class='label'>
13
+ New password
14
+ <% if @minimum_password_length %>
15
+ <em>(<%= @minimum_password_length %> characters minimum)</em>
16
+ <% end %>
17
+ </div>
18
+ <%= f.password_field :password, autocomplete: "off", tabindex: 1 %>
19
+ </label>
20
+
21
+ <label for='admin_user_password_confirmation' class='form-input input-required input-string'>
22
+ <div class='label'>Confirm new password</div>
23
+ <%= f.password_field :password_confirmation, autocomplete: "off", tabindex: 2 %>
24
+ </label>
25
+
26
+ <%= devise_error_messages! %>
27
+
28
+ <%= f.submit "Change password", tabindex: 3 %>
29
+ <%= link_to 'Sign In', new_session_path(resource_name) %>
30
+ <% end %>
31
+ </div>
@@ -0,0 +1,19 @@
1
+ <% set_meta_tags title: 'Venice — Reset Password' %>
2
+
3
+ <div class='signin-modal'>
4
+ <h2>Forgot your password?</h2>
5
+ <p class='notice'><%= notice %></p>
6
+ <p class='alert'><%= alert %></p>
7
+
8
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
9
+ <label for='admin_user_email' class='form-input input-required input-string'>
10
+ <div class='label'>Email</div>
11
+ <%= f.email_field :email, autofocus: true, tabindex: 1 %>
12
+ </label>
13
+
14
+ <%= devise_error_messages! %>
15
+
16
+ <%= f.submit "Reset password", tabindex: 2 %>
17
+ <%= link_to 'Sign In', new_session_path(resource_name) %>
18
+ <% end %>
19
+ </div>
@@ -0,0 +1,29 @@
1
+ <% set_meta_tags title: 'Venice — Sing in' %>
2
+
3
+ <div class='signin-modal'>
4
+ <h2>Sign in</h2>
5
+ <p class='notice'><%= notice %></p>
6
+ <p class='alert'><%= alert %></p>
7
+
8
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
9
+ <label for='admin_user_email' class='form-input input-required input-string'>
10
+ <div class='label'>Email</div>
11
+ <%= f.email_field :email, autofocus: true, tabindex: 1 %>
12
+ </label>
13
+
14
+ <label for='admin_user_password' class='form-input input-required input-string'>
15
+ <div class='label'>Password <%= link_to 'Forgot?', new_password_path(resource_name) %></div>
16
+ <%= f.password_field :password, autocomplete: "off", tabindex: 2 %>
17
+ </label>
18
+
19
+ <label for='admin_user_remember_me' class='form-input input-switch'>
20
+ <div class='switch'>
21
+ <%= f.check_box :remember_me, tabindex: 3 %>
22
+ <div class='checkbox'></div>
23
+ </div>
24
+ <span class='label'>Remember me</span>
25
+ </label>
26
+
27
+ <%= f.submit "Sign in", tabindex: 4 %>
28
+ <% end %>
29
+ </div>
@@ -0,0 +1,5 @@
1
+ <%= javascript_include_tag :admin %>
2
+
3
+ <% if admin_user_signed_in? %>
4
+ <%= render partial: 'ants/profile' %>
5
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <footer class="footer">
2
+ <%= footer_copyright %>
3
+ </footer>
@@ -0,0 +1,17 @@
1
+ <aside class="header">
2
+ <%= link_to root_path, class: "header-image" do %>
3
+ <%= sidebar_image_tag %>
4
+ <% end %>
5
+
6
+ <div class="header-tagline">
7
+ <%= sidebar_tagline %>
8
+ </div>
9
+
10
+ <nav class="header-menu">
11
+ <%= menu "Main Menu" %>
12
+ </nav>
13
+
14
+ <nav class="social-menu">
15
+ <%= social_links %>
16
+ </nav>
17
+ </aside>
@@ -0,0 +1,7 @@
1
+ <%= javascript_include_tag :application %>
2
+
3
+ <%= yield :javascript %>
4
+
5
+ <% if Rails.env.production? %>
6
+ <% # analytics code to be added here %>
7
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <span class="first">
10
+ <% unless current_page.first? %>
11
+ <%= link_to url, :remote => remote do %>
12
+ <%= fa_icon("angle-double-left") %>
13
+ <% end %>
14
+ <% end %>
15
+ </span>
@@ -0,0 +1,8 @@
1
+ <%# Non-link tag that stands for skipped pages...
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ -%>
8
+ <span class="page gap"><%= t('views.pagination.truncate').html_safe %></span>
@@ -0,0 +1,15 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <span class="last">
10
+ <% unless current_page.last? %>
11
+ <%= link_to url, :remote => remote do %>
12
+ <%= fa_icon("angle-double-right") %>
13
+ <% end %>
14
+ <% end %>
15
+ </span>
@@ -0,0 +1,15 @@
1
+ <%# Link to the "Next" page
2
+ - available local variables
3
+ url: url to the next page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <span class="next">
10
+ <% unless current_page.last? %>
11
+ <%= link_to url, :rel => 'next', :remote => remote do %>
12
+ <%= fa_icon("angle-right") %>
13
+ <% end %>
14
+ <% end %>
15
+ </span>
@@ -0,0 +1,12 @@
1
+ <%# Link showing page number
2
+ - available local variables
3
+ page: a page object for "this" page
4
+ url: url to this page
5
+ current_page: a page object for the currently displayed page
6
+ total_pages: total number of pages
7
+ per_page: number of items to fetch per page
8
+ remote: data-remote
9
+ -%>
10
+ <span class="page<%= ' current' if page.current? %>">
11
+ <%= link_to_unless page.current?, page, url, {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
12
+ </span>
@@ -0,0 +1,23 @@
1
+ <%# The container tag
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ total_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ paginator: the paginator that renders the pagination tags inside
8
+ -%>
9
+ <%= paginator.render do -%>
10
+ <nav class="pagination">
11
+ <%= first_page_tag unless current_page.first? %>
12
+ <%= prev_page_tag unless current_page.first? %>
13
+ <% each_page do |page| -%>
14
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
15
+ <%= page_tag page %>
16
+ <% elsif !page.was_truncated? -%>
17
+ <%= gap_tag %>
18
+ <% end -%>
19
+ <% end -%>
20
+ <%= next_page_tag unless current_page.last? %>
21
+ <%= last_page_tag unless current_page.last? %>
22
+ </nav>
23
+ <% end -%>
@@ -0,0 +1,15 @@
1
+ <%# Link to the "Previous" page
2
+ - available local variables
3
+ url: url to the previous page
4
+ current_page: a page object for the currently displayed page
5
+ total_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <span class="prev">
10
+ <% unless current_page.first? %>
11
+ <%= link_to url, :rel => 'prev', :remote => remote do %>
12
+ <%= fa_icon("angle-left") %>
13
+ <% end %>
14
+ <% end %>
15
+ </span>
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
6
+
7
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
8
+ <meta name="apple-mobile-web-app-capable" content="yes">
9
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
10
+
11
+ <%= display_meta_tags site: @settings[:general][:website_title], title: 'Venice' %>
12
+
13
+ <%= stylesheet_link_tag :admin, media: 'all' %>
14
+ <%= csrf_meta_tags %>
15
+ </head>
16
+
17
+ <body class='<%= body_class %>'>
18
+ <%= yield %>
19
+ </body>
20
+
21
+ </html>
@@ -0,0 +1,22 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <!-- META TAGS ============================================================ -->
6
+ <%= include_meta_tags %>
7
+ <!-- ====================================================================== -->
8
+ <meta name="viewport" content="initial-scale=1" />
9
+ <%= stylesheet_link_tag :application, media: "all" %>
10
+ </head>
11
+ <body class="<%= body_class %>">
12
+ <%= render 'header' %>
13
+
14
+ <div class="container">
15
+ <%= yield %>
16
+ </div>
17
+
18
+ <%= render 'footer' %>
19
+
20
+ <%= render 'javascript' %>
21
+ </body>
22
+ </html>
data/bin/bundle ADDED
@@ -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')
data/bin/deploy-heroku ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env sh
2
+
3
+ if git remote | grep heroku > /dev/null; then
4
+ git push heroku master
5
+ else
6
+ read -p "Please provide Heroku application name: " APP_NAME
7
+
8
+ if [ APP_NAME == "" ]; then
9
+ echo "¯\_(ツ)_/¯"
10
+ exit 1
11
+ fi
12
+
13
+ heroku create "${APP_NAME}"
14
+ heroku git:remote -a "${APP_NAME}"
15
+ heroku config:set SMTP_ADDRESS=smtp.sendgrid.net \
16
+ SMTP_DOMAIN=heroku.com \
17
+ SMTP_PASSWORD=placeholder \
18
+ SMTP_USERNAME=placeholder \
19
+ HOST="${APP_NAME}.herokuapp.com"
20
+
21
+ heroku addons:create mongolab
22
+ heroku addons:create sendgrid:starter
23
+
24
+ SENDGRID_USERNAME=$(heroku config:get SENDGRID_USERNAME)
25
+ SENDGRID_PASSWORD=$(heroku config:get SENDGRID_PASSWORD)
26
+ MONGOLAB_URI=$(heroku config:get MONGOLAB_URI)
27
+
28
+ heroku config:set SMTP_USERNAME="${SENDGRID_USERNAME}" \
29
+ SMTP_PASSWORD="${SENDGRID_PASSWORD}" \
30
+ MONGODB_URI="${MONGOLAB_URI}"
31
+
32
+ git push heroku master
33
+ heroku run rake db:seed
34
+ echo "Done"
35
+ fi
data/bin/rails ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
data/bin/rake ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
data/bin/setup ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env sh
2
+
3
+ # Run this script immediately after cloning the codebase.
4
+
5
+ # Make sure Bundler is installed
6
+ if [ "$(gem query -i -n bundler)" = "false" ]; then
7
+ echo "Installing Bundler..."
8
+ gem install bundler
9
+ fi
10
+
11
+ # Set up Ruby dependencies via Bundler
12
+ echo "Installing Dependencies..."
13
+ bundle install
14
+
15
+ # Rename database & and making first commit
16
+ DEV_DB_NAME="${PWD##*/}_development"
17
+ sed -i.bak "s/venice_development/${DEV_DB_NAME}/g" config/mongoid.yml
18
+ rm config/mongoid.yml.bak
19
+
20
+ # Seed data
21
+ rake db:seed
22
+
23
+ # Remove Git remote if it's still the venice repo (after cloning)
24
+ if [ "$(git config --get remote.origin.url)" = "git@github.com:alexkravets/venice.git" ]; then
25
+ git remote rename origin venice
26
+
27
+ echo "What is your repo url? Enter URL or leave blank"
28
+ read url
29
+ if [ -z "$url" ]; then
30
+ git remote add origin "$url"
31
+
32
+ git add config/mongoid.yml
33
+ git commit -am "Update development database name."
34
+ fi
35
+ fi
data/bin/spring ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m))
11
+ Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12
+ gem "spring", match[1]
13
+ require "spring/binstub"
14
+ end
15
+ end
data/bin/venice ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+
5
+ begin
6
+ require 'venice/kit'
7
+ rescue LoadError => e
8
+ warn 'Could not load "venice/kit"'
9
+ exit -1
10
+ end
11
+
12
+ Venice::Kit.start
@@ -0,0 +1,40 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ # require "active_record/railtie"
8
+ require "action_controller/railtie"
9
+ require "action_mailer/railtie"
10
+ require "action_view/railtie"
11
+ require "sprockets/railtie"
12
+ # require "rails/test_unit/railtie"
13
+
14
+ # Require the gems listed in Gemfile, including any gems
15
+ # you've limited to :test, :development, or :production.
16
+ Bundler.require(*Rails.groups)
17
+
18
+ module Venice
19
+ class Application < Rails::Application
20
+
21
+ config.generators do |generate|
22
+ generate.helper false
23
+ generate.javascript_engine false
24
+ generate.stylesheets false
25
+ end
26
+
27
+ config.action_controller.action_on_unpermitted_parameters = :raise
28
+ # Settings in config/environments/* take precedence over those specified here.
29
+ # Application configuration should go into files in config/initializers
30
+ # -- all .rb files in that directory are automatically loaded.
31
+
32
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
33
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
34
+ # config.time_zone = 'Central Time (US & Canada)'
35
+
36
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
37
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
38
+ # config.i18n.default_locale = :de
39
+ end
40
+ end
data/config/boot.rb ADDED
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -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,40 @@
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
+ # Debug mode disables concatenation and preprocessing of assets.
23
+ # This option may cause significant delays in view rendering with a large
24
+ # number of complex assets.
25
+ config.assets.debug = true
26
+
27
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
28
+ # yet still be able to expire them through the digest params.
29
+ config.assets.digest = true
30
+
31
+ # Adds additional error checking when serving assets at runtime.
32
+ # Checks for improperly declared sprockets dependencies.
33
+ # Raises helpful error messages.
34
+ config.assets.raise_runtime_errors = true
35
+
36
+ # Raises error for missing translations
37
+ # config.action_view.raise_on_missing_translations = true
38
+
39
+ config.action_mailer.default_url_options = { host: "localhost:3000" }
40
+ end
@@ -0,0 +1,96 @@
1
+ require Rails.root.join("config/smtp")
2
+ Rails.application.configure do
3
+ # Settings specified here will take precedence over those in config/application.rb.
4
+
5
+ # Code is not reloaded between requests.
6
+ config.cache_classes = true
7
+
8
+ # Eager load code on boot. This eager loads most of Rails and
9
+ # your application in memory, allowing both threaded web servers
10
+ # and those relying on copy on write to perform better.
11
+ # Rake tasks automatically ignore this option for performance.
12
+ config.eager_load = true
13
+
14
+ # Full error reports are disabled and caching is turned on.
15
+ config.consider_all_requests_local = false
16
+ config.action_controller.perform_caching = true
17
+
18
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
19
+ # Add `rack-cache` to your Gemfile before enabling this.
20
+ # For large-scale production use, consider using a caching reverse proxy like
21
+ # NGINX, varnish or squid.
22
+ # config.action_dispatch.rack_cache = true
23
+
24
+ # Disable serving static files from the `/public` folder by default since
25
+ # Apache or NGINX already handles this.
26
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
27
+ config.static_cache_control = "public, max-age=#{1.year.to_i}"
28
+ # Enable deflate / gzip compression of controller-generated responses
29
+ config.middleware.use Rack::Deflater
30
+
31
+ # Ensure requests are only served from one, canonical host name
32
+ config.middleware.use Rack::CanonicalHost, ENV.fetch("HOST")
33
+
34
+ # Compress JavaScripts and CSS.
35
+ config.assets.js_compressor = :uglifier
36
+ # config.assets.css_compressor = :sass
37
+
38
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
39
+ config.assets.compile = false
40
+
41
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
42
+ # yet still be able to expire them through the digest params.
43
+ config.assets.digest = true
44
+
45
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
46
+
47
+ # Specifies the header that your server uses for sending files.
48
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
49
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
50
+
51
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
52
+ # config.force_ssl = true
53
+
54
+ # Use the lowest log level to ensure availability of diagnostic information
55
+ # when problems arise.
56
+ config.log_level = :debug
57
+
58
+ # Prepend all log lines with the following tags.
59
+ # config.log_tags = [ :subdomain, :uuid ]
60
+
61
+ # Use a different logger for distributed setups.
62
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
63
+
64
+ # Use a different cache store in production.
65
+ # config.cache_store = :mem_cache_store
66
+
67
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
68
+ # config.action_controller.asset_host = ENV.fetch("ASSET_HOST")
69
+
70
+ # Ignore bad email addresses and do not raise email delivery errors.
71
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
72
+ # config.action_mailer.raise_delivery_errors = false
73
+ config.action_mailer.delivery_method = :smtp
74
+ config.action_mailer.smtp_settings = SMTP_SETTINGS
75
+
76
+
77
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
78
+ # the I18n.default_locale when a translation cannot be found).
79
+ config.i18n.fallbacks = true
80
+
81
+ # Send deprecation notices to registered listeners.
82
+ config.active_support.deprecation = :notify
83
+
84
+ # Use default logging formatter so that PID and timestamp are not suppressed.
85
+ config.log_formatter = ::Logger::Formatter.new
86
+
87
+ config.action_mailer.default_url_options = { host: ENV.fetch("HOST") }
88
+
89
+ config.action_mailer.asset_host = "http://#{ ENV.fetch("HOST") }"
90
+
91
+ # config.middleware.use Rack::HostRedirect, {
92
+ # 'www.example.com' => 'example.com'
93
+ # }
94
+ end
95
+
96
+ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
@@ -0,0 +1,9 @@
1
+ require_relative "production"
2
+
3
+ Mail.register_interceptor(
4
+ RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS"))
5
+ )
6
+
7
+ Rails.application.configure do
8
+ # ...
9
+ end
@@ -0,0 +1,44 @@
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 file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = 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
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+
43
+ config.action_mailer.default_url_options = { host: "www.example.com" }
44
+ end