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.
Files changed (110) hide show
  1. data/ABOUT +9 -0
  2. data/HISTORY +27 -1
  3. data/Rakefile +3 -1
  4. data/VERSION +4 -4
  5. data/bin/postview +2 -2
  6. data/lib/postview.rb +64 -13
  7. data/lib/postview/application.rb +34 -21
  8. data/lib/postview/authentication.rb +36 -0
  9. data/lib/postview/cli.rb +10 -0
  10. data/lib/postview/cli/create_command.rb +53 -37
  11. data/lib/postview/cli/server_command.rb +2 -2
  12. data/lib/postview/extensions.rb +10 -0
  13. data/lib/postview/helpers.rb +3 -0
  14. data/lib/postview/settings.rb +19 -17
  15. data/lib/postview/site.rb +13 -1
  16. data/lib/postview/version.rb +1 -1
  17. data/tasks/package.rake +80 -2
  18. data/test/application_test.rb +29 -14
  19. data/test/{extensions.rb → customizations.rb} +1 -0
  20. data/test/fixtures/application/config/settings.yml +4 -1
  21. data/test/fixtures/application/themes/{gemstone → mytheme}/images/banners/banner.jpg +0 -0
  22. data/test/fixtures/application/themes/{gemstone → mytheme}/images/favicon.ico +0 -0
  23. data/test/fixtures/application/themes/{gemstone → mytheme}/images/logo.png +0 -0
  24. data/test/fixtures/application/themes/{gemstone → mytheme}/images/navigation-bar.gif +0 -0
  25. data/test/fixtures/application/themes/{gemstone → mytheme}/images/postview.png +0 -0
  26. data/test/fixtures/application/themes/{gemstone → mytheme}/images/rack.png +0 -0
  27. data/test/fixtures/application/themes/{gemstone → mytheme}/images/ruby.png +0 -0
  28. data/test/fixtures/application/themes/{gemstone → mytheme}/images/sinatra.png +0 -0
  29. data/test/fixtures/application/themes/{gemstone → mytheme}/images/trojan.com +0 -0
  30. data/test/fixtures/application/themes/{gemstone/javascripts/gemstone.js → mytheme/javascripts/postview.js} +0 -0
  31. data/test/fixtures/application/themes/{gemstone → mytheme}/stylesheets/gemstone.css +0 -0
  32. data/test/fixtures/application/themes/{gemstone → mytheme}/stylesheets/postview.css +0 -0
  33. data/test/fixtures/application/themes/mytheme/templates/about.erb +1 -0
  34. data/test/fixtures/application/themes/mytheme/templates/archive/index.erb +3 -0
  35. data/test/fixtures/application/themes/mytheme/templates/archive/show.erb +1 -0
  36. data/test/fixtures/application/themes/mytheme/templates/drafts/index.erb +3 -0
  37. data/test/fixtures/application/themes/mytheme/templates/drafts/show.erb +1 -0
  38. data/test/fixtures/application/themes/mytheme/templates/error.erb +1 -0
  39. data/test/fixtures/application/themes/mytheme/templates/index.erb +3 -0
  40. data/{themes/default → test/fixtures/application/themes/mytheme/templates}/layout.erb +2 -2
  41. data/test/fixtures/application/themes/mytheme/templates/posts/index.erb +3 -0
  42. data/test/fixtures/application/themes/mytheme/templates/posts/show.erb +1 -0
  43. data/test/fixtures/application/themes/mytheme/templates/search.erb +6 -0
  44. data/test/fixtures/application/themes/mytheme/templates/tags/index.erb +3 -0
  45. data/test/fixtures/application/themes/mytheme/templates/tags/show.erb +6 -0
  46. data/test/fixtures/site/blog/config.ru +6 -0
  47. data/test/fixtures/site/blog/config/settings.yml +25 -0
  48. data/test/fixtures/{application/themes/gemstone/error.erb → site/blog/empty.yml} +0 -0
  49. data/test/fixtures/site/blog/posts/20090529-third_article.t1.t2.t3.mkd +4 -0
  50. data/test/fixtures/site/blog/posts/20090602-fourth_article.t1.t2.t3.t4.mkd +4 -0
  51. data/test/fixtures/site/blog/posts/archive/20080529-first_article.t1.mkd +4 -0
  52. data/test/fixtures/site/blog/posts/archive/20080602-second_article.t1.t2.mkd +4 -0
  53. data/test/fixtures/site/blog/posts/drafts/20090730-fifth_article.t1.t2.t3.t4.t5.mkd +4 -0
  54. data/{themes/default/error.erb → test/fixtures/site/themes/mytheme/images/banners/banner.jpg} +0 -0
  55. data/test/fixtures/site/themes/mytheme/images/favicon.ico +0 -0
  56. data/test/fixtures/site/themes/mytheme/images/logo.png +0 -0
  57. data/test/fixtures/site/themes/mytheme/images/navigation-bar.gif +0 -0
  58. data/test/fixtures/site/themes/mytheme/images/postview.png +0 -0
  59. data/test/fixtures/site/themes/mytheme/images/rack.png +0 -0
  60. data/test/fixtures/site/themes/mytheme/images/ruby.png +0 -0
  61. data/test/fixtures/site/themes/mytheme/images/sinatra.png +0 -0
  62. data/test/fixtures/site/themes/mytheme/images/trojan.com +0 -0
  63. data/test/fixtures/site/themes/mytheme/javascripts/postview.js +1 -0
  64. data/test/fixtures/site/themes/mytheme/stylesheets/gemstone.css +1 -0
  65. data/test/fixtures/site/themes/mytheme/stylesheets/postview.css +238 -0
  66. data/test/fixtures/site/themes/mytheme/templates/about.erb +1 -0
  67. data/test/fixtures/site/themes/mytheme/templates/archive/index.erb +3 -0
  68. data/test/fixtures/site/themes/mytheme/templates/archive/show.erb +1 -0
  69. data/test/fixtures/site/themes/mytheme/templates/drafts/index.erb +3 -0
  70. data/test/fixtures/site/themes/mytheme/templates/drafts/show.erb +1 -0
  71. data/test/fixtures/site/themes/mytheme/templates/error.erb +1 -0
  72. data/test/fixtures/site/themes/mytheme/templates/index.erb +3 -0
  73. data/test/fixtures/{application/themes/gemstone → site/themes/mytheme/templates}/layout.erb +20 -14
  74. data/test/fixtures/site/themes/mytheme/templates/posts/index.erb +3 -0
  75. data/test/fixtures/site/themes/mytheme/templates/posts/show.erb +1 -0
  76. data/test/fixtures/site/themes/mytheme/templates/search.erb +6 -0
  77. data/test/fixtures/site/themes/mytheme/templates/tags/index.erb +3 -0
  78. data/test/fixtures/site/themes/mytheme/templates/tags/show.erb +6 -0
  79. data/test/helpers_test.rb +1 -2
  80. data/test/settings_test.rb +12 -3
  81. data/test/site_test.rb +3 -4
  82. data/themes/default/stylesheets/postview.css +1 -0
  83. data/themes/default/{about.erb → templates/about.erb} +1 -1
  84. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/archive/index.erb +0 -0
  85. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/archive/show.erb +0 -0
  86. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/drafts/index.erb +1 -1
  87. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/drafts/show.erb +0 -0
  88. data/themes/default/templates/error.erb +13 -0
  89. data/themes/default/{index.erb → templates/index.erb} +1 -1
  90. data/themes/default/templates/layout.erb +130 -0
  91. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/posts/index.erb +0 -0
  92. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/posts/show.erb +0 -0
  93. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/search.erb +0 -0
  94. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/tags/index.erb +0 -0
  95. data/{test/fixtures/application/themes/gemstone → themes/default/templates}/tags/show.erb +0 -0
  96. metadata +164 -61
  97. data/INFO +0 -14
  98. data/lib/postview/about.rb +0 -34
  99. data/test/fixtures/application/themes/gemstone/about.erb +0 -22
  100. data/test/fixtures/application/themes/gemstone/index.erb +0 -38
  101. data/test/helper.rb +0 -9
  102. data/themes/default/archive/index.erb +0 -21
  103. data/themes/default/archive/show.erb +0 -17
  104. data/themes/default/drafts/index.erb +0 -21
  105. data/themes/default/drafts/show.erb +0 -17
  106. data/themes/default/posts/index.erb +0 -21
  107. data/themes/default/posts/show.erb +0 -17
  108. data/themes/default/search.erb +0 -40
  109. data/themes/default/tags/index.erb +0 -12
  110. data/themes/default/tags/show.erb +0 -40
@@ -0,0 +1,3 @@
1
+ <%for post in all_posts%>
2
+ <%=post%>
3
+ <%end%>
@@ -0,0 +1,6 @@
1
+ <%for post in posts_found%>
2
+ <%=post%>
3
+ <%end%>
4
+ <%for post in archived_posts_found%>
5
+ <%=post%>
6
+ <%end%>
@@ -0,0 +1,3 @@
1
+ <%for tag in all_tags%>
2
+ <%=tag%>
3
+ <%end%>
@@ -0,0 +1,6 @@
1
+ <%for post in posts_found%>
2
+ <%=post%>
3
+ <%end%>
4
+ <%for post in archived_posts_found%>
5
+ <%=post%>
6
+ <%end%>
@@ -0,0 +1,6 @@
1
+ require 'rubygems'
2
+ require 'postview'
3
+ log = File.open("tmp/postview.log", "a+")
4
+ $stdout.reopen(log)
5
+ $stderr.reopen(log)
6
+ run Postview::Application
@@ -0,0 +1,25 @@
1
+ ---
2
+ :site:
3
+ :author: Jack Ducklet
4
+ :domain: jackd.example.com
5
+ :directory: path/to/site
6
+ :email: jack.ducklet@example.com
7
+ :title: Postview
8
+ :theme: default
9
+ :subtitle: Post your articles
10
+ :theme: mytheme
11
+ :token: 948632a3174ea34188f1f261d26941cabd8a5a42b27577ff8e400d2cd139c6e1
12
+ :directories:
13
+ :posts: posts
14
+ :archive: posts/archive
15
+ :drafts: posts/drafts
16
+ :themes: ../themes
17
+ :sections:
18
+ :about: about
19
+ :posts: posts
20
+ :root: /
21
+ :archive: archive
22
+ :search: search
23
+ :tags: tags
24
+ :drafts: drafts
25
+ :manager: manager
@@ -0,0 +1,4 @@
1
+ Postview - Blogware
2
+ ===================
3
+
4
+ Fixture
@@ -0,0 +1,4 @@
1
+ Postview - Blogware
2
+ ===================
3
+
4
+ Fixture
@@ -0,0 +1,4 @@
1
+ Postview - Blogware
2
+ ===================
3
+
4
+ Fixture
@@ -0,0 +1,4 @@
1
+ Postview - Blogware
2
+ ===================
3
+
4
+ Fixture
@@ -0,0 +1,4 @@
1
+ Draft - Postview - Blogware
2
+ ===========================
3
+
4
+ Fixture
@@ -0,0 +1 @@
1
+ gemstone='gemstone'
@@ -0,0 +1,238 @@
1
+ /*
2
+ * Background header: 1F3366
3
+ * Background over: 445172
4
+ * Background light: 6D7FAC
5
+ * Background text: DADFEC
6
+ * Borders and colors: 5C6E9A
7
+ *
8
+ */
9
+
10
+ * {
11
+ font-size: 13.34px;
12
+ font-family: sans,dejavu sans,helvetica,verdana,arial,sans-serif;
13
+ }
14
+
15
+ a {
16
+ color: #777;
17
+ text-decoration: none;
18
+ }
19
+
20
+ a:hover {
21
+ color: #000;
22
+ }
23
+
24
+ h1, h2, h3, h4, h5, h6 {
25
+ margin: 0px;
26
+ padding: 0px;
27
+ font-weight: normal;
28
+ }
29
+
30
+ h1, h1>*, * html h1 * { font-size: 22px; }
31
+ h2, h2>* { font-size: 20px; }
32
+ h3, h3>* { font-size: 18px; }
33
+ h4, h4>* { font-size: 18px; }
34
+ h5, h5>* { font-size: 16px; }
35
+ h6, h6>* { font-size: 16px; }
36
+ small, small>* { font-size: 10px; }
37
+ big, big>* { font-size: 18px; }
38
+
39
+ body {
40
+ margin: 0px;
41
+ padding: 0px;
42
+ background-color: #DADFEC;
43
+ }
44
+
45
+ body>br {
46
+ clear: both;
47
+ }
48
+
49
+ body>div {
50
+ float: left;
51
+ }
52
+
53
+ body>div>address {
54
+ float: left;
55
+ display: block;
56
+ }
57
+
58
+ body>div>address>a {
59
+ float: left;
60
+ display: block;
61
+ width: 10em;
62
+ text-align: center;
63
+ font-style: normal;
64
+ background-color: inherit;
65
+ }
66
+
67
+ body>div>address>a:hover {
68
+ color: #FFF;
69
+ background-color: #777;
70
+ }
71
+
72
+ body>div>div>* {
73
+ width: inherit;
74
+ }
75
+
76
+ body>div>div>h1 {
77
+ border-bottom: 1px dotted #555;
78
+ }
79
+
80
+ pre {
81
+ padding: 4px;
82
+ font: 13.34px monaco,terminus,courrier,monospace;
83
+ color: #000;
84
+ background-color: #DDD;
85
+ }
86
+
87
+ code {
88
+ font: 13.34px monaco,terminus,courrier,monospace;
89
+ }
90
+
91
+ div#header,
92
+ div#footer {
93
+ width: 100%;
94
+ padding: 4px 0px 4px 0px;
95
+ background-color: #1F3366
96
+ }
97
+
98
+ img#logo {
99
+ top: 4px;
100
+ right: 2px;
101
+ position: absolute;
102
+ display: block;
103
+ }
104
+
105
+ div#header *,
106
+ div#footer * {
107
+ color: #FFF;
108
+ margin: 0px;
109
+ }
110
+
111
+ div#header h1, div#header h2, div#header span {
112
+ padding-left: 4px;
113
+ }
114
+
115
+ div#header h1>* {
116
+ display: block;
117
+ font-size: 28px;
118
+ font-weight: bold;
119
+ }
120
+
121
+ div#footer p {
122
+ text-align: center;
123
+ }
124
+
125
+ div#navigation-bar {
126
+ width:100%;
127
+ height: 32px;
128
+ vertical-align: middle;
129
+ background-image: url(../images/navigation-bar.gif);
130
+ }
131
+
132
+ div#navigation-bar address,
133
+ div#navigation-bar a {
134
+ height: inherit;
135
+ }
136
+
137
+ div#navigation-bar a {
138
+ height: 24px;
139
+ padding-top: 8px;
140
+ font-size: 14px;
141
+ font-weight: bold;
142
+ color: #FFF;
143
+ border-right: 2px groove #5C6E9A;
144
+ }
145
+
146
+ div#navigation-bar a:hover {
147
+ background-color: #445172;
148
+ }
149
+
150
+ div#navigation-bar form {
151
+ float: right;
152
+ width: auto;
153
+ }
154
+
155
+ div#navigation-bar form input[type="text"] {
156
+ width: 12em;
157
+ height: 24px;
158
+ padding-top: 6px;
159
+ font-weight: bold;
160
+ color: #FFF;
161
+ text-align: center;
162
+ border: none;
163
+ border-left: 2px groove #5C6E9A;
164
+ background-image: url(../images/navigation-bar.gif);
165
+ }
166
+
167
+ div#navigation-bar form input[type="text"]:focus,
168
+ div#navigation-bar form input[type="text"]:hover {
169
+ background-image: none;
170
+ background-color: #FFF;
171
+ color: #445172;
172
+ }
173
+
174
+ div#content {
175
+ width:60%;
176
+ }
177
+
178
+ div#options {
179
+ width:40%;
180
+ }
181
+
182
+ .entry {
183
+ margin: 16px;
184
+ background-color: #FFF;
185
+ -moz-border-radius: 8px;
186
+ -webkit-border-radius: 8px;
187
+ border: 1px solid #5C6E9A;
188
+ }
189
+
190
+ div#content .entry {
191
+ margin-right: 8px;
192
+ }
193
+
194
+ div#options .entry {
195
+ margin-left: 8px;
196
+ }
197
+
198
+ .entry h1 {
199
+ padding: 2px 12px 2px 12px;
200
+ border-bottom: 1px solid #5C6E9A;
201
+ }
202
+
203
+ .entry h1 * {
204
+ color: #5C6E9A;
205
+ }
206
+
207
+ .entry h1 a {
208
+ display: block;
209
+ }
210
+
211
+ .entry-meta,
212
+ .text {
213
+ padding: 2px 12px 2px 12px;
214
+ }
215
+
216
+ .entry-meta,
217
+ .entry-meta * {
218
+ font-style: italic;
219
+ }
220
+
221
+ .entry ul {
222
+ padding: 2px 12px 2px 12px;
223
+ padding-left: 32px;
224
+ }
225
+
226
+ .text {
227
+ margin: 8px auto 8px auto;
228
+ text-align: justify;
229
+ }
230
+
231
+ .text h2 {
232
+ border-bottom: 1px dotted #5C6E9A;
233
+ }
234
+
235
+ .text p {
236
+ padding: 16px auto 16px auto;
237
+ }
238
+
@@ -0,0 +1 @@
1
+ <%=Postview::about_to_html%>
@@ -0,0 +1,3 @@
1
+ <%for post in all_archived_posts%>
2
+ <%=post%>
3
+ <%end%>
@@ -0,0 +1 @@
1
+ <%=current_post%>
@@ -0,0 +1,3 @@
1
+ <%for post in all_drafted_posts%>
2
+ <%=post%>
3
+ <%end%>
@@ -0,0 +1 @@
1
+ <%=current_post%>
@@ -0,0 +1 @@
1
+ <%=error_message%>
@@ -0,0 +1,3 @@
1
+ <%for post in latest_posts%>
2
+ <%=post.summary%>
3
+ <%end%>
@@ -5,7 +5,7 @@
5
5
 
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
7
  <title><%=site.title%> :: <%=page.title%></title>
8
- <meta name="generator" content="<%=Postview::Version%>" />
8
+ <meta name="generator" content="<%=Postview::version_summary%>" />
9
9
  <meta name="description" content="<%=site.subtitle%>" />
10
10
  <meta name="keywords" content="<%=page.keywords%>" />
11
11
  <link rel="shortcut icon" href="<%=path_to :images, "favicon.ico"%>" />
@@ -60,19 +60,25 @@
60
60
 
61
61
  <h1>Related Posts</h1>
62
62
 
63
- <h2>Published</h2>
64
- <ul>
65
- <% for post in related_posts_in :posts %>
66
- <li><%= link_to "#{post.publish_date} - #{post.title}", :posts, post, :title => post.title %></li>
67
- <% end %>
68
- </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>
69
81
 
70
- <h2>Archived</h2>
71
- <ul>
72
- <% for post in related_posts_in :archive %>
73
- <li><%= link_to "#{post.publish_date} - #{post.title}", :archive, post, :title => post.title %></li>
74
- <% end %>
75
- </ul>
76
82
  </div>
77
83
 
78
84
  <div class="entry">
@@ -113,7 +119,7 @@
113
119
  <div id="footer">
114
120
 
115
121
  <p>
116
- <small><%=site.title%> &copy; 2009 <%=site.author%>. Powered by <%=link_to Postview::Version, "http://github.com/hallison/postview"%>.</small>
122
+ <small><%=site.title%> &copy; 2009 <%=site.author%>. Powered by <%=link_to Postview::version_summary, "http://github.com/hallison/postview"%>.</small>
117
123
  </p>
118
124
 
119
125
  </div><!-- footer -->