mongoid-forums 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +35 -0
  4. data/app/assets/javascripts/mongoid_forums/admin/base.js +2 -0
  5. data/app/assets/javascripts/mongoid_forums/admin/categories.js +2 -0
  6. data/app/assets/javascripts/mongoid_forums/admin/forums.js +2 -0
  7. data/app/assets/javascripts/mongoid_forums/application.js +13 -0
  8. data/app/assets/javascripts/mongoid_forums/forums.js +2 -0
  9. data/app/assets/javascripts/mongoid_forums/posts.js +2 -0
  10. data/app/assets/javascripts/mongoid_forums/topics.js +2 -0
  11. data/app/assets/stylesheets/mongoid_forums/admin/base.css +4 -0
  12. data/app/assets/stylesheets/mongoid_forums/admin/categories.css +4 -0
  13. data/app/assets/stylesheets/mongoid_forums/admin/forums.css +4 -0
  14. data/app/assets/stylesheets/mongoid_forums/application.css +15 -0
  15. data/app/assets/stylesheets/mongoid_forums/forums.css +4 -0
  16. data/app/assets/stylesheets/mongoid_forums/posts.css +4 -0
  17. data/app/assets/stylesheets/mongoid_forums/topics.css +4 -0
  18. data/app/assets/stylesheets/scaffold.css +56 -0
  19. data/app/controllers/mongoid_forums/admin/base_controller.rb +11 -0
  20. data/app/controllers/mongoid_forums/admin/categories_controller.rb +36 -0
  21. data/app/controllers/mongoid_forums/admin/forums_controller.rb +36 -0
  22. data/app/controllers/mongoid_forums/application_controller.rb +45 -0
  23. data/app/controllers/mongoid_forums/forums_controller.rb +57 -0
  24. data/app/controllers/mongoid_forums/posts_controller.rb +75 -0
  25. data/app/controllers/mongoid_forums/redirect_controller.rb +33 -0
  26. data/app/controllers/mongoid_forums/topics_controller.rb +84 -0
  27. data/app/helpers/mongoid_forums/admin/base_helper.rb +4 -0
  28. data/app/helpers/mongoid_forums/admin/categories_helper.rb +4 -0
  29. data/app/helpers/mongoid_forums/admin/forums_helper.rb +4 -0
  30. data/app/helpers/mongoid_forums/application_helper.rb +20 -0
  31. data/app/helpers/mongoid_forums/formatting_helper.rb +28 -0
  32. data/app/helpers/mongoid_forums/forums_helper.rb +15 -0
  33. data/app/helpers/mongoid_forums/posts_helper.rb +4 -0
  34. data/app/helpers/mongoid_forums/topics_helper.rb +4 -0
  35. data/app/models/mongoid_forums/alert.rb +80 -0
  36. data/app/models/mongoid_forums/category.rb +13 -0
  37. data/app/models/mongoid_forums/concerns/subscribable.rb +76 -0
  38. data/app/models/mongoid_forums/concerns/viewable.rb +60 -0
  39. data/app/models/mongoid_forums/forum.rb +42 -0
  40. data/app/models/mongoid_forums/permission.rb +95 -0
  41. data/app/models/mongoid_forums/post.rb +37 -0
  42. data/app/models/mongoid_forums/rank.rb +9 -0
  43. data/app/models/mongoid_forums/subscription.rb +66 -0
  44. data/app/models/mongoid_forums/topic.rb +45 -0
  45. data/app/models/mongoid_forums/view.rb +30 -0
  46. data/app/views/layouts/mongoid_forums/application.haml +21 -0
  47. data/app/views/mongoid_forums/admin/base/index.haml +4 -0
  48. data/app/views/mongoid_forums/admin/categories/edit.html.erb +2 -0
  49. data/app/views/mongoid_forums/admin/categories/new.haml +3 -0
  50. data/app/views/mongoid_forums/admin/forums/edit.html.erb +2 -0
  51. data/app/views/mongoid_forums/admin/forums/new.haml +4 -0
  52. data/app/views/mongoid_forums/forums/index.haml +43 -0
  53. data/app/views/mongoid_forums/forums/new.haml +15 -0
  54. data/app/views/mongoid_forums/forums/show.haml +43 -0
  55. data/app/views/mongoid_forums/posts/_form.haml +4 -0
  56. data/app/views/mongoid_forums/posts/_post.haml +20 -0
  57. data/app/views/mongoid_forums/posts/_quoted.haml +9 -0
  58. data/app/views/mongoid_forums/posts/edit.haml +17 -0
  59. data/app/views/mongoid_forums/posts/new.haml +17 -0
  60. data/app/views/mongoid_forums/topics/_topic.haml +2 -0
  61. data/app/views/mongoid_forums/topics/my_posts.haml +6 -0
  62. data/app/views/mongoid_forums/topics/my_subscriptions.haml +5 -0
  63. data/app/views/mongoid_forums/topics/my_topics.haml +6 -0
  64. data/app/views/mongoid_forums/topics/show.haml +12 -0
  65. data/config/routes.rb +40 -0
  66. data/lib/generators/mongoid_forums/install/templates/initializer.rb +5 -0
  67. data/lib/generators/mongoid_forums/install_generator.rb +101 -0
  68. data/lib/generators/mongoid_forums/views_generator.rb +27 -0
  69. data/lib/mongoid_forums/engine.rb +15 -0
  70. data/lib/mongoid_forums/sanitizer.rb +10 -0
  71. data/lib/mongoid_forums/version.rb +3 -0
  72. data/lib/mongoid_forums.rb +40 -0
  73. data/lib/tasks/mongoid_forums_tasks.rake +4 -0
  74. data/test/controllers/mongoid_forums/admin/base_controller_test.rb +11 -0
  75. data/test/controllers/mongoid_forums/admin/categories_controller_test.rb +31 -0
  76. data/test/controllers/mongoid_forums/admin/forums_controller_test.rb +31 -0
  77. data/test/controllers/mongoid_forums/forums_controller_test.rb +16 -0
  78. data/test/controllers/mongoid_forums/posts_controller_test.rb +36 -0
  79. data/test/controllers/mongoid_forums/topics_controller_test.rb +36 -0
  80. data/test/dummy/README.rdoc +28 -0
  81. data/test/dummy/Rakefile +6 -0
  82. data/test/dummy/app/assets/javascripts/application.js +13 -0
  83. data/test/dummy/app/assets/javascripts/welcome.js +2 -0
  84. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  85. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  86. data/test/dummy/app/assets/stylesheets/welcome.css +4 -0
  87. data/test/dummy/app/controllers/application_controller.rb +11 -0
  88. data/test/dummy/app/controllers/welcome_controller.rb +4 -0
  89. data/test/dummy/app/helpers/application_helper.rb +2 -0
  90. data/test/dummy/app/helpers/welcome_helper.rb +2 -0
  91. data/test/dummy/app/models/concerns/zero_oid_fix.rb +10 -0
  92. data/test/dummy/app/models/user.rb +43 -0
  93. data/test/dummy/app/views/layouts/application.haml +13 -0
  94. data/test/dummy/app/views/partials/_nav.haml +6 -0
  95. data/test/dummy/app/views/welcome/index.html.erb +2 -0
  96. data/test/dummy/bin/bundle +3 -0
  97. data/test/dummy/bin/rails +4 -0
  98. data/test/dummy/bin/rake +4 -0
  99. data/test/dummy/bin/setup +29 -0
  100. data/test/dummy/config/application.rb +29 -0
  101. data/test/dummy/config/boot.rb +5 -0
  102. data/test/dummy/config/environment.rb +5 -0
  103. data/test/dummy/config/environments/development.rb +41 -0
  104. data/test/dummy/config/environments/production.rb +76 -0
  105. data/test/dummy/config/environments/test.rb +42 -0
  106. data/test/dummy/config/initializers/assets.rb +11 -0
  107. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  108. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  109. data/test/dummy/config/initializers/devise.rb +259 -0
  110. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  111. data/test/dummy/config/initializers/inflections.rb +16 -0
  112. data/test/dummy/config/initializers/kaminari_config.rb +10 -0
  113. data/test/dummy/config/initializers/mime_types.rb +4 -0
  114. data/test/dummy/config/initializers/mongoid_forums.rb +5 -0
  115. data/test/dummy/config/initializers/session_store.rb +3 -0
  116. data/test/dummy/config/initializers/simple_form.rb +166 -0
  117. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  118. data/test/dummy/config/locales/devise.en.yml +60 -0
  119. data/test/dummy/config/locales/en.yml +23 -0
  120. data/test/dummy/config/locales/simple_form.en.yml +31 -0
  121. data/test/dummy/config/mongoid.yml +69 -0
  122. data/test/dummy/config/routes.rb +8 -0
  123. data/test/dummy/config/secrets.yml +22 -0
  124. data/test/dummy/config.ru +4 -0
  125. data/test/dummy/lib/templates/erb/scaffold/_form.html.erb +13 -0
  126. data/test/dummy/log/development.log +152624 -0
  127. data/test/dummy/log/test.log +51 -0
  128. data/test/dummy/public/404.html +67 -0
  129. data/test/dummy/public/422.html +67 -0
  130. data/test/dummy/public/500.html +66 -0
  131. data/test/dummy/public/favicon.ico +0 -0
  132. data/test/dummy/test/controllers/welcome_controller_test.rb +9 -0
  133. data/test/dummy/test/fixtures/users.yml +11 -0
  134. data/test/dummy/test/models/user_test.rb +7 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/0405ebcb982faa24d5a9bbe01ba43bf8 +0 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/04b994ecf135576af395f1d87108f0e1 +0 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/0532538bff94834533de08d16379c66f +0 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/063d0c765cb2fe0a6fa3995059d65fcc +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/0a395daf2ed2bad0174008f223997c21 +0 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/0a4181c6e19406e1c40781394b0f7496 +0 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/0f520169da88dbfbdd5b5f40cb5acc80 +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/1b516e1e4f37dd27b32d035c2c825de7 +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/1d1293f6abfd57a3035ab25a567fe43e +0 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/25a167c7563d6fe8ec6b13ec1ac09274 +0 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/268f4f56598234185d91373d61899b3f +0 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/26ce0653a8cb3da5990ace16181dbd63 +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/2dedb8177c20286c4259c1d58c5646cc +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/2fda08fb2ff79ca1dd653c3b688c1651 +0 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/30d0258c36708f3d7911d6ba2303aaad +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/311da47a66243f663a4557a7e9997796 +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  155. data/test/dummy/tmp/cache/assets/development/sprockets/37b103f4623089af1456b90830fe941c +0 -0
  156. data/test/dummy/tmp/cache/assets/development/sprockets/37f7e269b2ddbd05160232e59bf0288f +0 -0
  157. data/test/dummy/tmp/cache/assets/development/sprockets/408e554cb00cbb09ae89a1e7ac45ea4f +0 -0
  158. data/test/dummy/tmp/cache/assets/development/sprockets/41f10e590485de7db44ca61e32c135ea +0 -0
  159. data/test/dummy/tmp/cache/assets/development/sprockets/45e716730a5c02112d5817e1b8faa1a0 +0 -0
  160. data/test/dummy/tmp/cache/assets/development/sprockets/4acd6b11130459cfdf814caad7638e95 +0 -0
  161. data/test/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  162. data/test/dummy/tmp/cache/assets/development/sprockets/60f651a96095c10f531bd7bf9a14beb5 +0 -0
  163. data/test/dummy/tmp/cache/assets/development/sprockets/6b12ee5284cadf70954a584a88b6c529 +0 -0
  164. data/test/dummy/tmp/cache/assets/development/sprockets/6be29bb8e609ed29aaa3a6d4a04a9ae0 +0 -0
  165. data/test/dummy/tmp/cache/assets/development/sprockets/6cef1e9aec64b514669e261e511dc792 +0 -0
  166. data/test/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  167. data/test/dummy/tmp/cache/assets/development/sprockets/76dc342539f7133a15b70b919f77425a +0 -0
  168. data/test/dummy/tmp/cache/assets/development/sprockets/873adae1bf2f532256c8ffe71a557df5 +0 -0
  169. data/test/dummy/tmp/cache/assets/development/sprockets/8d7f8b5066922abfdf12e8cf0a7f2f0e +0 -0
  170. data/test/dummy/tmp/cache/assets/development/sprockets/948b1a4ef7d3401c10fc537c40b56a1e +0 -0
  171. data/test/dummy/tmp/cache/assets/development/sprockets/99d8deee7a422780b297ca618f4062c8 +0 -0
  172. data/test/dummy/tmp/cache/assets/development/sprockets/9d4262e6cd4898fd1df7f51b2d3e5c92 +0 -0
  173. data/test/dummy/tmp/cache/assets/development/sprockets/9e611bdf180a46600cc5019392a1b561 +0 -0
  174. data/test/dummy/tmp/cache/assets/development/sprockets/ab4dfca9c17bc07c2fce0127b5d9669f +0 -0
  175. data/test/dummy/tmp/cache/assets/development/sprockets/af01a98a48fa1ebf1d65f0429ba2bb28 +0 -0
  176. data/test/dummy/tmp/cache/assets/development/sprockets/bc0c996f7ce50479170183c13af2d29d +0 -0
  177. data/test/dummy/tmp/cache/assets/development/sprockets/beeaeba29291235e532fb452d94795b3 +0 -0
  178. data/test/dummy/tmp/cache/assets/development/sprockets/cc040cf4f4539a12745d02867976f5ba +0 -0
  179. data/test/dummy/tmp/cache/assets/development/sprockets/ce30207f8949b0e3a822f6094bd31dcc +0 -0
  180. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  181. data/test/dummy/tmp/cache/assets/development/sprockets/d675d8a6b14078d1fc331870b4992050 +0 -0
  182. data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  183. data/test/dummy/tmp/cache/assets/development/sprockets/daba24276ab6f3be739a0385f977df1c +0 -0
  184. data/test/dummy/tmp/cache/assets/development/sprockets/df5f9fbb250c939b0513aa2a35b4855b +0 -0
  185. data/test/dummy/tmp/cache/assets/development/sprockets/e22980ed174c68b2505214836a40e271 +0 -0
  186. data/test/dummy/tmp/cache/assets/development/sprockets/e2c4f946939f2d7d0b42d86383755cae +0 -0
  187. data/test/dummy/tmp/cache/assets/development/sprockets/e6a87270f3b0e8a73bcec17322694b61 +0 -0
  188. data/test/dummy/tmp/cache/assets/development/sprockets/e95bb3887fb84a7d966c0fc7c4e087fd +0 -0
  189. data/test/dummy/tmp/cache/assets/development/sprockets/eaa7a7fe023d19cd34c33a47e6b303f3 +0 -0
  190. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  191. data/test/dummy/tmp/cache/assets/development/sprockets/f91f775cd15edae9264ec0c23937c58b +0 -0
  192. data/test/fixtures/mongoid_forums/categories.yml +11 -0
  193. data/test/fixtures/mongoid_forums/forums.yml +11 -0
  194. data/test/fixtures/mongoid_forums/posts.yml +11 -0
  195. data/test/fixtures/mongoid_forums/ranks.yml +11 -0
  196. data/test/fixtures/mongoid_forums/topics.yml +11 -0
  197. data/test/integration/navigation_test.rb +9 -0
  198. data/test/models/mongoid_forums/category_test.rb +9 -0
  199. data/test/models/mongoid_forums/forum_test.rb +9 -0
  200. data/test/models/mongoid_forums/post_test.rb +9 -0
  201. data/test/models/mongoid_forums/rank_test.rb +9 -0
  202. data/test/models/mongoid_forums/topic_test.rb +9 -0
  203. data/test/mongoid_forums_test.rb +7 -0
  204. data/test/test_helper.rb +17 -0
  205. metadata +491 -0
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,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,11 @@
1
+ class ApplicationController < ActionController::Base
2
+
3
+ def mongoid_forums_user
4
+ current_user
5
+ end
6
+ helper_method :mongoid_forums_user
7
+
8
+ # Prevent CSRF attacks by raising an exception.
9
+ # For APIs, you may want to use :null_session instead.
10
+ protect_from_forgery with: :exception
11
+ end
@@ -0,0 +1,4 @@
1
+ class WelcomeController < ApplicationController
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module WelcomeHelper
2
+ end
@@ -0,0 +1,10 @@
1
+ module ZeroOidFix
2
+ extend ActiveSupport::Concern
3
+
4
+ module ClassMethods
5
+ def serialize_from_session(key, salt)
6
+ record = to_adapter.get((key[0]["$oid"] rescue nil))
7
+ record if record && record.authenticatable_salt == salt
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,43 @@
1
+ class User
2
+ include Mongoid::Document
3
+ # Include default devise modules. Others available are:
4
+ # :confirmable, :lockable, :timeoutable and :omniauthable
5
+ devise :database_authenticatable, :registerable,
6
+ :recoverable, :rememberable, :trackable, :validatable
7
+
8
+ include ZeroOidFix
9
+
10
+
11
+ ## Database authenticatable
12
+ field :email, type: String, default: ""
13
+ field :encrypted_password, type: String, default: ""
14
+
15
+ ## Recoverable
16
+ field :reset_password_token, type: String
17
+ field :reset_password_sent_at, type: Time
18
+
19
+ ## Rememberable
20
+ field :remember_created_at, type: Time
21
+
22
+ ## Trackable
23
+ field :sign_in_count, type: Integer, default: 0
24
+ field :current_sign_in_at, type: Time
25
+ field :last_sign_in_at, type: Time
26
+ field :current_sign_in_ip, type: String
27
+ field :last_sign_in_ip, type: String
28
+
29
+ ## Confirmable
30
+ # field :confirmation_token, type: String
31
+ # field :confirmed_at, type: Time
32
+ # field :confirmation_sent_at, type: Time
33
+ # field :unconfirmed_email, type: String # Only if using reconfirmable
34
+
35
+ ## Lockable
36
+ # field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
37
+ # field :unlock_token, type: String # Only if unlock strategy is :email or :both
38
+ # field :locked_at, type: Time
39
+
40
+ def to_s
41
+ email
42
+ end
43
+ end
@@ -0,0 +1,13 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %title Dummy
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
+ %body
9
+ = render "partials/nav"
10
+ - flash.each do |name, msg|
11
+ = content_tag :p, msg if msg.is_a?(String)
12
+
13
+ = yield
@@ -0,0 +1,6 @@
1
+ - if user_signed_in?
2
+ Signed in as
3
+ = current_user.email
4
+ = link_to "Sign Out", destroy_user_session_path
5
+ - else
6
+ = link_to "Login", new_user_session_path
@@ -0,0 +1,2 @@
1
+ <h1>Welcome#index</h1>
2
+ <p>Find me in app/views/welcome/index.html.erb</p>
@@ -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,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ # require "active_record/railtie"
5
+ require "action_view/railtie"
6
+ require "sprockets/railtie"
7
+ require "action_controller/railtie"
8
+ require "action_mailer/railtie"
9
+ require "rails/test_unit/railtie"
10
+ require "sprockets/railtie" # Uncomment this line for Rails 3.1+
11
+
12
+ Bundler.require(*Rails.groups)
13
+ require "mongoid_forums"
14
+ require "kaminari" # TODO: Generator should do this
15
+ module Dummy
16
+ class Application < Rails::Application
17
+ # Settings in config/environments/* take precedence over those specified here.
18
+ # Application configuration should go into files in config/initializers
19
+ # -- all .rb files in that directory are automatically loaded.
20
+
21
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
22
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
23
+ # config.time_zone = 'Central Time (US & Canada)'
24
+
25
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
26
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
27
+ # config.i18n.default_locale = :de
28
+ end
29
+ end
@@ -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,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,41 @@
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
+ # Devise
37
+ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
41
+ end
@@ -0,0 +1,76 @@
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
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+ end
@@ -0,0 +1,42 @@
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
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json