blogit 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,13 @@ module Blogit
3
3
 
4
4
  TIMETAG_FORMAT = "%Y-%m-%dT%TZ"
5
5
 
6
+ # Format content using the {Blogit::Configuration#default_parser_class default_parser_class}
7
+ def format_content(content = nil, &block)
8
+ content = capture(&block) if block_given?
9
+ parser = Blogit::configuration.default_parser_class.new(content)
10
+ parser.parsed.html_safe
11
+ end
12
+
6
13
  # Returns the first error message for an ActiveRecord model instance
7
14
  # @param object A model instance to check
8
15
  # @param attribute A symbol or string for attribute name to check for
@@ -1,13 +1,6 @@
1
1
  module Blogit
2
2
  module PostsHelper
3
-
4
- # Format content using the {Blogit::Configuration#default_parser_class default_parser_class}
5
- def format_content(content = nil, &block)
6
- content = capture(&block) if block_given?
7
- parser = Blogit::configuration.default_parser_class.new(content)
8
- parser.parsed.html_safe
9
- end
10
-
3
+
11
4
  # Creates a div tag with class 'blog_post_' + name
12
5
  # Eg:
13
6
  # blog_post_tag(:title, "") # => <div class="blog_post_title"></div>
@@ -3,7 +3,11 @@
3
3
  <%= comment.website? ? link_to(comment.name, comment.website) : comment.name %> wrote:
4
4
  <% end %>
5
5
 
6
- <%= content_tag(:div, comment.body, class: "blog_comment_body", id: "blog_comment_#{comment.id}_body") %>
6
+
7
+ <%= content_tag(:div, class: "blog_comment_body",
8
+ id: "blog_comment_#{comment.id}_body") do %>
9
+ <%= format_content comment.body %>
10
+ <% end %>
7
11
 
8
12
  <%= blog_comment_tag(:footer) do %>
9
13
  Posted on <%= time_tag(post.created_at, Blogit.configuration.datetime_format) %>
@@ -13,4 +17,4 @@
13
17
  <%= link_to("delete", [post, comment], method: :delete) %>
14
18
  <% end %>
15
19
 
16
- <% end %>
20
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module Blogit
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
Binary file
@@ -21995,3 +21995,129 @@ Served asset /jquery_ujs.js - 304 Not Modified (0ms)
21995
21995
 
21996
21996
  Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2011-11-16 21:20:13 +0000
21997
21997
  Served asset /application.js - 304 Not Modified (0ms)
21998
+
21999
+
22000
+ Started GET "/blog/posts/13-installing-riaksearch-on-os-x-lion-10-7" for 127.0.0.1 at 2011-11-18 19:08:57 +0000
22001
+ Processing by Blogit::PostsController#show as HTML
22002
+ Parameters: {"id"=>"13-installing-riaksearch-on-os-x-lion-10-7"}
22003
+ Blogit::Post Load (11.8ms) SELECT "blog_posts".* FROM "blog_posts" WHERE "blog_posts"."id" = ? LIMIT 1 [["id", "13-installing-riaksearch-on-os-x-lion-10-7"]]
22004
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/show.html.erb within layouts/application (41.1ms)
22005
+ Completed 500 Internal Server Error in 89ms
22006
+
22007
+ ActionView::Template::Error (Couldn't find Blogit::Post with id=13-installing-riaksearch-on-os-x-lion-10-7):
22008
+ 1: <%= render post %>
22009
+ 2: <% if blogit_conf.include_comments %>
22010
+ 3: <div id="comments">
22011
+ 4: <%= render comments %>
22012
+
22013
+
22014
+ Rendered /Users/Gavin/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (0.9ms)
22015
+ Rendered /Users/Gavin/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.7ms)
22016
+ Rendered /Users/Gavin/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.1ms)
22017
+
22018
+
22019
+ Started GET "/" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22020
+ Processing by Blogit::PostsController#index as HTML
22021
+ User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22022
+ Blogit::Post Load (0.6ms) SELECT "blog_posts".* FROM "blog_posts" ORDER BY updated_at DESC LIMIT 5 OFFSET 0
22023
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_head.html.erb (115.1ms)
22024
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_body.html.erb (1.0ms)
22025
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22026
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_links.html.erb (0.8ms)
22027
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
22028
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_blogger_information.html.erb (67.1ms)
22029
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_comments_count.html.erb (1.8ms)
22030
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_head.html.erb (0.9ms)
22031
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_body.html.erb (0.7ms)
22032
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22033
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_links.html.erb (0.5ms)
22034
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
22035
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_blogger_information.html.erb (0.8ms)
22036
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_comments_count.html.erb (0.8ms)
22037
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post.html.erb (274.9ms)
22038
+  (0.6ms) SELECT COUNT(*) FROM "blog_posts"
22039
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_pagination.html.erb (3.0ms)
22040
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/index.html.erb within layouts/application (331.7ms)
22041
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22042
+ Completed 200 OK in 421ms (Views: 417.7ms | ActiveRecord: 2.6ms)
22043
+
22044
+
22045
+ Started GET "/assets/blogit/comments.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22046
+ Served asset /blogit/comments.css - 304 Not Modified (1ms)
22047
+
22048
+
22049
+ Started GET "/assets/blogit/posts.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22050
+ Served asset /blogit/posts.css - 304 Not Modified (4ms)
22051
+
22052
+
22053
+ Started GET "/assets/blogit.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22054
+ Served asset /blogit.css - 304 Not Modified (0ms)
22055
+
22056
+
22057
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22058
+ Served asset /application.css - 200 OK (0ms)
22059
+
22060
+
22061
+ Started GET "/assets/blogit.js?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22062
+ Served asset /blogit.js - 304 Not Modified (0ms)
22063
+
22064
+
22065
+ Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22066
+ Served asset /jquery.js - 200 OK (2ms)
22067
+
22068
+
22069
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22070
+ Served asset /jquery_ujs.js - 200 OK (2ms)
22071
+
22072
+
22073
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2011-11-18 19:09:04 +0000
22074
+ Served asset /application.js - 200 OK (0ms)
22075
+
22076
+
22077
+ Started GET "/blog/posts/1-this-is-an-example-post-all-about-lorem-ipsum" for 127.0.0.1 at 2011-11-18 19:09:06 +0000
22078
+ Processing by Blogit::PostsController#show as HTML
22079
+ Parameters: {"id"=>"1-this-is-an-example-post-all-about-lorem-ipsum"}
22080
+ Blogit::Post Load (0.1ms) SELECT "blog_posts".* FROM "blog_posts" WHERE "blog_posts"."id" = ? LIMIT 1 [["id", "1-this-is-an-example-post-all-about-lorem-ipsum"]]
22081
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_head.html.erb (1.0ms)
22082
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_body.html.erb (0.6ms)
22083
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22084
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post_links.html.erb (32.5ms)
22085
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
22086
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_blogger_information.html.erb (4.4ms)
22087
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/_post.html.erb (41.8ms)
22088
+ Blogit::Comment Load (1.1ms) SELECT "blog_comments".* FROM "blog_comments" WHERE "blog_comments"."post_id" = 1
22089
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22090
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/comments/_comment.html.erb (1.9ms)
22091
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/comments/_form.html.erb (3.8ms)
22092
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/posts/show.html.erb within layouts/application (113.4ms)
22093
+ CACHE (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22094
+ Completed 200 OK in 146ms (Views: 143.4ms | ActiveRecord: 2.1ms)
22095
+
22096
+
22097
+ Started GET "/assets/blogit/comments.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:06 +0000
22098
+ Served asset /blogit/comments.css - 304 Not Modified (0ms)
22099
+
22100
+
22101
+ Started GET "/assets/blogit/posts.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:06 +0000
22102
+ Served asset /blogit/posts.css - 304 Not Modified (0ms)
22103
+
22104
+
22105
+ Started GET "/assets/blogit.css?body=1" for 127.0.0.1 at 2011-11-18 19:09:06 +0000
22106
+ Served asset /blogit.css - 304 Not Modified (0ms)
22107
+
22108
+
22109
+ Started GET "/assets/blogit.js?body=1" for 127.0.0.1 at 2011-11-18 19:09:06 +0000
22110
+ Served asset /blogit.js - 304 Not Modified (0ms)
22111
+
22112
+
22113
+ Started POST "/blog/posts/1-this-is-an-example-post-all-about-lorem-ipsum/comments" for 127.0.0.1 at 2011-11-18 19:09:44 +0000
22114
+ Processing by Blogit::CommentsController#create as JS
22115
+ Parameters: {"utf8"=>"✓", "authenticity_token"=>"P434OzOzkNWEOA9HKRBlk3IHGNDuLvqKxum44UBD1xo=", "comment"=>{"nickname"=>"", "name"=>"Gavin ", "email"=>"gavin@gavinmorrice.com", "website"=>"gavmorrice.com", "body"=>"This is the first line of my comment\r\n\r\nThis is the second line\r\n\r\n## a header tag\r\n\r\n"}, "commit"=>"Add Comment", "post_id"=>"1-this-is-an-example-post-all-about-lorem-ipsum"}
22116
+ Blogit::Post Load (0.1ms) SELECT "blog_posts".* FROM "blog_posts" WHERE "blog_posts"."id" = ? LIMIT 1 [["id", "1-this-is-an-example-post-all-about-lorem-ipsum"]]
22117
+ SQL (39.0ms) INSERT INTO "blog_comments" ("body", "created_at", "email", "name", "post_id", "state", "updated_at", "website") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["body", "This is the first line of my comment\r\n\r\nThis is the second line\r\n\r\n## a header tag\r\n\r\n"], ["created_at", Fri, 18 Nov 2011 19:09:45 UTC +00:00], ["email", "gavin@gavinmorrice.com"], ["name", "Gavin "], ["post_id", 1], ["state", nil], ["updated_at", Fri, 18 Nov 2011 19:09:45 UTC +00:00], ["website", "http://gavmorrice.com"]]
22118
+ Blogit::Post Load (0.1ms) SELECT "blog_posts".* FROM "blog_posts" WHERE "blog_posts"."id" = 1 LIMIT 1
22119
+ SQL (0.8ms) UPDATE "blog_posts" SET "comments_count" = COALESCE("comments_count", 0) + 1 WHERE "blog_posts"."id" = 1
22120
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" IS NULL LIMIT 1
22121
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/comments/_comment.html.erb (7.8ms)
22122
+ Rendered /Users/Gavin/Gems/blogit/app/views/blogit/comments/create.js.erb (9.8ms)
22123
+ Completed 200 OK in 121ms (Views: 15.4ms | ActiveRecord: 40.8ms)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blogit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-16 00:00:00.000000000Z
12
+ date: 2011-11-18 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70094584837380 !ruby/object:Gem::Requirement
16
+ requirement: &70161621984080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70094584837380
24
+ version_requirements: *70161621984080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &70094584836860 !ruby/object:Gem::Requirement
27
+ requirement: &70161621983440 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70094584836860
35
+ version_requirements: *70161621983440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: RedCloth
38
- requirement: &70094584836300 !ruby/object:Gem::Requirement
38
+ requirement: &70161621982620 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70094584836300
46
+ version_requirements: *70161621982620
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: redcarpet
49
- requirement: &70094584835760 !ruby/object:Gem::Requirement
49
+ requirement: &70161621981620 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70094584835760
57
+ version_requirements: *70161621981620
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &70094584835080 !ruby/object:Gem::Requirement
60
+ requirement: &70161621980940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70094584835080
68
+ version_requirements: *70161621980940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: albino
71
- requirement: &70094584834020 !ruby/object:Gem::Requirement
71
+ requirement: &70161621980060 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 1.3.3
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *70094584834020
79
+ version_requirements: *70161621980060
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sqlite3
82
- requirement: &70094584827300 !ruby/object:Gem::Requirement
82
+ requirement: &70161621979120 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70094584827300
90
+ version_requirements: *70161621979120
91
91
  description: Add a blog to your Rails application in minutes with this mountable Rails
92
92
  Engine
93
93
  email:
@@ -288,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
288
288
  version: '0'
289
289
  segments:
290
290
  - 0
291
- hash: -3874909597099184627
291
+ hash: -235577026408288597
292
292
  required_rubygems_version: !ruby/object:Gem::Requirement
293
293
  none: false
294
294
  requirements:
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  segments:
299
299
  - 0
300
- hash: -3874909597099184627
300
+ hash: -235577026408288597
301
301
  requirements: []
302
302
  rubyforge_project:
303
303
  rubygems_version: 1.8.11