blogit 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.md +3 -0
  3. data/Rakefile +39 -0
  4. data/app/assets/javascripts/blogit/index.js +1 -0
  5. data/app/assets/stylesheets/blogit/comments.css +16 -0
  6. data/app/assets/stylesheets/blogit/index.css +3 -0
  7. data/app/assets/stylesheets/blogit/posts.css +59 -0
  8. data/app/controllers/blogit/application_controller.rb +41 -0
  9. data/app/controllers/blogit/comments_controller.rb +44 -0
  10. data/app/controllers/blogit/posts_controller.rb +55 -0
  11. data/app/helpers/blogit/application_helper.rb +64 -0
  12. data/app/helpers/blogit/comments_helper.rb +19 -0
  13. data/app/helpers/blogit/posts_helper.rb +26 -0
  14. data/app/models/blogit/comment.rb +59 -0
  15. data/app/models/blogit/post.rb +57 -0
  16. data/app/views/blogit/comments/_comment.html.erb +16 -0
  17. data/app/views/blogit/comments/_form.html.erb +42 -0
  18. data/app/views/blogit/comments/create.js.erb +7 -0
  19. data/app/views/blogit/comments/destroy.js.erb +1 -0
  20. data/app/views/blogit/posts/_blog_post_spacer.html.erb +1 -0
  21. data/app/views/blogit/posts/_blogger_information.html.erb +4 -0
  22. data/app/views/blogit/posts/_comments_count.html.erb +5 -0
  23. data/app/views/blogit/posts/_form.html.erb +43 -0
  24. data/app/views/blogit/posts/_pagination.html.erb +1 -0
  25. data/app/views/blogit/posts/_post.html.erb +19 -0
  26. data/app/views/blogit/posts/_post_body.html.erb +1 -0
  27. data/app/views/blogit/posts/_post_head.html.erb +3 -0
  28. data/app/views/blogit/posts/_post_links.html.erb +5 -0
  29. data/app/views/blogit/posts/edit.html.erb +3 -0
  30. data/app/views/blogit/posts/index.html.erb +10 -0
  31. data/app/views/blogit/posts/new.html.erb +3 -0
  32. data/app/views/blogit/posts/show.html.erb +7 -0
  33. data/config/routes.rb +9 -0
  34. data/db/migrate/20110814091434_create_blog_posts.rb +12 -0
  35. data/db/migrate/20110814093229_create_blog_comments.rb +15 -0
  36. data/db/migrate/20110814103306_acts_as_taggable_on_migration.rb +28 -0
  37. data/lib/blogit.rb +24 -0
  38. data/lib/blogit/blogs.rb +19 -0
  39. data/lib/blogit/configuration.rb +74 -0
  40. data/lib/blogit/engine.rb +14 -0
  41. data/lib/blogit/parsers.rb +5 -0
  42. data/lib/blogit/parsers/html_parser.rb +9 -0
  43. data/lib/blogit/parsers/markdown_parser.rb +21 -0
  44. data/lib/blogit/parsers/textile_parser.rb +13 -0
  45. data/lib/blogit/version.rb +3 -0
  46. data/lib/generators/blogit/USAGE +8 -0
  47. data/lib/generators/blogit/install_generator.rb +15 -0
  48. data/lib/generators/templates/blogit.rb +42 -0
  49. data/lib/tasks/blog_tasks.rake +4 -0
  50. data/lib/validators.rb +3 -0
  51. data/lib/validators/absence_validator.rb +13 -0
  52. data/spec/blogit_spec.rb +20 -0
  53. data/spec/controllers/blogit/comments_controller_spec.rb +111 -0
  54. data/spec/controllers/blogit/posts_controller_spec.rb +261 -0
  55. data/spec/dummy/Rakefile +7 -0
  56. data/spec/dummy/app/assets/javascripts/application.js +3 -0
  57. data/spec/dummy/app/assets/stylesheets/application.css +18 -0
  58. data/spec/dummy/app/controllers/application_controller.rb +19 -0
  59. data/spec/dummy/app/controllers/people_controller.rb +83 -0
  60. data/spec/dummy/app/controllers/sessions_controller.rb +23 -0
  61. data/spec/dummy/app/controllers/users_controller.rb +83 -0
  62. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  63. data/spec/dummy/app/helpers/people_helper.rb +2 -0
  64. data/spec/dummy/app/helpers/sessions_helper.rb +2 -0
  65. data/spec/dummy/app/helpers/users_helper.rb +2 -0
  66. data/spec/dummy/app/models/person.rb +2 -0
  67. data/spec/dummy/app/models/user.rb +11 -0
  68. data/spec/dummy/app/views/layouts/application.html.erb +28 -0
  69. data/spec/dummy/app/views/people/_form.html.erb +21 -0
  70. data/spec/dummy/app/views/people/edit.html.erb +6 -0
  71. data/spec/dummy/app/views/people/index.html.erb +23 -0
  72. data/spec/dummy/app/views/people/new.html.erb +5 -0
  73. data/spec/dummy/app/views/people/show.html.erb +10 -0
  74. data/spec/dummy/app/views/sessions/new.html.erb +17 -0
  75. data/spec/dummy/app/views/users/_form.html.erb +25 -0
  76. data/spec/dummy/app/views/users/edit.html.erb +6 -0
  77. data/spec/dummy/app/views/users/index.html.erb +25 -0
  78. data/spec/dummy/app/views/users/new.html.erb +5 -0
  79. data/spec/dummy/app/views/users/show.html.erb +15 -0
  80. data/spec/dummy/config.ru +4 -0
  81. data/spec/dummy/config/application.rb +25 -0
  82. data/spec/dummy/config/boot.rb +10 -0
  83. data/spec/dummy/config/database.yml +25 -0
  84. data/spec/dummy/config/environment.rb +5 -0
  85. data/spec/dummy/config/environments/development.rb +30 -0
  86. data/spec/dummy/config/environments/production.rb +51 -0
  87. data/spec/dummy/config/environments/test.rb +39 -0
  88. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  89. data/spec/dummy/config/initializers/blogit.rb +40 -0
  90. data/spec/dummy/config/initializers/inflections.rb +10 -0
  91. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  92. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  93. data/spec/dummy/config/initializers/session_store.rb +8 -0
  94. data/spec/dummy/config/initializers/wrap_parameters.rb +12 -0
  95. data/spec/dummy/config/locales/en.yml +5 -0
  96. data/spec/dummy/config/routes.rb +11 -0
  97. data/spec/dummy/db/development.sqlite3 +0 -0
  98. data/spec/dummy/db/migrate/20110814091304_create_users.rb +10 -0
  99. data/spec/dummy/db/migrate/20110819103335_create_people.rb +9 -0
  100. data/spec/dummy/db/schema.rb +71 -0
  101. data/spec/dummy/db/test.sqlite3 +0 -0
  102. data/spec/dummy/log/development.log +21145 -0
  103. data/spec/dummy/log/test.log +32053 -0
  104. data/spec/dummy/public/404.html +26 -0
  105. data/spec/dummy/public/422.html +26 -0
  106. data/spec/dummy/public/500.html +26 -0
  107. data/spec/dummy/public/favicon.ico +0 -0
  108. data/spec/dummy/script/rails +6 -0
  109. data/spec/dummy/test/fixtures/people.yml +7 -0
  110. data/spec/dummy/test/fixtures/users.yml +9 -0
  111. data/spec/dummy/test/functional/people_controller_test.rb +49 -0
  112. data/spec/dummy/test/functional/sessions_controller_test.rb +9 -0
  113. data/spec/dummy/test/functional/users_controller_test.rb +49 -0
  114. data/spec/dummy/test/unit/helpers/people_helper_test.rb +4 -0
  115. data/spec/dummy/test/unit/helpers/sessions_helper_test.rb +4 -0
  116. data/spec/dummy/test/unit/helpers/users_helper_test.rb +4 -0
  117. data/spec/dummy/test/unit/person_test.rb +7 -0
  118. data/spec/dummy/test/unit/user_test.rb +7 -0
  119. data/spec/dummy/tmp/cache/assets/BC4/870/sprockets%2F64a399278031122c8576726e146081d5 +0 -0
  120. data/spec/dummy/tmp/cache/assets/C49/710/sprockets%2F8a389a2323475a7053fc419c4103814f +0 -0
  121. data/spec/dummy/tmp/cache/assets/C9E/F00/sprockets%2Fdbb1755717649d42fe9df99326657618 +0 -0
  122. data/spec/dummy/tmp/cache/assets/CAA/0C0/sprockets%2Feec4505e23136c45e543a609b0c69554 +0 -0
  123. data/spec/dummy/tmp/cache/assets/CDE/240/sprockets%2Fcf7da81f64139020d3a4a78f904609c4 +0 -0
  124. data/spec/dummy/tmp/cache/assets/CEF/560/sprockets%2Fa1bf08ab120c72351b460a65e4800af6 +0 -0
  125. data/spec/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  126. data/spec/dummy/tmp/cache/assets/D08/D50/sprockets%2F36daa544802ddf93249b8d07dab81125 +0 -0
  127. data/spec/dummy/tmp/cache/assets/D0A/410/sprockets%2F7e74a40717d2324f9a30ddff29ea5124 +0 -0
  128. data/spec/dummy/tmp/cache/assets/D0E/C00/sprockets%2F3091a34f307d562f44ee24f4c776baa9 +0 -0
  129. data/spec/dummy/tmp/cache/assets/D0F/180/sprockets%2F1ea0059d1fca1d25898ff37c7c150944 +0 -0
  130. data/spec/dummy/tmp/cache/assets/D10/610/sprockets%2F5883b6e94dcea7e32d57de13201563c3 +0 -0
  131. data/spec/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
  132. data/spec/dummy/tmp/cache/assets/D1F/730/sprockets%2F2f81ed50f6f293b326c576a8528ce9f3 +0 -0
  133. data/spec/dummy/tmp/cache/assets/D22/380/sprockets%2Fda1670e413fe4633d84eb9394fd7797c +0 -0
  134. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  135. data/spec/dummy/tmp/cache/assets/D33/240/sprockets%2Ffd4446a4ab97006a073ba30d57fdd617 +0 -0
  136. data/spec/dummy/tmp/cache/assets/D34/140/sprockets%2F0d8b2740eca50a83fc91e51292f9f00c +0 -0
  137. data/spec/dummy/tmp/cache/assets/D34/680/sprockets%2Fb2cb3891a4cb197ecb1a37299d14c531 +0 -0
  138. data/spec/dummy/tmp/cache/assets/D3C/3A0/sprockets%2F40c65286b76c2cbc9d2bd92a60e7f126 +0 -0
  139. data/spec/dummy/tmp/cache/assets/D3D/C40/sprockets%2F4654852579bc0bea406bcd54d38a7dc3 +0 -0
  140. data/spec/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124 +0 -0
  141. data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  142. data/spec/dummy/tmp/cache/assets/D58/1E0/sprockets%2Fdd863e40bd669f77bb549b257d88d6b5 +0 -0
  143. data/spec/dummy/tmp/cache/assets/D61/6F0/sprockets%2F02da53eeca228bcef0c49278517111fe +0 -0
  144. data/spec/dummy/tmp/cache/assets/D63/720/sprockets%2Fe625e6b0d13c0bd8ca548a48e1d4508b +0 -0
  145. data/spec/dummy/tmp/cache/assets/D70/D70/sprockets%2Fc9ac544160bbcc29d775b54ca8f0269f +0 -0
  146. data/spec/dummy/tmp/cache/assets/D73/220/sprockets%2F3dbc0a37f98fb43ec819b85a64d32c55 +0 -0
  147. data/spec/dummy/tmp/cache/assets/D7A/BD0/sprockets%2Ff645c87585af5bf4be27a271f20b39ff +0 -0
  148. data/spec/dummy/tmp/cache/assets/D80/960/sprockets%2F269feebf3271f38b09bd01e9b748f77d +0 -0
  149. data/spec/dummy/tmp/cache/assets/D82/800/sprockets%2F72f633d76779cbfb7d9a57b5623c3faf +0 -0
  150. data/spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  151. data/spec/dummy/tmp/cache/assets/D8D/EA0/sprockets%2Fe64949cb167a0aa27a33a1adf1d544be +0 -0
  152. data/spec/dummy/tmp/cache/assets/DCA/9B0/sprockets%2Fdf0e8f8a85e5d4056b3fe1cec3b7131a +0 -0
  153. data/spec/dummy/tmp/cache/assets/DF3/BA0/sprockets%2Ffddeae525be5a563ca0d194b614bf64b +0 -0
  154. data/spec/dummy/tmp/cache/assets/DFF/B40/sprockets%2Fe0d60af9df95b2a58c278acd3f2beb55 +0 -0
  155. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  156. data/spec/dummy/tmp/cache/assets/E0A/870/sprockets%2Fbba31cc2875be0fddf5901fef9b99e48 +0 -0
  157. data/spec/dummy/tmp/cache/assets/E27/590/sprockets%2F097d2347f3f9d2ec19abefaaa5dd0ec1 +0 -0
  158. data/spec/dummy/tmp/cache/assets/E30/DC0/sprockets%2F9ddd7093ee1d47cbacd526f4bdd36e3c +0 -0
  159. data/spec/dummy/tmp/cache/assets/E49/530/sprockets%2F10dadda372ee79deb251d7bbbb025cec +0 -0
  160. data/spec/dummy/tmp/cache/assets/E82/4C0/sprockets%2F0d49c3fa07b559dbecbaabf2a4bad9c8 +0 -0
  161. data/spec/dummy/tmp/pids/server.pid +1 -0
  162. data/spec/factories.rb +28 -0
  163. data/spec/helpers/blogit/application_helper_spec.rb +14 -0
  164. data/spec/helpers/blogit/posts_helper_spec.rb +34 -0
  165. data/spec/lib/blogs_spec.rb +23 -0
  166. data/spec/lib/configuration_spec.rb +57 -0
  167. data/spec/lib/parsers/html_parser_spec.rb +12 -0
  168. data/spec/lib/parsers/markdown_parser_spec.rb +12 -0
  169. data/spec/lib/parsers/textile_parser_spec.rb +12 -0
  170. data/spec/models/blogit/comment_spec.rb +64 -0
  171. data/spec/models/blogit/post_spec.rb +153 -0
  172. data/spec/spec_helper.rb +16 -0
  173. data/spec/support/authentication.rb +9 -0
  174. data/spec/support/configuration.rb +5 -0
  175. metadata +415 -0
@@ -0,0 +1,5 @@
1
+ <h1>New user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,15 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Username:</b>
5
+ <%= @user.username %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Password:</b>
10
+ <%= @user.password %>
11
+ </p>
12
+
13
+
14
+ <%= link_to 'Edit', edit_user_path(@user) %> |
15
+ <%= link_to 'Back', users_path %>
@@ -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,25 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require
6
+
7
+ require "blogit"
8
+
9
+ module Dummy
10
+ class Application < Rails::Application
11
+ # Configure the default encoding used in templates for Ruby 1.9.
12
+ config.encoding = "utf-8"
13
+
14
+ # Configure sensitive parameters which will be filtered from the log file.
15
+ config.filter_parameters += [:password]
16
+
17
+ # Version of your assets, change this if you want to expire all your assets
18
+ config.assets.version = '1.0'
19
+
20
+
21
+ # Enable the asset pipeline
22
+ config.assets.enabled = true
23
+ end
24
+ end
25
+
@@ -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,30 @@
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
+ # 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
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ # Do not compress assets
26
+ config.assets.compress = false
27
+
28
+ # Expands the lines which load the assets
29
+ config.assets.debug = true
30
+ 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
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ # config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -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,40 @@
1
+ # These configuration options can be used to customise the behaviour of Blogit
2
+ Blogit.configure do |config|
3
+
4
+ # Should we include comments for blog posts?
5
+ config.include_comments = true
6
+
7
+ # The name of the controller method we'll call to return the current blogger.
8
+ config.current_blogger_method = :current_user
9
+
10
+ # what method do we call on blogger to return their display name?
11
+ # Defaults to :username
12
+ config.blogger_display_name_method = :username
13
+
14
+ # Which DateTime::FORMATS format do we use to display
15
+ # blog and comment publish time
16
+ config.datetime_format = :short
17
+
18
+ # No. of posts to show per page
19
+ config.posts_per_page = 5
20
+
21
+ # The name of the before filter we'll call to authenticate the current user.
22
+ config.authentication_method = :login_required
23
+
24
+ # If set to true, the comments form will POST and DELETE to the comments
25
+ # controller using AJAX calls.
26
+ config.ajax_comments = true
27
+
28
+ # If set to true, the create, edit, update and destroy actions
29
+ # will be included. If set to false, you'll have to set these
30
+ # yourself elsewhere in the app
31
+ config.include_admin_actions = true
32
+
33
+ # The default format for parsing the blog content.
34
+ config.default_parser = :markdown
35
+
36
+ # When using redcarpet as content parser, pass these options as defaults
37
+ config.redcarpet_options = [:hard_wrap, :filter_html, :autolink,
38
+ :no_intraemphasis, :fenced_code, :gh_blockcode]
39
+
40
+ end
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'b4bfcb0cc0064008add1ac3db2123467882dfdfbdd5e66487bf83c671792a03a18c7795ef8371a9ccf18d19f497b08d2d2f7e81fb993cf43f3443ae1838bab25'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActionController::Base.wrap_parameters format: [:json]
8
+
9
+ # Disable root element in JSON by default.
10
+ if defined?(ActiveRecord)
11
+ ActiveRecord::Base.include_root_in_json = false
12
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,11 @@
1
+ Rails.application.routes.draw do
2
+
3
+ resource :session, :only => [:new, :create, :destroy]
4
+
5
+ mount Blogit::Engine => "/blog"
6
+
7
+ resources :users
8
+
9
+ root :to => "blogit/posts#index"
10
+
11
+ end
Binary file
@@ -0,0 +1,10 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :username
5
+ t.string :password
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ class CreatePeople < ActiveRecord::Migration
2
+ def change
3
+ create_table :people do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,71 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20110819103335) do
15
+
16
+ create_table "blog_comments", :force => true do |t|
17
+ t.string "name", :null => false
18
+ t.string "email", :null => false
19
+ t.string "website"
20
+ t.text "body", :null => false
21
+ t.integer "post_id", :null => false
22
+ t.string "state"
23
+ t.datetime "created_at"
24
+ t.datetime "updated_at"
25
+ end
26
+
27
+ add_index "blog_comments", ["post_id"], :name => "index_blog_comments_on_post_id"
28
+
29
+ create_table "blog_posts", :force => true do |t|
30
+ t.string "title", :null => false
31
+ t.text "body", :null => false
32
+ t.integer "blogger_id"
33
+ t.string "blogger_type"
34
+ t.integer "comments_count", :default => 0, :null => false
35
+ t.datetime "created_at"
36
+ t.datetime "updated_at"
37
+ end
38
+
39
+ add_index "blog_posts", ["blogger_type", "blogger_id"], :name => "index_blog_posts_on_blogger_type_and_blogger_id"
40
+
41
+ create_table "people", :force => true do |t|
42
+ t.string "name"
43
+ t.datetime "created_at"
44
+ t.datetime "updated_at"
45
+ end
46
+
47
+ create_table "taggings", :force => true do |t|
48
+ t.integer "tag_id"
49
+ t.integer "taggable_id"
50
+ t.string "taggable_type"
51
+ t.integer "tagger_id"
52
+ t.string "tagger_type"
53
+ t.string "context"
54
+ t.datetime "created_at"
55
+ end
56
+
57
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
58
+ add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
59
+
60
+ create_table "tags", :force => true do |t|
61
+ t.string "name"
62
+ end
63
+
64
+ create_table "users", :force => true do |t|
65
+ t.string "username"
66
+ t.string "password"
67
+ t.datetime "created_at"
68
+ t.datetime "updated_at"
69
+ end
70
+
71
+ end