postview 0.7.0 → 0.8.0

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 (52) hide show
  1. data/HISTORY +34 -9
  2. data/README.rdoc +11 -7
  3. data/Rakefile +4 -0
  4. data/VERSION +4 -4
  5. data/lib/postview.rb +6 -1
  6. data/lib/postview/application.rb +26 -33
  7. data/lib/postview/cli.rb +2 -0
  8. data/lib/postview/extensions.rb +8 -0
  9. data/lib/postview/helpers.rb +67 -9
  10. data/lib/postview/patches.rb +2 -0
  11. data/lib/postview/settings.rb +19 -3
  12. data/lib/postview/site.rb +19 -4
  13. data/tasks/history.rake +2 -2
  14. data/test/application_test.rb +12 -12
  15. data/test/extensions.rb +3 -3
  16. data/test/fixtures/application/posts/{20090529-postview_blogware.ruby.sinatra.mkd → 20090529-third_article.t1.t2.t3.mkd} +0 -0
  17. data/test/fixtures/application/posts/{20090602-postview_blogware.ruby.sinatra.mkd → 20090602-fourth_article.t1.t2.t3.t4.mkd} +0 -0
  18. data/test/fixtures/application/posts/archive/{20080529-postview_blogware.ruby.sinatra.mkd → 20080529-first_article.t1.mkd} +0 -0
  19. data/test/fixtures/application/posts/archive/{20080602-postview_blogware.ruby.sinatra.mkd → 20080602-second_article.t1.t2.mkd} +0 -0
  20. data/test/fixtures/application/posts/drafts/{20090730-draft_postview_blogware.ruby.sinatra.mkd → 20090730-fifth_article.t1.t2.t3.t4.t5.mkd} +0 -0
  21. data/test/fixtures/application/themes/gemstone/about.erb +22 -0
  22. data/test/fixtures/application/themes/gemstone/archive/index.erb +21 -0
  23. data/test/fixtures/application/themes/gemstone/archive/show.erb +4 -4
  24. data/test/fixtures/application/themes/gemstone/error.erb +0 -0
  25. data/test/fixtures/application/themes/gemstone/images/logo.png +0 -0
  26. data/test/fixtures/application/themes/gemstone/images/navigation-bar.gif +0 -0
  27. data/test/fixtures/application/themes/gemstone/images/postview.png +0 -0
  28. data/test/fixtures/application/themes/gemstone/images/rack.png +0 -0
  29. data/test/fixtures/application/themes/gemstone/images/ruby.png +0 -0
  30. data/test/fixtures/application/themes/gemstone/images/sinatra.png +0 -0
  31. data/test/fixtures/application/themes/gemstone/index.erb +38 -0
  32. data/test/fixtures/application/themes/gemstone/layout.erb +124 -0
  33. data/test/fixtures/application/themes/gemstone/posts/index.erb +21 -0
  34. data/test/fixtures/application/themes/gemstone/posts/show.erb +17 -0
  35. data/test/fixtures/application/themes/gemstone/search.erb +40 -0
  36. data/test/fixtures/application/themes/gemstone/stylesheets/postview.css +238 -0
  37. data/test/fixtures/application/themes/gemstone/tags/index.erb +12 -0
  38. data/test/fixtures/application/themes/gemstone/tags/show.erb +40 -0
  39. data/test/helpers_test.rb +70 -0
  40. data/test/settings_test.rb +2 -2
  41. data/test/site_test.rb +15 -14
  42. data/themes/default/about.erb +3 -5
  43. data/themes/default/archive/index.erb +1 -1
  44. data/themes/default/archive/show.erb +4 -4
  45. data/themes/default/index.erb +2 -2
  46. data/themes/default/layout.erb +20 -7
  47. data/themes/default/posts/index.erb +1 -1
  48. data/themes/default/posts/show.erb +4 -4
  49. data/themes/default/search.erb +5 -5
  50. data/themes/default/tags/index.erb +1 -1
  51. data/themes/default/tags/show.erb +6 -6
  52. metadata +27 -8
@@ -5,7 +5,7 @@
5
5
  <div class="text">
6
6
 
7
7
  <dl>
8
- <% for post in posts %>
8
+ <% for post in all_archived_posts %>
9
9
  <dt>
10
10
  <b><%=link_to "#{post.publish_date} - #{post.title}", archive_path, post, :title => post.title%></b>
11
11
  (<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)
@@ -1,15 +1,15 @@
1
1
  <div class="entry">
2
2
 
3
- <h1><%= link_to post.title, posts_path, post %></h1>
3
+ <h1><%= link_to current_post.title, posts_path, current_post %></h1>
4
4
 
5
5
  <span class="entry-meta">
6
- Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
7
- tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
6
+ Published at <%= current_post.publish_date.strftime('%A, %B %d, %Y') %>,
7
+ tagged with <%= current_post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
8
8
  </span>
9
9
 
10
10
  <div class="text">
11
11
 
12
- <%= post.content %>
12
+ <%= current_post.content %>
13
13
 
14
14
  </div><!--text-->
15
15
 
@@ -1,5 +1,5 @@
1
- <% unless posts.empty? %>
2
- <% for post in posts %>
1
+ <% unless latest_posts.empty? %>
2
+ <% for post in latest_posts %>
3
3
  <div class="entry">
4
4
 
5
5
  <h1><%= link_to post.title, posts_path, post %></h1>
@@ -60,11 +60,24 @@
60
60
 
61
61
  <h1>Related Posts</h1>
62
62
 
63
- <ul>
64
- <% for post in posts %>
65
- <li><%= link_to "#{post.publish_date} - #{post.title}", posts_path, post, :title => post.title %></li>
66
- <% end %>
67
- </ul>
63
+ <div class="text">
64
+
65
+ <h2>Published</h2>
66
+
67
+ <ul>
68
+ <% for post in related_posts_in :posts %>
69
+ <li><%= link_to "#{post.publish_date} - #{post.title}", :posts, post, :title => post.title %></li>
70
+ <% end %>
71
+ </ul>
72
+
73
+ <h2>Archived</h2>
74
+
75
+ <ul>
76
+ <% for post in related_posts_in :archive %>
77
+ <li><%= link_to "#{post.publish_date} - #{post.title}", :archive, post, :title => post.title %></li>
78
+ <% end %>
79
+ </ul>
80
+ </div>
68
81
 
69
82
  </div>
70
83
 
@@ -73,8 +86,8 @@
73
86
  <h1>Related Tags</h1>
74
87
 
75
88
  <ul>
76
- <% for tag in tags %>
77
- <li><%= link_to "#{tag.capitalize} (#{count_posts_by_tag(tag)})", tags_path, tag, :title => tag.capitalize %></li>
89
+ <% for tag in all_related_tags %>
90
+ <li><%= link_to "#{tag.capitalize} (#{count_posts_by_tag(tag)})", :tags, tag, :title => tag.capitalize %></li>
78
91
  <% end %>
79
92
  </ul>
80
93
 
@@ -5,7 +5,7 @@
5
5
  <div class="text">
6
6
 
7
7
  <dl>
8
- <% for post in posts %>
8
+ <% for post in all_posts %>
9
9
  <dt>
10
10
  <b><%=link_to "#{post.publish_date} - #{post.title}", posts_path, post%></b>
11
11
  (<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)
@@ -1,15 +1,15 @@
1
1
  <div class="entry">
2
2
 
3
- <h1><%= link_to post.title, posts_path, post %></h1>
3
+ <h1><%= link_to current_post.title, posts_path, current_post %></h1>
4
4
 
5
5
  <span class="entry-meta">
6
- Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
7
- tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
6
+ Published at <%= current_post.publish_date.strftime('%A, %B %d, %Y') %>,
7
+ tagged with <%= current_post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>.
8
8
  </span>
9
9
 
10
10
  <div class="text">
11
11
 
12
- <%= post.content %>
12
+ <%= current_post.content %>
13
13
 
14
14
  </div><!--text-->
15
15
 
@@ -5,14 +5,14 @@
5
5
  <div class="text">
6
6
 
7
7
  <p>
8
- <%= posts.size %> found in posts and <%= archive.size %> found in archive.
8
+ <%= posts_found.size %> found in posts and <%= archived_posts_found.size %> found in archive.
9
9
  </p>
10
10
 
11
- <% unless posts.empty? %>
11
+ <% unless posts_found.empty? %>
12
12
  <h2><%= title_path :posts %></h2>
13
13
 
14
14
  <ul>
15
- <% for post in posts %>
15
+ <% for post in posts_found %>
16
16
  <li>
17
17
  <%= post.publish_date.strftime('%Y-%m-%d') %> - <strong><%= link_to post.title, posts_path, post, :title => post.title %></strong>
18
18
  <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
@@ -21,11 +21,11 @@
21
21
  </ul>
22
22
  <% end %>
23
23
 
24
- <% unless archive.empty? %>
24
+ <% unless archived_posts_found.empty? %>
25
25
  <h2><%= title_path :archive %></h2>
26
26
 
27
27
  <ul>
28
- <% for post in archive %>
28
+ <% for post in archived_posts_found %>
29
29
  <li>
30
30
  <b><%= link_to "#{post.publish_date} - #{post.title}", archive_path, post, :title => post.title %></b>
31
31
  <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
@@ -3,7 +3,7 @@
3
3
  <h1><%= title_path :tags %></h1>
4
4
 
5
5
  <ul>
6
- <% for tag in tags %>
6
+ <% for tag in all_tags %>
7
7
  <li><%= link_to tag.capitalize, tags_path, tag, :title => tag.capitalize %> (<%=count_posts_by_tag(tag)%>)</li>
8
8
  <% end %>
9
9
  </ul>
@@ -1,18 +1,18 @@
1
1
  <div class="entry">
2
2
 
3
- <h1>Posts tagged with <%= tag.capitalize %></h1>
3
+ <h1>Posts tagged with <%= current_tag.capitalize %></h1>
4
4
 
5
5
  <div class="text">
6
6
 
7
7
  <p>
8
- <%= posts.size %> found in posts and <%= archive.size %> found in archive.
8
+ <%= posts_found.size %> found in posts and <%= archived_posts_found.size %> found in archive.
9
9
  </p>
10
10
 
11
- <% unless posts.empty? %>
11
+ <% unless posts_found.empty? %>
12
12
  <h2><%= title_path :posts %></h2>
13
13
 
14
14
  <ul>
15
- <% for post in posts %>
15
+ <% for post in posts_found %>
16
16
  <li>
17
17
  <b><%= link_to "#{post.publish_date} - #{post.title}", posts_path, post, :title => post.title %></b>
18
18
  <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
@@ -21,11 +21,11 @@
21
21
  </ul>
22
22
  <% end %>
23
23
 
24
- <% unless archive.empty? %>
24
+ <% unless archived_posts_found.empty? %>
25
25
  <h2><%= title_path :archive %></h2>
26
26
 
27
27
  <ul>
28
- <% for post in archive %>
28
+ <% for post in archived_posts_found %>
29
29
  <li>
30
30
  <b><%= link_to "#{post.publish_date} - #{post.title}", archive_path, post, :title => post.title %></b>
31
31
  <span>(<%= post.tags.map{ |tag| link_to tag.capitalize, tags_path, tag, :title => tag.capitalize }.join(', ') %>)</span>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hallison Batista
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-10 00:00:00 -04:00
12
+ date: 2009-09-15 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -68,24 +68,28 @@ files:
68
68
  - lib/postview/patches.rb
69
69
  - lib/postview/cli.rb
70
70
  - lib/postview/helpers.rb
71
+ - lib/postview/extensions.rb
71
72
  - lib/postview.rb
72
73
  - test/helper.rb
73
74
  - test/site_test.rb
75
+ - test/helpers_test.rb
74
76
  - test/settings_test.rb
75
77
  - test/application_test.rb
76
78
  - test/extensions.rb
77
- - test/fixtures/application/posts/archive/20080529-postview_blogware.ruby.sinatra.mkd
78
- - test/fixtures/application/posts/archive/20080602-postview_blogware.ruby.sinatra.mkd
79
- - test/fixtures/application/posts/20090529-postview_blogware.ruby.sinatra.mkd
80
- - test/fixtures/application/posts/20090602-postview_blogware.ruby.sinatra.mkd
81
- - test/fixtures/application/posts/drafts/20090730-draft_postview_blogware.ruby.sinatra.mkd
79
+ - test/fixtures/application/posts/archive/20080602-second_article.t1.t2.mkd
80
+ - test/fixtures/application/posts/archive/20080529-first_article.t1.mkd
81
+ - test/fixtures/application/posts/20090602-fourth_article.t1.t2.t3.t4.mkd
82
+ - test/fixtures/application/posts/drafts/20090730-fifth_article.t1.t2.t3.t4.t5.mkd
83
+ - test/fixtures/application/posts/20090529-third_article.t1.t2.t3.mkd
82
84
  - test/fixtures/application/config/settings.yml
83
85
  - test/fixtures/application/empty.yml
84
86
  - test/fixtures/application/themes/gemstone/search.erb
85
87
  - test/fixtures/application/themes/gemstone/posts/index.erb
86
88
  - test/fixtures/application/themes/gemstone/posts/show.erb
89
+ - test/fixtures/application/themes/gemstone/error.erb
87
90
  - test/fixtures/application/themes/gemstone/layout.erb
88
91
  - test/fixtures/application/themes/gemstone/stylesheets/gemstone.css
92
+ - test/fixtures/application/themes/gemstone/stylesheets/postview.css
89
93
  - test/fixtures/application/themes/gemstone/tags/index.erb
90
94
  - test/fixtures/application/themes/gemstone/tags/show.erb
91
95
  - test/fixtures/application/themes/gemstone/javascripts/gemstone.js
@@ -93,9 +97,15 @@ files:
93
97
  - test/fixtures/application/themes/gemstone/archive/show.erb
94
98
  - test/fixtures/application/themes/gemstone/index.erb
95
99
  - test/fixtures/application/themes/gemstone/about.erb
100
+ - test/fixtures/application/themes/gemstone/images/rack.png
101
+ - test/fixtures/application/themes/gemstone/images/ruby.png
96
102
  - test/fixtures/application/themes/gemstone/images/trojan.com
103
+ - test/fixtures/application/themes/gemstone/images/logo.png
104
+ - test/fixtures/application/themes/gemstone/images/navigation-bar.gif
97
105
  - test/fixtures/application/themes/gemstone/images/banners/banner.jpg
98
106
  - test/fixtures/application/themes/gemstone/images/favicon.ico
107
+ - test/fixtures/application/themes/gemstone/images/sinatra.png
108
+ - test/fixtures/application/themes/gemstone/images/postview.png
99
109
  - test/fixtures/application/config.ru
100
110
  - tasks/homepage.rake
101
111
  - tasks/version.rake
@@ -125,7 +135,16 @@ has_rdoc: true
125
135
  homepage: http://postview.rubyforge.org/
126
136
  licenses: []
127
137
 
128
- post_install_message:
138
+ post_install_message: |
139
+ ------------------------------------------------------------------------------
140
+ Postview v0.8.0 (September, 15 2009, Beta release)
141
+
142
+ Thanks for use this lightweight blogware. Now, you can read your posts by
143
+ editing in your favorite editor.
144
+
145
+ Please, feedback in http://github.com/hallison/postview/issues.
146
+ ------------------------------------------------------------------------------
147
+
129
148
  rdoc_options:
130
149
  - --line-numbers
131
150
  - --inline-source