postview 0.8.1 → 0.9.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.
- data/ABOUT +9 -0
- data/HISTORY +27 -1
- data/Rakefile +3 -1
- data/VERSION +4 -4
- data/bin/postview +2 -2
- data/lib/postview.rb +64 -13
- data/lib/postview/application.rb +34 -21
- data/lib/postview/authentication.rb +36 -0
- data/lib/postview/cli.rb +10 -0
- data/lib/postview/cli/create_command.rb +53 -37
- data/lib/postview/cli/server_command.rb +2 -2
- data/lib/postview/extensions.rb +10 -0
- data/lib/postview/helpers.rb +3 -0
- data/lib/postview/settings.rb +19 -17
- data/lib/postview/site.rb +13 -1
- data/lib/postview/version.rb +1 -1
- data/tasks/package.rake +80 -2
- data/test/application_test.rb +29 -14
- data/test/{extensions.rb → customizations.rb} +1 -0
- data/test/fixtures/application/config/settings.yml +4 -1
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/banners/banner.jpg +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/favicon.ico +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/logo.png +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/navigation-bar.gif +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/postview.png +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/rack.png +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/ruby.png +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/sinatra.png +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/images/trojan.com +0 -0
- data/test/fixtures/application/themes/{gemstone/javascripts/gemstone.js → mytheme/javascripts/postview.js} +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/stylesheets/gemstone.css +0 -0
- data/test/fixtures/application/themes/{gemstone → mytheme}/stylesheets/postview.css +0 -0
- data/test/fixtures/application/themes/mytheme/templates/about.erb +1 -0
- data/test/fixtures/application/themes/mytheme/templates/archive/index.erb +3 -0
- data/test/fixtures/application/themes/mytheme/templates/archive/show.erb +1 -0
- data/test/fixtures/application/themes/mytheme/templates/drafts/index.erb +3 -0
- data/test/fixtures/application/themes/mytheme/templates/drafts/show.erb +1 -0
- data/test/fixtures/application/themes/mytheme/templates/error.erb +1 -0
- data/test/fixtures/application/themes/mytheme/templates/index.erb +3 -0
- data/{themes/default → test/fixtures/application/themes/mytheme/templates}/layout.erb +2 -2
- data/test/fixtures/application/themes/mytheme/templates/posts/index.erb +3 -0
- data/test/fixtures/application/themes/mytheme/templates/posts/show.erb +1 -0
- data/test/fixtures/application/themes/mytheme/templates/search.erb +6 -0
- data/test/fixtures/application/themes/mytheme/templates/tags/index.erb +3 -0
- data/test/fixtures/application/themes/mytheme/templates/tags/show.erb +6 -0
- data/test/fixtures/site/blog/config.ru +6 -0
- data/test/fixtures/site/blog/config/settings.yml +25 -0
- data/test/fixtures/{application/themes/gemstone/error.erb → site/blog/empty.yml} +0 -0
- data/test/fixtures/site/blog/posts/20090529-third_article.t1.t2.t3.mkd +4 -0
- data/test/fixtures/site/blog/posts/20090602-fourth_article.t1.t2.t3.t4.mkd +4 -0
- data/test/fixtures/site/blog/posts/archive/20080529-first_article.t1.mkd +4 -0
- data/test/fixtures/site/blog/posts/archive/20080602-second_article.t1.t2.mkd +4 -0
- data/test/fixtures/site/blog/posts/drafts/20090730-fifth_article.t1.t2.t3.t4.t5.mkd +4 -0
- data/{themes/default/error.erb → test/fixtures/site/themes/mytheme/images/banners/banner.jpg} +0 -0
- data/test/fixtures/site/themes/mytheme/images/favicon.ico +0 -0
- data/test/fixtures/site/themes/mytheme/images/logo.png +0 -0
- data/test/fixtures/site/themes/mytheme/images/navigation-bar.gif +0 -0
- data/test/fixtures/site/themes/mytheme/images/postview.png +0 -0
- data/test/fixtures/site/themes/mytheme/images/rack.png +0 -0
- data/test/fixtures/site/themes/mytheme/images/ruby.png +0 -0
- data/test/fixtures/site/themes/mytheme/images/sinatra.png +0 -0
- data/test/fixtures/site/themes/mytheme/images/trojan.com +0 -0
- data/test/fixtures/site/themes/mytheme/javascripts/postview.js +1 -0
- data/test/fixtures/site/themes/mytheme/stylesheets/gemstone.css +1 -0
- data/test/fixtures/site/themes/mytheme/stylesheets/postview.css +238 -0
- data/test/fixtures/site/themes/mytheme/templates/about.erb +1 -0
- data/test/fixtures/site/themes/mytheme/templates/archive/index.erb +3 -0
- data/test/fixtures/site/themes/mytheme/templates/archive/show.erb +1 -0
- data/test/fixtures/site/themes/mytheme/templates/drafts/index.erb +3 -0
- data/test/fixtures/site/themes/mytheme/templates/drafts/show.erb +1 -0
- data/test/fixtures/site/themes/mytheme/templates/error.erb +1 -0
- data/test/fixtures/site/themes/mytheme/templates/index.erb +3 -0
- data/test/fixtures/{application/themes/gemstone → site/themes/mytheme/templates}/layout.erb +20 -14
- data/test/fixtures/site/themes/mytheme/templates/posts/index.erb +3 -0
- data/test/fixtures/site/themes/mytheme/templates/posts/show.erb +1 -0
- data/test/fixtures/site/themes/mytheme/templates/search.erb +6 -0
- data/test/fixtures/site/themes/mytheme/templates/tags/index.erb +3 -0
- data/test/fixtures/site/themes/mytheme/templates/tags/show.erb +6 -0
- data/test/helpers_test.rb +1 -2
- data/test/settings_test.rb +12 -3
- data/test/site_test.rb +3 -4
- data/themes/default/stylesheets/postview.css +1 -0
- data/themes/default/{about.erb → templates/about.erb} +1 -1
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/archive/index.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/archive/show.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/drafts/index.erb +1 -1
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/drafts/show.erb +0 -0
- data/themes/default/templates/error.erb +13 -0
- data/themes/default/{index.erb → templates/index.erb} +1 -1
- data/themes/default/templates/layout.erb +130 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/posts/index.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/posts/show.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/search.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/tags/index.erb +0 -0
- data/{test/fixtures/application/themes/gemstone → themes/default/templates}/tags/show.erb +0 -0
- metadata +164 -61
- data/INFO +0 -14
- data/lib/postview/about.rb +0 -34
- data/test/fixtures/application/themes/gemstone/about.erb +0 -22
- data/test/fixtures/application/themes/gemstone/index.erb +0 -38
- data/test/helper.rb +0 -9
- data/themes/default/archive/index.erb +0 -21
- data/themes/default/archive/show.erb +0 -17
- data/themes/default/drafts/index.erb +0 -21
- data/themes/default/drafts/show.erb +0 -17
- data/themes/default/posts/index.erb +0 -21
- data/themes/default/posts/show.erb +0 -17
- data/themes/default/search.erb +0 -40
- data/themes/default/tags/index.erb +0 -12
- data/themes/default/tags/show.erb +0 -40
data/INFO
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
:name: postview
|
2
|
-
:summary:
|
3
|
-
Simple blog-engine that render Markdown files.
|
4
|
-
:description:
|
5
|
-
Postview is a simple blog-engine written in Ruby using the Sinatra DSL for render files written in Markdown.
|
6
|
-
:authors:
|
7
|
-
- Hallison Batista
|
8
|
-
:email: email@hallisonbatista.com
|
9
|
-
:homepage: http://postview.rubyforge.org/
|
10
|
-
:dependencies:
|
11
|
-
sinatra: >= 0.9.1.1
|
12
|
-
sinatra-mapping: >= 1.0.5
|
13
|
-
postage: >= 0.1.4.1
|
14
|
-
|
data/lib/postview/about.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Postview
|
2
|
-
|
3
|
-
# Copyright (c) Hallison Batista
|
4
|
-
module About #:nodoc: all
|
5
|
-
|
6
|
-
class << self
|
7
|
-
|
8
|
-
def info
|
9
|
-
@about ||= OpenStruct.new(YAML.load_file(File.join(ROOT, "INFO")))
|
10
|
-
end
|
11
|
-
|
12
|
-
def to_s
|
13
|
-
<<-end_info.gsub(/ /,'')
|
14
|
-
#{Version}
|
15
|
-
|
16
|
-
Copyright (c) #{Version.info.timestamp.year} #{info.authors.join(', ')}
|
17
|
-
|
18
|
-
#{info.description}
|
19
|
-
|
20
|
-
For more information, please see the project homepage <#{info.homepage}>.
|
21
|
-
Bugs, enhancements and improvements, please send message to <#{info.email}>.
|
22
|
-
end_info
|
23
|
-
end
|
24
|
-
|
25
|
-
def to_html
|
26
|
-
Maruku.new(to_s).to_html
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
end # module About
|
32
|
-
|
33
|
-
end # module Postview
|
34
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%= link_to title_path(:about, site.title), :about %></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<%=Postview::About.to_html%>
|
8
|
-
|
9
|
-
<p>
|
10
|
-
<%=Postview.name%> uses the following libraries/projects:
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<ul>
|
14
|
-
<li><%=link_to "#{Sinatra}", "http://www.sinatrarb.com/"%></li>
|
15
|
-
<li><%=link_to "#{Sinatra::Mapping}", "http://sinatra-mapping.rubyforge.org/"%></li>
|
16
|
-
<li><%=link_to "#{Postage}", "http://postage.rubyforge.org/"%></li>
|
17
|
-
</ul>
|
18
|
-
|
19
|
-
</div><!--text-->
|
20
|
-
|
21
|
-
</div><!--entry-->
|
22
|
-
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<% unless latest_posts.empty? %>
|
2
|
-
<% for post in latest_posts %>
|
3
|
-
<div class="entry">
|
4
|
-
|
5
|
-
<h1><%= link_to post.title, :posts, post %></h1>
|
6
|
-
|
7
|
-
<span class="entry-meta">
|
8
|
-
Published at <%= post.publish_date.strftime('%A, %B %d, %Y') %>,
|
9
|
-
tagged with <%= post.tags.map{ |tag| link_to tag.capitalize, :posts, tag, :title => tag.capitalize }.join(', ') %>.
|
10
|
-
</span>
|
11
|
-
|
12
|
-
<div class="text">
|
13
|
-
|
14
|
-
<%= post.summary %>
|
15
|
-
|
16
|
-
<p>
|
17
|
-
<%= link_to "Read more ...", :posts, post %>
|
18
|
-
</p>
|
19
|
-
|
20
|
-
</div><!--text-->
|
21
|
-
|
22
|
-
</div><!--entry-->
|
23
|
-
<% end %>
|
24
|
-
<% else %>
|
25
|
-
<div class="entry">
|
26
|
-
|
27
|
-
<h1>No posts</h1>
|
28
|
-
|
29
|
-
<div class="text">
|
30
|
-
|
31
|
-
<p>
|
32
|
-
Please, check your posts directory.
|
33
|
-
</p>
|
34
|
-
|
35
|
-
</div><!--text-->
|
36
|
-
|
37
|
-
</div><!-- entry -->
|
38
|
-
<% end %>
|
data/test/helper.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%=title_path :archive%></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<dl>
|
8
|
-
<% for post in all_archived_posts %>
|
9
|
-
<dt>
|
10
|
-
<b><%=link_to "#{post.publish_date} - #{post.title}", :archive, post, :title => post.title%></b>
|
11
|
-
(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)
|
12
|
-
</dt>
|
13
|
-
|
14
|
-
<dd>
|
15
|
-
<%=post.summary%>
|
16
|
-
</dd>
|
17
|
-
<% end %>
|
18
|
-
</dl>
|
19
|
-
</div><!--text-->
|
20
|
-
</div><!--entry-->
|
21
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%= link_to current_post.title, :archive, current_post %></h1>
|
4
|
-
|
5
|
-
<span class="entry-meta">
|
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, tag, :title => tag.capitalize }.join(', ') %>.
|
8
|
-
</span>
|
9
|
-
|
10
|
-
<div class="text">
|
11
|
-
|
12
|
-
<%= current_post.content %>
|
13
|
-
|
14
|
-
</div><!--text-->
|
15
|
-
|
16
|
-
</div><!--entry-->
|
17
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%=title_path :drafts%></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<dl>
|
8
|
-
<% for post in all_drafted_posts %>
|
9
|
-
<dt>
|
10
|
-
<b><%=link_to "#{post.publish_date} - #{post.title}", :posts, post%></b>
|
11
|
-
(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)
|
12
|
-
</dt>
|
13
|
-
|
14
|
-
<dd>
|
15
|
-
<%=post.summary%>
|
16
|
-
</dd>
|
17
|
-
<% end %>
|
18
|
-
</dl>
|
19
|
-
</div><!--text-->
|
20
|
-
</div><!--entry-->
|
21
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%= link_to current_post.title, :drafts, current_post %></h1>
|
4
|
-
|
5
|
-
<span class="entry-meta">
|
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, tag, :title => tag.capitalize }.join(', ') %>.
|
8
|
-
</span>
|
9
|
-
|
10
|
-
<div class="text">
|
11
|
-
|
12
|
-
<%= current_post.content %>
|
13
|
-
|
14
|
-
</div><!--text-->
|
15
|
-
|
16
|
-
</div><!--entry-->
|
17
|
-
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%=title_path :posts%></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<dl>
|
8
|
-
<% for post in all_posts %>
|
9
|
-
<dt>
|
10
|
-
<b><%=link_to "#{post.publish_date} - #{post.title}", :posts, post%></b>
|
11
|
-
(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)
|
12
|
-
</dt>
|
13
|
-
|
14
|
-
<dd>
|
15
|
-
<%=post.summary%>
|
16
|
-
</dd>
|
17
|
-
<% end %>
|
18
|
-
</dl>
|
19
|
-
</div><!--text-->
|
20
|
-
</div><!--entry-->
|
21
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%= link_to current_post.title, :posts, current_post %></h1>
|
4
|
-
|
5
|
-
<span class="entry-meta">
|
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, tag, :title => tag.capitalize }.join(', ') %>.
|
8
|
-
</span>
|
9
|
-
|
10
|
-
<div class="text">
|
11
|
-
|
12
|
-
<%= current_post.content %>
|
13
|
-
|
14
|
-
</div><!--text-->
|
15
|
-
|
16
|
-
</div><!--entry-->
|
17
|
-
|
data/themes/default/search.erb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1><%= title_path :search %> - Results for <%= params.values.to_s.split.join(', ') %></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<p>
|
8
|
-
<%= posts_found.size %> found in posts and <%= archived_posts_found.size %> found in archive.
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<% unless posts_found.empty? %>
|
12
|
-
<h2><%= title_path :posts %></h2>
|
13
|
-
|
14
|
-
<ul>
|
15
|
-
<% for post in posts_found %>
|
16
|
-
<li>
|
17
|
-
<%= post.publish_date.strftime('%Y-%m-%d') %> - <strong><%= link_to post.title, :posts, post, :title => post.title %></strong>
|
18
|
-
<span>(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)</span>
|
19
|
-
</li>
|
20
|
-
<% end %>
|
21
|
-
</ul>
|
22
|
-
<% end %>
|
23
|
-
|
24
|
-
<% unless archived_posts_found.empty? %>
|
25
|
-
<h2><%= title_path :archive %></h2>
|
26
|
-
|
27
|
-
<ul>
|
28
|
-
<% for post in archived_posts_found %>
|
29
|
-
<li>
|
30
|
-
<b><%= link_to "#{post.publish_date} - #{post.title}", :archive, post, :title => post.title %></b>
|
31
|
-
<span>(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)</span>
|
32
|
-
</li>
|
33
|
-
<% end %>
|
34
|
-
</ul>
|
35
|
-
<% end %>
|
36
|
-
|
37
|
-
</div><!--text-->
|
38
|
-
|
39
|
-
</div><!--entry-->
|
40
|
-
|
@@ -1,40 +0,0 @@
|
|
1
|
-
<div class="entry">
|
2
|
-
|
3
|
-
<h1>Posts tagged with <%= current_tag.capitalize %></h1>
|
4
|
-
|
5
|
-
<div class="text">
|
6
|
-
|
7
|
-
<p>
|
8
|
-
<%= posts_found.size %> found in posts and <%= archived_posts_found.size %> found in archive.
|
9
|
-
</p>
|
10
|
-
|
11
|
-
<% unless posts_found.empty? %>
|
12
|
-
<h2><%= title_path :posts %></h2>
|
13
|
-
|
14
|
-
<ul>
|
15
|
-
<% for post in posts_found %>
|
16
|
-
<li>
|
17
|
-
<b><%= link_to "#{post.publish_date} - #{post.title}", :posts, post, :title => post.title %></b>
|
18
|
-
<span>(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)</span>
|
19
|
-
</li>
|
20
|
-
<% end %>
|
21
|
-
</ul>
|
22
|
-
<% end %>
|
23
|
-
|
24
|
-
<% unless archived_posts_found.empty? %>
|
25
|
-
<h2><%= title_path :archive %></h2>
|
26
|
-
|
27
|
-
<ul>
|
28
|
-
<% for post in archived_posts_found %>
|
29
|
-
<li>
|
30
|
-
<b><%= link_to "#{post.publish_date} - #{post.title}", :archive, post, :title => post.title %></b>
|
31
|
-
<span>(<%= post.tags.map{ |tag| link_to tag.capitalize, :tags, tag, :title => tag.capitalize }.join(', ') %>)</span>
|
32
|
-
</li>
|
33
|
-
<% end %>
|
34
|
-
</ul>
|
35
|
-
<% end %>
|
36
|
-
|
37
|
-
</div><!--text-->
|
38
|
-
|
39
|
-
</div><!--entry-->
|
40
|
-
|