phoenixbricks 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/Gemfile +7 -0
  4. data/LICENSE.txt +674 -0
  5. data/README.md +85 -0
  6. data/bin/rbricks +5 -0
  7. data/lib/railsbricks.rb +115 -0
  8. data/lib/railsbricks/app_generator.rb +352 -0
  9. data/lib/railsbricks/assets/config/admin_post_routes.rbr +3 -0
  10. data/lib/railsbricks/assets/config/application.yml +9 -0
  11. data/lib/railsbricks/assets/config/contact_routes.rbr +2 -0
  12. data/lib/railsbricks/assets/config/initializers/devise_email/devise.rb +267 -0
  13. data/lib/railsbricks/assets/config/initializers/devise_username/devise.rb +267 -0
  14. data/lib/railsbricks/assets/config/post_routes.rbr +2 -0
  15. data/lib/railsbricks/assets/config/routes.rb +15 -0
  16. data/lib/railsbricks/assets/config/unicorn.rb +22 -0
  17. data/lib/railsbricks/assets/controllers/admin/base_controller.rb +10 -0
  18. data/lib/railsbricks/assets/controllers/admin/devise_email/users_controller.rb +66 -0
  19. data/lib/railsbricks/assets/controllers/admin/devise_username/users_controller.rb +69 -0
  20. data/lib/railsbricks/assets/controllers/admin/posts_controller.rb +73 -0
  21. data/lib/railsbricks/assets/controllers/brick_contact.rbr +23 -0
  22. data/lib/railsbricks/assets/controllers/devise_email/application_controller.rb +54 -0
  23. data/lib/railsbricks/assets/controllers/devise_username/application_controller.rb +56 -0
  24. data/lib/railsbricks/assets/controllers/pages_controller.rb +13 -0
  25. data/lib/railsbricks/assets/controllers/posts_controller.rbr +10 -0
  26. data/lib/railsbricks/assets/database/postgresql.yml +12 -0
  27. data/lib/railsbricks/assets/database/sqlite3.yml +8 -0
  28. data/lib/railsbricks/assets/gemfile/Gemfile +44 -0
  29. data/lib/railsbricks/assets/git/gitignore +30 -0
  30. data/lib/railsbricks/assets/javascripts/analytics.js.coffee +5 -0
  31. data/lib/railsbricks/assets/lib/markdown_writer.rb +19 -0
  32. data/lib/railsbricks/assets/mailers/contact_mailer.rb +13 -0
  33. data/lib/railsbricks/assets/migrations/20141010133702_create_posts.rb +17 -0
  34. data/lib/railsbricks/assets/migrations/devise_email/20141010133701_devise_create_users.rb +48 -0
  35. data/lib/railsbricks/assets/migrations/devise_username/20141010133701_devise_create_users.rb +54 -0
  36. data/lib/railsbricks/assets/models/devise_email/user.rb +41 -0
  37. data/lib/railsbricks/assets/models/devise_username/user.rb +57 -0
  38. data/lib/railsbricks/assets/models/post.rb +30 -0
  39. data/lib/railsbricks/assets/procfile/Procfile +1 -0
  40. data/lib/railsbricks/assets/seeds/devise_email/seeds_no_test_users.rb +11 -0
  41. data/lib/railsbricks/assets/seeds/devise_email/seeds_test_users.rb +24 -0
  42. data/lib/railsbricks/assets/seeds/devise_username/seeds_no_test_users.rb +12 -0
  43. data/lib/railsbricks/assets/seeds/devise_username/seeds_test_users.rb +26 -0
  44. data/lib/railsbricks/assets/stylesheets/application.scss +6 -0
  45. data/lib/railsbricks/assets/stylesheets/railsbricks_custom.scss +562 -0
  46. data/lib/railsbricks/assets/views/admin/base/admin_posts_link.rbr +1 -0
  47. data/lib/railsbricks/assets/views/admin/base/devise_email/index.html.erb +41 -0
  48. data/lib/railsbricks/assets/views/admin/base/devise_username/index.html.erb +41 -0
  49. data/lib/railsbricks/assets/views/admin/posts/_form.html.erb +54 -0
  50. data/lib/railsbricks/assets/views/admin/posts/dashboard.html.erb +9 -0
  51. data/lib/railsbricks/assets/views/admin/posts/drafts.html.erb +23 -0
  52. data/lib/railsbricks/assets/views/admin/posts/edit.html.erb +10 -0
  53. data/lib/railsbricks/assets/views/admin/posts/index.html.erb +23 -0
  54. data/lib/railsbricks/assets/views/admin/posts/new.html.erb +6 -0
  55. data/lib/railsbricks/assets/views/admin/users/devise_email/edit.html.erb +65 -0
  56. data/lib/railsbricks/assets/views/admin/users/devise_email/index.html.erb +54 -0
  57. data/lib/railsbricks/assets/views/admin/users/devise_username/edit.html.erb +74 -0
  58. data/lib/railsbricks/assets/views/admin/users/devise_username/index.html.erb +56 -0
  59. data/lib/railsbricks/assets/views/contact_mailer/contact_message.html.erb +5 -0
  60. data/lib/railsbricks/assets/views/devise/allow_signup_links.rbr +11 -0
  61. data/lib/railsbricks/assets/views/devise/devise_email/confirmations/new.html.erb +31 -0
  62. data/lib/railsbricks/assets/views/devise/devise_email/mailer/confirmation_instructions.html.erb +12 -0
  63. data/lib/railsbricks/assets/views/devise/devise_email/mailer/reset_password_instructions.html.erb +15 -0
  64. data/lib/railsbricks/assets/views/devise/devise_email/passwords/edit.html.erb +43 -0
  65. data/lib/railsbricks/assets/views/devise/devise_email/passwords/new.html.erb +31 -0
  66. data/lib/railsbricks/assets/views/devise/devise_email/registrations/edit.html.erb +63 -0
  67. data/lib/railsbricks/assets/views/devise/devise_email/registrations/new.html.erb +49 -0
  68. data/lib/railsbricks/assets/views/devise/devise_email/sessions/new.html.erb +49 -0
  69. data/lib/railsbricks/assets/views/devise/devise_email/shared/_links.erb +19 -0
  70. data/lib/railsbricks/assets/views/devise/devise_username/confirmations/new.html.erb +31 -0
  71. data/lib/railsbricks/assets/views/devise/devise_username/mailer/confirmation_instructions.html.erb +12 -0
  72. data/lib/railsbricks/assets/views/devise/devise_username/mailer/reset_password_instructions.html.erb +15 -0
  73. data/lib/railsbricks/assets/views/devise/devise_username/passwords/edit.html.erb +43 -0
  74. data/lib/railsbricks/assets/views/devise/devise_username/passwords/new.html.erb +31 -0
  75. data/lib/railsbricks/assets/views/devise/devise_username/registrations/edit.html.erb +63 -0
  76. data/lib/railsbricks/assets/views/devise/devise_username/registrations/new.html.erb +58 -0
  77. data/lib/railsbricks/assets/views/devise/devise_username/sessions/new.html.erb +49 -0
  78. data/lib/railsbricks/assets/views/devise/devise_username/shared/_links.erb +19 -0
  79. data/lib/railsbricks/assets/views/layouts/_navigation_links.html.erb +15 -0
  80. data/lib/railsbricks/assets/views/layouts/brick_analytics.rbr +11 -0
  81. data/lib/railsbricks/assets/views/pages/contact.html.erb +46 -0
  82. data/lib/railsbricks/assets/views/pages/inside.html.erb +4 -0
  83. data/lib/railsbricks/assets/views/pages/posts.html.erb +18 -0
  84. data/lib/railsbricks/assets/views/pages/show_post.html.erb +6 -0
  85. data/lib/railsbricks/auth_builder.rb +147 -0
  86. data/lib/railsbricks/config_helpers.rb +27 -0
  87. data/lib/railsbricks/config_values.rb +14 -0
  88. data/lib/railsbricks/errors.rb +18 -0
  89. data/lib/railsbricks/file_helpers.rb +54 -0
  90. data/lib/railsbricks/foundation/README.md +24 -0
  91. data/lib/railsbricks/foundation/Rakefile +6 -0
  92. data/lib/railsbricks/foundation/app/assets/images/.keep +0 -0
  93. data/lib/railsbricks/foundation/app/assets/images/apple-touch-icon-precomposed.png +0 -0
  94. data/lib/railsbricks/foundation/app/assets/images/apple-touch-icon.png +0 -0
  95. data/lib/railsbricks/foundation/app/assets/images/favicon.ico +0 -0
  96. data/lib/railsbricks/foundation/app/assets/javascripts/application.js +17 -0
  97. data/lib/railsbricks/foundation/app/assets/javascripts/common.js +7 -0
  98. data/lib/railsbricks/foundation/app/controllers/application_controller.rb +5 -0
  99. data/lib/railsbricks/foundation/app/controllers/concerns/.keep +0 -0
  100. data/lib/railsbricks/foundation/app/controllers/pages_controller.rb +7 -0
  101. data/lib/railsbricks/foundation/app/helpers/application_helper.rb +7 -0
  102. data/lib/railsbricks/foundation/app/helpers/email_helper.rb +5 -0
  103. data/lib/railsbricks/foundation/app/mailers/.keep +0 -0
  104. data/lib/railsbricks/foundation/app/models/.keep +0 -0
  105. data/lib/railsbricks/foundation/app/models/concerns/.keep +0 -0
  106. data/lib/railsbricks/foundation/app/views/layouts/_footer.html.erb +18 -0
  107. data/lib/railsbricks/foundation/app/views/layouts/_messages.html.erb +9 -0
  108. data/lib/railsbricks/foundation/app/views/layouts/_navigation.html.erb +18 -0
  109. data/lib/railsbricks/foundation/app/views/layouts/_navigation_links.html.erb +3 -0
  110. data/lib/railsbricks/foundation/app/views/layouts/application.html.erb +38 -0
  111. data/lib/railsbricks/foundation/app/views/pages/home.html.erb +2 -0
  112. data/lib/railsbricks/foundation/bin/bundle +3 -0
  113. data/lib/railsbricks/foundation/bin/rails +4 -0
  114. data/lib/railsbricks/foundation/bin/rake +4 -0
  115. data/lib/railsbricks/foundation/config.ru +4 -0
  116. data/lib/railsbricks/foundation/config/application.rb +34 -0
  117. data/lib/railsbricks/foundation/config/boot.rb +4 -0
  118. data/lib/railsbricks/foundation/config/environment.rb +5 -0
  119. data/lib/railsbricks/foundation/config/environments/development.rb +41 -0
  120. data/lib/railsbricks/foundation/config/environments/production.rb +95 -0
  121. data/lib/railsbricks/foundation/config/environments/test.rb +51 -0
  122. data/lib/railsbricks/foundation/config/initializers/backtrace_silencers.rb +7 -0
  123. data/lib/railsbricks/foundation/config/initializers/date_format.rb +27 -0
  124. data/lib/railsbricks/foundation/config/initializers/filter_parameter_logging.rb +4 -0
  125. data/lib/railsbricks/foundation/config/initializers/friendly_id.rb +88 -0
  126. data/lib/railsbricks/foundation/config/initializers/inflections.rb +16 -0
  127. data/lib/railsbricks/foundation/config/initializers/kaminari_config.rb +10 -0
  128. data/lib/railsbricks/foundation/config/initializers/mime_types.rb +5 -0
  129. data/lib/railsbricks/foundation/config/initializers/secret_token.rb +25 -0
  130. data/lib/railsbricks/foundation/config/initializers/session_store.rb +3 -0
  131. data/lib/railsbricks/foundation/config/initializers/wrap_parameters.rb +14 -0
  132. data/lib/railsbricks/foundation/config/locales/en.yml +23 -0
  133. data/lib/railsbricks/foundation/config/routes.rb +7 -0
  134. data/lib/railsbricks/foundation/db/migrate/20131103142222_create_friendly_id_slugs.rb +15 -0
  135. data/lib/railsbricks/foundation/db/schema.rb +29 -0
  136. data/lib/railsbricks/foundation/db/seeds.rb +0 -0
  137. data/lib/railsbricks/foundation/lib/assets/.keep +0 -0
  138. data/lib/railsbricks/foundation/lib/tasks/.keep +0 -0
  139. data/lib/railsbricks/foundation/public/404.html +58 -0
  140. data/lib/railsbricks/foundation/public/422.html +58 -0
  141. data/lib/railsbricks/foundation/public/500.html +57 -0
  142. data/lib/railsbricks/foundation/public/favicon.ico +0 -0
  143. data/lib/railsbricks/foundation/public/robots.txt +5 -0
  144. data/lib/railsbricks/foundation/vendor/assets/javascripts/.keep +0 -0
  145. data/lib/railsbricks/foundation/vendor/assets/stylesheets/.keep +0 -0
  146. data/lib/railsbricks/gemfile_builder.rb +118 -0
  147. data/lib/railsbricks/menu.rb +533 -0
  148. data/lib/railsbricks/post_builder.rb +103 -0
  149. data/lib/railsbricks/string_helpers.rb +39 -0
  150. data/lib/railsbricks/style_builder.rb +97 -0
  151. data/lib/railsbricks/ui_helpers.rb +11 -0
  152. data/lib/railsbricks/validator.rb +68 -0
  153. data/lib/railsbricks/version.rb +34 -0
  154. data/railsbricks.gemspec +16 -0
  155. metadata +198 -0
@@ -0,0 +1,27 @@
1
+ require 'fileutils'
2
+ require 'json'
3
+
4
+ module ConfigHelpers
5
+
6
+ CONFIG_PATH = ".rbricks"
7
+
8
+ def self.create_config(app_dir, options = {})
9
+ FileUtils::mkdir_p "#{app_dir}/#{CONFIG_PATH}"
10
+ dup_options = options.dup
11
+ dup_options[:email_config][:password] = "******"
12
+ saved_options = dup_options.to_json
13
+
14
+ File.open("#{app_dir}/#{CONFIG_PATH}/config", "w") { |f| f.write(saved_options)}
15
+
16
+ end
17
+
18
+ def self.load_config
19
+ config_json = File.read("#{CONFIG_PATH}/config")
20
+ JSON.parse(config_json)
21
+ rescue
22
+ options = {}
23
+ options["rake_command"] = "rake"
24
+ options
25
+ end
26
+
27
+ end
@@ -0,0 +1,14 @@
1
+ module ConfigValues
2
+
3
+ RAILS_VERSION = "4.2.3"
4
+ ISSUE_PATH = "https://github.com/nicoschuele/railsbricks"
5
+
6
+ def self.rails_version
7
+ RAILS_VERSION
8
+ end
9
+
10
+ def self.issue_path
11
+ ISSUE_PATH
12
+ end
13
+
14
+ end
@@ -0,0 +1,18 @@
1
+ require_relative "string_helpers"
2
+ require_relative "config_values"
3
+
4
+ module Errors
5
+
6
+ def self.display_error(msg, show_issues_url = false)
7
+ puts
8
+ StringHelpers.wputs msg, :error
9
+ puts
10
+
11
+ if show_issues_url
12
+ StringHelpers.wputs "If you can't fix this error, please file an issue report at #{ConfigValues.issue_path}"
13
+ puts
14
+ end
15
+
16
+ end
17
+
18
+ end
@@ -0,0 +1,54 @@
1
+ require "fileutils"
2
+ require_relative "errors"
3
+ module FileHelpers
4
+
5
+ def self.replace_string(key,new_value,original_file,target_file = nil)
6
+ target_file = original_file if target_file == nil
7
+ text_update = File.read(original_file)
8
+ text_update = text_update.gsub(key, new_value)
9
+
10
+ File.open(target_file, "w") { |f| f.write(text_update) }
11
+ rescue
12
+ Errors.display_error "Something went wrong. The file '#{target_file}' couldn't be created and/or updated. Aborting app creation.", true
13
+ abort
14
+ end
15
+
16
+ def self.override_file(source_file, target_file)
17
+ FileUtils.rm(target_file)
18
+ FileUtils.cp(source_file,target_file)
19
+ rescue
20
+ Errors.display_error "Couldn't override #{target_file}. Aborting app creation.", true
21
+ abort
22
+ end
23
+
24
+ def self.add_to_file(target_file, text)
25
+ content = File.read(target_file)
26
+
27
+ File.open(target_file, "a") do |f|
28
+ f.puts
29
+ f.puts
30
+ f.write(text)
31
+
32
+ end
33
+ rescue
34
+ Errors.display_error "Couldn't write inside #{target_file}. Aborting app creation.", true
35
+ abort
36
+ end
37
+
38
+ def self.get_file(template = :none)
39
+ rbricks_dir = File.dirname(__FILE__)
40
+ replacement_text = ""
41
+ case template
42
+ when :brick_contact_controller then replacement_text = File.read(rbricks_dir + "/assets/controllers/brick_contact.rbr")
43
+ when :brick_contact_routes then replacement_text = File.read(rbricks_dir + "/assets/config/contact_routes.rbr")
44
+ when :brick_allow_signup_links then replacement_text = File.read(rbricks_dir + "/assets/views/devise/allow_signup_links.rbr")
45
+ when :brick_analytics then replacement_text = File.read(rbricks_dir + "/assets/views/layouts/brick_analytics.rbr")
46
+ when :brick_post_routes then replacement_text = File.read(rbricks_dir + "/assets/config/post_routes.rbr")
47
+ when :brick_admin_post_routes then replacement_text = File.read(rbricks_dir + "/assets/config/admin_post_routes.rbr")
48
+ when :brick_posts_controller then replacement_text = File.read(rbricks_dir + "/assets/controllers/posts_controller.rbr")
49
+ when :brick_admin_posts_link then replacement_text = File.read(rbricks_dir + "/assets/views/admin/base/admin_posts_link.rbr")
50
+ end
51
+ replacement_text
52
+ end
53
+
54
+ end
@@ -0,0 +1,24 @@
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
+ * ...
@@ -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
+ BRICK_APP_NAME::Application.load_tasks
@@ -0,0 +1,17 @@
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 jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require bootstrap BRICK_ANALYTICS_SCRIPT
17
+ //= require common
@@ -0,0 +1,7 @@
1
+ var ready = function() {
2
+
3
+ }
4
+
5
+
6
+ $(document).ready(ready);
7
+ $(document).on('page:load', ready);
@@ -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,7 @@
1
+ class PagesController < ApplicationController
2
+
3
+ def home
4
+ end
5
+ BRICK_CONTACT_CONTROLLER
6
+
7
+ end
@@ -0,0 +1,7 @@
1
+ module ApplicationHelper
2
+ def title(value)
3
+ unless value.nil?
4
+ @title = "#{value} | BRICK_APP_NAME"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,5 @@
1
+ module EmailHelper
2
+ def line_break(s)
3
+ s.gsub("\n", "<br/>")
4
+ end
5
+ end
File without changes
File without changes
@@ -0,0 +1,18 @@
1
+ <div id="footer">
2
+ <div class="container">
3
+
4
+ <div class="row footer-first-row">
5
+
6
+ <div class="col-xs-12 text-center">
7
+ <p><small>
8
+ &copy; <%= Time.now.year %> - Yourself!
9
+ <br/>
10
+ Assembled with <%= link_to "RailsBricks", "http://www.railsbricks.net" %>
11
+ </small></p>
12
+ </div>
13
+
14
+ </div>
15
+
16
+ </div>
17
+ </div>
18
+ BRICK_ANALYTICS
@@ -0,0 +1,9 @@
1
+ <%# Rails flash messages styled for Bootstrap 3.0 %>
2
+ <% flash.each do |name, msg| %>
3
+ <% if msg.is_a?(String) %>
4
+ <div class="alert alert-<%= name == "notice" ? "success" : "danger" %>">
5
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
6
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
7
+ </div>
8
+ <% end %>
9
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <nav class="navbar BRICK_NAVBAR_COLOR">
2
+ <div class="container">
3
+ <div class="navbar-header">
4
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
5
+ <span class="sr-only">Toggle navigation</span>
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ <span class="icon-bar"></span>
9
+ </button>
10
+ <%= link_to 'Home', root_path, class: 'navbar-brand' %>
11
+ </div>
12
+ <div class="collapse navbar-collapse">
13
+ <ul class="nav navbar-nav">
14
+ <%= render 'layouts/navigation_links' %>
15
+ </ul>
16
+ </div>
17
+ </div>
18
+ </nav>
@@ -0,0 +1,3 @@
1
+ <li><%= link_to "Link 1", "#" %></li>
2
+ <li><%= link_to "Link 2", "#" %></li>
3
+ BRICK_CONTACT
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
5
+ <title><%= @title || "BRICK_APP_NAME" %></title>
6
+ <%= favicon_link_tag 'favicon.ico' %>
7
+ <%= favicon_link_tag 'apple-touch-icon.png', rel: 'apple-touch-icon', type: 'image/png' %>
8
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
9
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
10
+ <%= csrf_meta_tags %>
11
+ </head>
12
+ <body>
13
+ <div id="wrap">
14
+ <header>
15
+ <%= render 'layouts/navigation' %>
16
+ </header>
17
+
18
+ <div class="container">
19
+
20
+ <div class="row">
21
+ <div class="col-sm-6 col-sm-offset-3 text-center">
22
+ <%= render 'layouts/messages' %>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="row">
27
+ <div class="col-sm-12">
28
+ <%= yield %>
29
+ </div>
30
+ </div>
31
+
32
+ </div>
33
+ </div>
34
+
35
+ <%= render 'layouts/footer' %>
36
+
37
+ </body>
38
+ </html>
@@ -0,0 +1,2 @@
1
+ <% title("Home Page") %>
2
+ <h1><i class="fa fa-home"></i> Home Page <small>views/pages/home.html.erb</small></h1>
@@ -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,34 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env)
8
+
9
+ module BRICK_APP_NAME
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ # turn off warnings triggered by friendly_id
24
+ I18n.enforce_available_locales = false
25
+
26
+ # Test framework
27
+ config.generators.test_framework false
28
+
29
+ # autoload lib path
30
+ config.autoload_paths += %W(#{config.root}/lib)
31
+ config.autoload_paths += Dir["#{config.root}/lib/**/"]
32
+
33
+ end
34
+ 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,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ BRICK_APP_NAME::Application.initialize!
@@ -0,0 +1,41 @@
1
+ BRICK_APP_NAME::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
+ # Print deprecation notices to the Rails logger.
17
+ config.active_support.deprecation = :log
18
+
19
+ # Raise an error on page load if there are pending migrations
20
+ config.active_record.migration_error = :page_load
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
+ # Mailer
28
+ config.action_mailer.raise_delivery_errors = true
29
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
30
+ config.action_mailer.delivery_method = :smtp
31
+ config.action_mailer.smtp_settings = {
32
+ address: ENV["SMTP_SERVER"],
33
+ openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE,
34
+ port: ENV["SMTP_PORT"].to_i,
35
+ domain: ENV["MAILER_DOMAIN"],
36
+ authentication: "plain",
37
+ enable_starttls_auto: true,
38
+ user_name: ENV["SMTP_USER"],
39
+ password: ENV["SMTP_PWD"]
40
+ }
41
+ end