kublog 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (184) hide show
  1. data/.gitignore +9 -0
  2. data/Gemfile +8 -0
  3. data/Gemfile.lock +177 -0
  4. data/MIT-LICENSE +20 -0
  5. data/README.rdoc +102 -0
  6. data/Rakefile +39 -0
  7. data/app/assets/images/kublog/.gitkeep +0 -0
  8. data/app/assets/images/kublog/missing_image.png +0 -0
  9. data/app/assets/javascripts/kublog/application.js +13 -0
  10. data/app/assets/javascripts/kublog/categories.js.coffee +48 -0
  11. data/app/assets/javascripts/kublog/comments.js.coffee +30 -0
  12. data/app/assets/javascripts/kublog/email.js.coffee +32 -0
  13. data/app/assets/javascripts/kublog/images.js.coffee +77 -0
  14. data/app/assets/javascripts/kublog/posts.js.coffee +44 -0
  15. data/app/assets/javascripts/kublog/shared.js.coffee.erb +19 -0
  16. data/app/assets/javascripts/kublog/wysiwyg.controls.js.coffee +68 -0
  17. data/app/assets/plugins/kublog/ajaxyupload/images/ajax-loader.gif +0 -0
  18. data/app/assets/plugins/kublog/ajaxyupload/javascripts/jquery.ajaxyupload.js +126 -0
  19. data/app/assets/plugins/kublog/fancybox/images/blank.gif +0 -0
  20. data/app/assets/plugins/kublog/fancybox/images/fancy_close.png +0 -0
  21. data/app/assets/plugins/kublog/fancybox/images/fancy_loading.png +0 -0
  22. data/app/assets/plugins/kublog/fancybox/images/fancy_nav_left.png +0 -0
  23. data/app/assets/plugins/kublog/fancybox/images/fancy_nav_right.png +0 -0
  24. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_e.png +0 -0
  25. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_n.png +0 -0
  26. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_ne.png +0 -0
  27. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_nw.png +0 -0
  28. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_s.png +0 -0
  29. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_se.png +0 -0
  30. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_sw.png +0 -0
  31. data/app/assets/plugins/kublog/fancybox/images/fancy_shadow_w.png +0 -0
  32. data/app/assets/plugins/kublog/fancybox/images/fancy_title_left.png +0 -0
  33. data/app/assets/plugins/kublog/fancybox/images/fancy_title_main.png +0 -0
  34. data/app/assets/plugins/kublog/fancybox/images/fancy_title_over.png +0 -0
  35. data/app/assets/plugins/kublog/fancybox/images/fancy_title_right.png +0 -0
  36. data/app/assets/plugins/kublog/fancybox/images/fancybox-x.png +0 -0
  37. data/app/assets/plugins/kublog/fancybox/images/fancybox-y.png +0 -0
  38. data/app/assets/plugins/kublog/fancybox/images/fancybox.png +0 -0
  39. data/app/assets/plugins/kublog/fancybox/javascripts/fancybox-1.3.4.js +46 -0
  40. data/app/assets/plugins/kublog/fancybox/stylesheets/fancybox-1.3.4.css +359 -0
  41. data/app/assets/plugins/kublog/livequery/javascripts/jquery.livequery.js +250 -0
  42. data/app/assets/plugins/kublog/wysiwyg/images/ajax-loader.gif +0 -0
  43. data/app/assets/plugins/kublog/wysiwyg/images/jquery.wysiwyg.bg.png +0 -0
  44. data/app/assets/plugins/kublog/wysiwyg/images/jquery.wysiwyg.gif +0 -0
  45. data/app/assets/plugins/kublog/wysiwyg/images/jquery.wysiwyg.jpg +0 -0
  46. data/app/assets/plugins/kublog/wysiwyg/images/jquery.wysiwyg.no-alpha.gif +0 -0
  47. data/app/assets/plugins/kublog/wysiwyg/javascripts/jquery.wysiwyg.js +2377 -0
  48. data/app/assets/plugins/kublog/wysiwyg/javascripts/wysiwyg.image.js +284 -0
  49. data/app/assets/plugins/kublog/wysiwyg/javascripts/wysiwyg.link.js +249 -0
  50. data/app/assets/plugins/kublog/wysiwyg/stylesheets/jquery.wysiwyg.css +94 -0
  51. data/app/assets/stylesheets/kublog/application.css +9 -0
  52. data/app/assets/stylesheets/kublog/categories.css +4 -0
  53. data/app/assets/stylesheets/kublog/comments.css +4 -0
  54. data/app/assets/stylesheets/kublog/email.css +7 -0
  55. data/app/assets/stylesheets/kublog/images.css +41 -0
  56. data/app/assets/stylesheets/kublog/posts.css +39 -0
  57. data/app/controllers/kublog/application_controller.rb +12 -0
  58. data/app/controllers/kublog/categories_controller.rb +47 -0
  59. data/app/controllers/kublog/comments_controller.rb +37 -0
  60. data/app/controllers/kublog/images_controller.rb +44 -0
  61. data/app/controllers/kublog/posts_controller.rb +66 -0
  62. data/app/helpers/kublog/application_helper.rb +4 -0
  63. data/app/helpers/kublog/posts_helper.rb +38 -0
  64. data/app/mailers/kublog/post_mailer.rb +11 -0
  65. data/app/models/kublog/category.rb +26 -0
  66. data/app/models/kublog/comment.rb +46 -0
  67. data/app/models/kublog/image.rb +23 -0
  68. data/app/models/kublog/post.rb +51 -0
  69. data/app/presenters/kublog/post_presenter.rb +23 -0
  70. data/app/presenters/kublog/posts_presenter.rb +29 -0
  71. data/app/uploaders/kublog/file_uploader.rb +56 -0
  72. data/app/views/kublog/post_mailer/new_post.html.erb +1 -0
  73. data/app/views/kublog/post_mailer/new_post.liquid.html.erb +7 -0
  74. data/app/views/kublog/posts/_email_form.html.erb +13 -0
  75. data/app/views/kublog/posts/_form.html.erb +71 -0
  76. data/app/views/kublog/posts/_image_form.html.erb +26 -0
  77. data/app/views/kublog/posts/edit.html.erb +3 -0
  78. data/app/views/kublog/posts/index.atom.builder +15 -0
  79. data/app/views/kublog/posts/index.html.erb +36 -0
  80. data/app/views/kublog/posts/new.html.erb +3 -0
  81. data/app/views/kublog/posts/show.html.erb +46 -0
  82. data/app/views/layouts/kublog/application.html.erb +14 -0
  83. data/config/locales/kublog/en.yml +54 -0
  84. data/config/routes.rb +13 -0
  85. data/db/migrate/20110816211552_create_kublog_posts.rb +27 -0
  86. data/db/migrate/20110817215828_create_kublog_images.rb +11 -0
  87. data/db/migrate/20110818181434_create_kublog_categories.rb +11 -0
  88. data/db/migrate/20110822194341_create_kublog_comments.rb +14 -0
  89. data/kublog.gemspec +39 -0
  90. data/lib/kublog.rb +92 -0
  91. data/lib/kublog/author.rb +13 -0
  92. data/lib/kublog/engine.rb +5 -0
  93. data/lib/kublog/notifiable.rb +26 -0
  94. data/lib/kublog/notification/email.rb +86 -0
  95. data/lib/kublog/notification/email_job.rb +14 -0
  96. data/lib/kublog/notification/fb_post.rb +43 -0
  97. data/lib/kublog/notification/fb_post_job.rb +16 -0
  98. data/lib/kublog/notification/tweet.rb +68 -0
  99. data/lib/kublog/notification/tweet_job.rb +16 -0
  100. data/lib/kublog/user_integration/common.rb +31 -0
  101. data/lib/kublog/user_integration/devise.rb +23 -0
  102. data/lib/kublog/version.rb +3 -0
  103. data/lib/kublog/xhr_upload/file_helper.rb +36 -0
  104. data/lib/tasks/kublog_tasks.rake +4 -0
  105. data/script/rails +6 -0
  106. data/test/dummy/Rakefile +7 -0
  107. data/test/dummy/app/assets/javascripts/application.js +9 -0
  108. data/test/dummy/app/assets/javascripts/sessions.js +2 -0
  109. data/test/dummy/app/assets/javascripts/users.js +2 -0
  110. data/test/dummy/app/assets/stylesheets/application.css +157 -0
  111. data/test/dummy/app/assets/stylesheets/sessions.css +4 -0
  112. data/test/dummy/app/assets/stylesheets/users.css +4 -0
  113. data/test/dummy/app/controllers/application_controller.rb +19 -0
  114. data/test/dummy/app/controllers/sessions_controller.rb +22 -0
  115. data/test/dummy/app/controllers/users_controller.rb +17 -0
  116. data/test/dummy/app/helpers/application_helper.rb +2 -0
  117. data/test/dummy/app/helpers/error_messages_helper.rb +23 -0
  118. data/test/dummy/app/helpers/layout_helper.rb +22 -0
  119. data/test/dummy/app/helpers/sessions_helper.rb +2 -0
  120. data/test/dummy/app/helpers/users_helper.rb +2 -0
  121. data/test/dummy/app/mailers/.gitkeep +0 -0
  122. data/test/dummy/app/models/.gitkeep +0 -0
  123. data/test/dummy/app/models/ability.rb +2 -0
  124. data/test/dummy/app/models/user.rb +25 -0
  125. data/test/dummy/app/views/layouts/_account.html.erb +8 -0
  126. data/test/dummy/app/views/layouts/application.html.erb +29 -0
  127. data/test/dummy/app/views/layouts/kublog/application.html.erb +31 -0
  128. data/test/dummy/app/views/sessions/new.html.erb +15 -0
  129. data/test/dummy/app/views/users/new.html.erb +28 -0
  130. data/test/dummy/config.ru +4 -0
  131. data/test/dummy/config/application.rb +42 -0
  132. data/test/dummy/config/boot.rb +10 -0
  133. data/test/dummy/config/database.yml +25 -0
  134. data/test/dummy/config/environment.rb +5 -0
  135. data/test/dummy/config/environments/development.rb +38 -0
  136. data/test/dummy/config/environments/production.rb +51 -0
  137. data/test/dummy/config/environments/test.rb +39 -0
  138. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  139. data/test/dummy/config/initializers/inflections.rb +10 -0
  140. data/test/dummy/config/initializers/mime_types.rb +5 -0
  141. data/test/dummy/config/initializers/secret_token.rb +7 -0
  142. data/test/dummy/config/initializers/session_store.rb +8 -0
  143. data/test/dummy/config/initializers/wrap_parameters.rb +12 -0
  144. data/test/dummy/config/locales/en.yml +54 -0
  145. data/test/dummy/config/routes.rb +13 -0
  146. data/test/dummy/db/migrate/20110816225222_create_users.rb +11 -0
  147. data/test/dummy/db/migrate/20110819135547_create_delayed_jobs.rb +21 -0
  148. data/test/dummy/db/schema.rb +96 -0
  149. data/test/dummy/lib/assets/.gitkeep +0 -0
  150. data/test/dummy/log/.gitkeep +0 -0
  151. data/test/dummy/public/404.html +26 -0
  152. data/test/dummy/public/422.html +26 -0
  153. data/test/dummy/public/500.html +26 -0
  154. data/test/dummy/public/favicon.ico +0 -0
  155. data/test/dummy/script/delayed_job +5 -0
  156. data/test/dummy/script/rails +6 -0
  157. data/test/dummy/test/fixtures/users.yml +9 -0
  158. data/test/dummy/test/functional/sessions_controller_test.rb +7 -0
  159. data/test/dummy/test/functional/users_controller_test.rb +7 -0
  160. data/test/dummy/test/unit/helpers/sessions_helper_test.rb +4 -0
  161. data/test/dummy/test/unit/helpers/users_helper_test.rb +4 -0
  162. data/test/dummy/test/unit/user_test.rb +7 -0
  163. data/test/factories.rb +9 -0
  164. data/test/fixtures/kublog/categories.yml +7 -0
  165. data/test/fixtures/kublog/comments.yml +7 -0
  166. data/test/fixtures/kublog/images.yml +9 -0
  167. data/test/fixtures/kublog/posts.yml +9 -0
  168. data/test/functional/kublog/categories_controller_test.rb +9 -0
  169. data/test/functional/kublog/comments_controller_test.rb +9 -0
  170. data/test/functional/kublog/images_controller_test.rb +9 -0
  171. data/test/functional/kublog/post_mailer_test.rb +9 -0
  172. data/test/functional/kublog/posts_controller_test.rb +9 -0
  173. data/test/integration/navigation_test.rb +10 -0
  174. data/test/kublog_test.rb +7 -0
  175. data/test/test_helper.rb +12 -0
  176. data/test/unit/helpers/kublog/categories_helper_test.rb +6 -0
  177. data/test/unit/helpers/kublog/comments_helper_test.rb +6 -0
  178. data/test/unit/helpers/kublog/images_helper_test.rb +6 -0
  179. data/test/unit/helpers/kublog/posts_helper_test.rb +6 -0
  180. data/test/unit/kublog/category_test.rb +9 -0
  181. data/test/unit/kublog/comment_test.rb +9 -0
  182. data/test/unit/kublog/image_test.rb +9 -0
  183. data/test/unit/kublog/post_test.rb +19 -0
  184. metadata +439 -0
@@ -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,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,19 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+
4
+ def current_user
5
+ @current_user ||= User.find_by_id(session[:user_id])
6
+ end
7
+
8
+ def signed_in?
9
+ !!current_user
10
+ end
11
+
12
+ helper_method :current_user, :signed_in?
13
+
14
+ def current_user=(user)
15
+ @current_user = user
16
+ session[:user_id] = user.id
17
+ end
18
+
19
+ end
@@ -0,0 +1,22 @@
1
+ class SessionsController < ApplicationController
2
+
3
+ def new
4
+ redirect_to kublog_path if signed_in?
5
+ end
6
+
7
+ def create
8
+ @user = User.find_by_email(params[:email])
9
+ if @user.authenticate(params[:password])
10
+ self.current_user = @user
11
+ redirect_to kublog_path, :notice => 'logged in successfully'
12
+ else
13
+ render 'new'
14
+ end
15
+ end
16
+
17
+ def destroy
18
+ session[:user_id] = nil
19
+ redirect_to new_session_path, :notice => 'Logged out successfully'
20
+ end
21
+
22
+ end
@@ -0,0 +1,17 @@
1
+ class UsersController < ApplicationController
2
+
3
+ def new
4
+ @user = User.new
5
+ end
6
+
7
+ def create
8
+ @user = User.new(params[:user])
9
+ if @user.save
10
+ self.current_user = @user
11
+ redirect_to kublog_path, :notice => 'User registered successfully'
12
+ else
13
+ render 'new'
14
+ end
15
+ end
16
+
17
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,23 @@
1
+ module ErrorMessagesHelper
2
+ # Render error messages for the given objects. The :message and :header_message options are allowed.
3
+ def error_messages_for(*objects)
4
+ options = objects.extract_options!
5
+ options[:header_message] ||= I18n.t(:"activerecord.errors.header", :default => "Invalid Fields")
6
+ options[:message] ||= I18n.t(:"activerecord.errors.message", :default => "Correct the following errors and try again.")
7
+ messages = objects.compact.map { |o| o.errors.full_messages }.flatten
8
+ unless messages.empty?
9
+ content_tag(:div, :class => "error_messages") do
10
+ list_items = messages.map { |msg| content_tag(:li, msg) }
11
+ content_tag(:h2, options[:header_message]) + content_tag(:p, options[:message]) + content_tag(:ul, list_items.join.html_safe)
12
+ end
13
+ end
14
+ end
15
+
16
+ module FormBuilderAdditions
17
+ def error_messages(options = {})
18
+ @template.error_messages_for(@object, options)
19
+ end
20
+ end
21
+ end
22
+
23
+ ActionView::Helpers::FormBuilder.send(:include, ErrorMessagesHelper::FormBuilderAdditions)
@@ -0,0 +1,22 @@
1
+ # These helper methods can be called in your template to set variables to be used in the layout
2
+ # This module should be included in all views globally,
3
+ # to do so you may need to add this line to your ApplicationController
4
+ # helper :layout
5
+ module LayoutHelper
6
+ def title(page_title, show_title = true)
7
+ content_for(:title) { h(page_title.to_s) }
8
+ @show_title = show_title
9
+ end
10
+
11
+ def show_title?
12
+ @show_title
13
+ end
14
+
15
+ def stylesheet(*args)
16
+ content_for(:head) { stylesheet_link_tag(*args) }
17
+ end
18
+
19
+ def javascript(*args)
20
+ content_for(:head) { javascript_include_tag(*args) }
21
+ end
22
+ end
@@ -0,0 +1,2 @@
1
+ module SessionsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module UsersHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ class Ability
2
+ end
@@ -0,0 +1,25 @@
1
+ class User < ActiveRecord::Base
2
+ include Kublog::Notifiable
3
+ include Kublog::Author
4
+
5
+ has_secure_password
6
+ validates_presence_of :email
7
+ validates_presence_of :password
8
+
9
+ def to_s
10
+ name.titleize
11
+ end
12
+
13
+ def notify_post?(post)
14
+ if post.for_shipper?
15
+ return self.email == 'adrian@rutanet.com'
16
+ else
17
+ return true
18
+ end
19
+ end
20
+
21
+ def admin?
22
+ self.admin
23
+ end
24
+
25
+ end
@@ -0,0 +1,8 @@
1
+ <div id='account'>
2
+ <% if signed_in? %>
3
+ <%= current_user %> | <%= link_to 'Sign Out', '/signout' %>
4
+ <% else %>
5
+ <%= link_to 'Sign In', main_app.new_session_path %> |
6
+ <%= link_to 'Register', main_app.new_user_path %>
7
+ <% end %>
8
+ </div>
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= content_for?(:title) ? yield(:title) : "Test Kublog" %></title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tag %>
8
+ <%= yield(:head) %>
9
+ </head>
10
+ <body>
11
+ <div id="container">
12
+ <div id="header">
13
+ <%= link_to content_tag(:h1, Kublog), main_app.kublog_path %>
14
+ <%= render 'layouts/account' %>
15
+ </div>
16
+ <div class='clear'></div>
17
+
18
+ <% flash.each do |name, msg| %>
19
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
20
+ <% end %>
21
+
22
+ <%= content_tag :h1, yield(:title) if show_title? %>
23
+
24
+ <%= yield %>
25
+
26
+ </div>
27
+ </body>
28
+ </html>
29
+ <div class='clear'></div>
@@ -0,0 +1,31 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Kublog</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= stylesheet_link_tag "kublog/application" %>
7
+ <%= javascript_include_tag "kublog/application" %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+
11
+ <body id='kublog'>
12
+ <div id='container'>
13
+
14
+ <div id="header">
15
+ <%= link_to content_tag(:h1, Kublog), main_app.kublog_path %>
16
+ <%= render 'layouts/account' %>
17
+ </div>
18
+
19
+ <div class='clear'></div>
20
+
21
+ <% flash.each do |name, msg| %>
22
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
23
+ <% end %>
24
+
25
+ <%= yield %>
26
+ <div class='clear'></div>
27
+
28
+ </div>
29
+ </body>
30
+
31
+ </html>
@@ -0,0 +1,15 @@
1
+ <h2>Sign in</h2>
2
+
3
+ <%= form_tag '/sessions' do %>
4
+ <p>
5
+ <%= label_tag :email %><br />
6
+ <%= text_field_tag :email %>
7
+ </p>
8
+ <p>
9
+ <%= label_tag :password %><br />
10
+ <%= password_field_tag :password %>
11
+ </p>
12
+ <p>
13
+ <%= submit_tag 'Sign in'%>
14
+ </p>
15
+ <% end %>
@@ -0,0 +1,28 @@
1
+ <h2>Register</h2>
2
+
3
+ <%= form_for @user do |f| %>
4
+ <p>
5
+ <%= f.label :name %><br />
6
+ <%= f.text_field :name %>
7
+ </p>
8
+ <p>
9
+ <%= f.label :email %><br />
10
+ <%= f.text_field :email %>
11
+ </p>
12
+ <p>
13
+ <%= f.label :password %><br />
14
+ <%= f.password_field :password %>
15
+ </p>
16
+ <p>
17
+ <%= f.label :password_confirmation %><br />
18
+ <%= f.password_field :password_confirmation %>
19
+ </p>
20
+ <p>
21
+
22
+ <%= f.check_box :admin %> <%= f.label :admin, 'Product Administrator' %>
23
+ </p>
24
+ <p>
25
+ <%= f.submit %>
26
+ </p>
27
+ <% end %>
28
+
@@ -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,42 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+ require "kublog"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Custom directories with classes and modules you want to be autoloadable.
15
+ # config.autoload_paths += %W(#{config.root}/extras)
16
+
17
+ # Only load the plugins named here, in the order given (default is alphabetical).
18
+ # :all can be used as a placeholder for all plugins not explicitly named.
19
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
+
21
+ # Activate observers that should always be running.
22
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
+
24
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
+ # config.time_zone = 'Central Time (US & Canada)'
27
+
28
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
+ # config.i18n.default_locale = :de
31
+
32
+ # Configure the default encoding used in templates for Ruby 1.9.
33
+ config.encoding = "utf-8"
34
+
35
+ # Configure sensitive parameters which will be filtered from the log file.
36
+ config.filter_parameters += [:password]
37
+
38
+ # Enable the asset pipeline
39
+ config.assets.enabled = true
40
+ end
41
+ end
42
+
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ development:
7
+ adapter: sqlite3
8
+ database: db/development.sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ # Warning: The database defined as "test" will be erased and
13
+ # re-generated from your development database when you run "rake".
14
+ # Do not set this db to the same as development or production.
15
+ test:
16
+ adapter: sqlite3
17
+ database: db/test.sqlite3
18
+ pool: 5
19
+ timeout: 5000
20
+
21
+ production:
22
+ adapter: sqlite3
23
+ database: db/production.sqlite3
24
+ pool: 5
25
+ timeout: 5000
@@ -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,38 @@
1
+ Dummy::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
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
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
+ #TODO Notify the user to set this
17
+ config.default_url_options = { :host => 'localhost:3000' }
18
+
19
+ # Don't care if the mailer can't send
20
+ config.action_mailer.delivery_method = :smtp
21
+ config.action_mailer.smtp_settings = {
22
+ :address => "localhost",
23
+ :port => 1025,
24
+ :domain => "rutanet.com",
25
+ }
26
+
27
+ # Don't care if the mailer can't send
28
+ config.action_mailer.raise_delivery_errors = false
29
+
30
+ # Print deprecation notices to the Rails logger
31
+ config.active_support.deprecation = :log
32
+
33
+ # Only use best-standards-support built into browsers
34
+ config.action_dispatch.best_standards_support = :builtin
35
+
36
+ # Do not compress assets
37
+ config.assets.compress = false
38
+ end
@@ -0,0 +1,51 @@
1
+ Dummy::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
+ # Full error reports are disabled and caching is turned on
8
+ config.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+
11
+ # Disable Rails's static asset server (Apache or nginx will already do this)
12
+ config.serve_static_assets = false
13
+
14
+ # Compress JavaScripts and CSS
15
+ config.assets.compress = true
16
+
17
+ # Specifies the header that your server uses for sending files
18
+ # (comment out if your front-end server doesn't support this)
19
+ config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
20
+
21
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
22
+ # config.force_ssl = true
23
+
24
+ # See everything in the log (default is :info)
25
+ # config.log_level = :debug
26
+
27
+ # Use a different logger for distributed setups
28
+ # config.logger = SyslogLogger.new
29
+
30
+ # Use a different cache store in production
31
+ # config.cache_store = :mem_cache_store
32
+
33
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server
34
+ # config.action_controller.asset_host = "http://assets.example.com"
35
+
36
+ # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
37
+ # config.assets.precompile += %w( search.js )
38
+
39
+ # Disable delivery errors, bad email addresses will be ignored
40
+ # config.action_mailer.raise_delivery_errors = false
41
+
42
+ # Enable threaded mode
43
+ # config.threadsafe!
44
+
45
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
46
+ # the I18n.default_locale when a translation can not be found)
47
+ config.i18n.fallbacks = true
48
+
49
+ # Send deprecation notices to registered listeners
50
+ config.active_support.deprecation = :notify
51
+ end