hobix 0.4 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +18 -0
- data/README +18 -0
- data/Rakefile +96 -0
- data/bin/hobix +7 -3
- data/contrib/blosxom-to-hobix.rb +253 -0
- data/contrib/txp-to-hobix.rb +56 -0
- data/contrib/webrick-all-mine.rb +20 -0
- data/doc/CHANGELOG +285 -0
- data/doc/rdoc/classes/Hobix/API.html +382 -0
- data/doc/rdoc/classes/Hobix/Article.html +111 -0
- data/doc/rdoc/classes/Hobix/BaseContent.html +692 -0
- data/doc/rdoc/classes/Hobix/BaseEntry.html +218 -0
- data/doc/rdoc/classes/Hobix/BaseFacet.html +205 -0
- data/doc/rdoc/classes/Hobix/BaseOutput.html +122 -0
- data/doc/rdoc/classes/Hobix/BasePlugin.html +201 -0
- data/doc/rdoc/classes/Hobix/BaseProperties/ClassMethods.html +243 -0
- data/doc/rdoc/classes/Hobix/BaseProperties.html +218 -0
- data/doc/rdoc/classes/Hobix/BasePublish.html +157 -0
- data/doc/rdoc/classes/Hobix/BaseStorage.html +417 -0
- data/doc/rdoc/classes/Hobix/BixWik/Entry.html +196 -0
- data/doc/rdoc/classes/Hobix/BixWik/IndexEntry.html +170 -0
- data/doc/rdoc/classes/Hobix/BixWik/WikiRedCloth.html +111 -0
- data/doc/rdoc/classes/Hobix/BixWik.html +418 -0
- data/doc/rdoc/classes/Hobix/BixWikPlugin.html +158 -0
- data/doc/rdoc/classes/Hobix/CommandLine.html +1970 -0
- data/doc/rdoc/classes/Hobix/Comment.html +113 -0
- data/doc/rdoc/classes/Hobix/Config.html +212 -0
- data/doc/rdoc/classes/Hobix/DataMarsh.html +667 -0
- data/doc/rdoc/classes/Hobix/Entry.html +178 -0
- data/doc/rdoc/classes/Hobix/EntryEnum.html +162 -0
- data/doc/rdoc/classes/Hobix/Enumerable.html +170 -0
- data/doc/rdoc/classes/Hobix/Facets/WikiEdit.html +180 -0
- data/doc/rdoc/classes/Hobix/Facets.html +111 -0
- data/doc/rdoc/classes/Hobix/LinkList.html +182 -0
- data/doc/rdoc/classes/Hobix/Out/Quick.html +412 -0
- data/doc/rdoc/classes/Hobix/Out.html +119 -0
- data/doc/rdoc/classes/Hobix/Page.html +381 -0
- data/doc/rdoc/classes/Hobix/Trackback.html +113 -0
- data/doc/rdoc/classes/Hobix/UriStr.html +198 -0
- data/doc/rdoc/classes/Hobix/WebApp/QueryString.html +207 -0
- data/doc/rdoc/classes/Hobix/WebApp/QueryValidationFailure.html +111 -0
- data/doc/rdoc/classes/Hobix/WebApp.html +1383 -0
- data/doc/rdoc/classes/Hobix/Weblog/AuthorNotFound.html +111 -0
- data/doc/rdoc/classes/Hobix/Weblog.html +2082 -0
- data/doc/rdoc/classes/Hobix.html +399 -0
- data/doc/rdoc/classes/Kernel.html +139 -0
- data/doc/rdoc/classes/Regexp.html +154 -0
- data/doc/rdoc/classes/YAML/Omap.html +144 -0
- data/doc/rdoc/classes/YAML.html +111 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/files/COPYING.html +129 -0
- data/doc/rdoc/files/README.html +131 -0
- data/doc/rdoc/files/doc/CHANGELOG.html +101 -0
- data/doc/rdoc/files/lib/hobix/api_rb.html +119 -0
- data/doc/rdoc/files/lib/hobix/article_rb.html +126 -0
- data/doc/rdoc/files/lib/hobix/base_rb.html +128 -0
- data/doc/rdoc/files/lib/hobix/bixwik_rb.html +126 -0
- data/doc/rdoc/files/lib/hobix/commandline_rb.html +140 -0
- data/doc/rdoc/files/lib/hobix/comments_rb.html +126 -0
- data/doc/rdoc/files/lib/hobix/config_rb.html +125 -0
- data/doc/rdoc/files/lib/hobix/datamarsh_rb.html +108 -0
- data/doc/rdoc/files/lib/hobix/entry_rb.html +118 -0
- data/doc/rdoc/files/lib/hobix/linklist_rb.html +127 -0
- data/doc/rdoc/files/lib/hobix/publisher_rb.html +126 -0
- data/doc/rdoc/files/lib/hobix/trackbacks_rb.html +128 -0
- data/doc/rdoc/files/lib/hobix/webapp_rb.html +127 -0
- data/doc/rdoc/files/lib/hobix/weblog_rb.html +135 -0
- data/doc/rdoc/files/lib/hobix_rb.html +127 -0
- data/doc/rdoc/fr_class_index.html +67 -0
- data/doc/rdoc/fr_file_index.html +44 -0
- data/doc/rdoc/fr_method_index.html +307 -0
- data/doc/rdoc/index.html +24 -0
- data/doc/rdoc/rdoc-style.css +208 -0
- data/git_hobix_update.php +13 -0
- data/lib/hobix/base.rb +6 -3
- data/lib/hobix/bixwik.rb +12 -12
- data/lib/hobix/commandline.rb +18 -2
- data/lib/hobix/comments.rb +4 -5
- data/lib/hobix/entry.rb +2 -1
- data/lib/hobix/facets/comments.rb +31 -6
- data/lib/hobix/linklist.rb +6 -1
- data/lib/hobix/out/atom.rb +29 -20
- data/lib/hobix/out/quick.rb +8 -6
- data/lib/hobix/out/rss.rb +16 -3
- data/lib/hobix/plugin/akismet.rb +196 -0
- data/lib/hobix/plugin/calendar.rb +6 -14
- data/lib/hobix/plugin/recent_comments.rb +4 -2
- data/lib/hobix/plugin/tags.rb +1 -1
- data/lib/hobix/storage/filesys.rb +41 -31
- data/lib/hobix/trackbacks.rb +1 -2
- data/lib/hobix/weblog.rb +73 -40
- data/lib/hobix.rb +9 -2
- data/share/default-blog/hobix.yaml +16 -0
- data/share/default-blog/htdocs/site.css +174 -0
- data/share/default-blog/skel/entry.html.quick +0 -0
- data/share/default-blog/skel/index.atom.atom +0 -0
- data/share/default-blog/skel/index.html.quick-summary +0 -0
- data/share/default-blog/skel/index.xml.rss +0 -0
- data/share/default-blog/skel/index.yaml.okaynews +0 -0
- data/share/default-blog/skel/monthly.html.quick-archive +0 -0
- data/share/default-blog/skel/section.html.quick-archive +0 -0
- data/share/default-blog/skel/yearly.html.quick-archive +0 -0
- data/share/default-blog-modes.yaml +7 -0
- data/share/default-blog.apache-cgi.patch +8 -0
- data/share/default-blog.apache-ssi.patch +38 -0
- data/share/default-blog.apache2-ssi.patch +3 -0
- data/share/default-blog.cgi.patch +8 -0
- data/share/default-blog.comments.patch +5 -0
- data/share/default-blog.prototype.patch +766 -0
- data/share/default-blog.publisher.patch +5 -0
- data/share/default-blog.wiki.patch +29 -0
- data/share/publisher/css/control.css +90 -0
- data/share/publisher/css/form.css +238 -0
- data/share/publisher/css/form.import.css +72 -0
- data/share/publisher/css/main-menu.css +134 -0
- data/share/publisher/i/hobix-emblazen-1.png +0 -0
- data/share/publisher/i/hobix-emblazen-2.png +0 -0
- data/share/publisher/i/hobix-emblazen-3.png +0 -0
- data/share/publisher/i/hobix-emblazen-4.png +0 -0
- data/share/publisher/i/hobix-emblazen-5.png +0 -0
- data/share/publisher/i/hobix-emblazen-6.png +0 -0
- data/share/publisher/i/hobix-emblazen-7.png +0 -0
- data/share/publisher/index.erb +66 -0
- data/share/publisher/js/controls.js +261 -0
- data/share/publisher/js/dragdrop.js +476 -0
- data/share/publisher/js/effects.js +570 -0
- data/share/publisher/js/prototype.js +1011 -0
- metadata +196 -53
- checksums.yaml +0 -7
@@ -0,0 +1,2082 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Hobix::Weblog</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Hobix::Weblog</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/hobix/base_rb.html">
|
59
|
+
lib/hobix/base.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../../files/lib/hobix/weblog_rb.html">
|
63
|
+
lib/hobix/weblog.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
</td>
|
67
|
+
</tr>
|
68
|
+
|
69
|
+
<tr class="top-aligned-row">
|
70
|
+
<td><strong>Parent:</strong></td>
|
71
|
+
<td>
|
72
|
+
Object
|
73
|
+
</td>
|
74
|
+
</tr>
|
75
|
+
</table>
|
76
|
+
</div>
|
77
|
+
<!-- banner header -->
|
78
|
+
|
79
|
+
<div id="bodyContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
<div id="contextContent">
|
84
|
+
|
85
|
+
<div id="description">
|
86
|
+
<p>
|
87
|
+
The <a href="Weblog.html">Weblog</a> class is the core of <a
|
88
|
+
href="../Hobix.html">Hobix</a> scripting. Although often you use it‘s
|
89
|
+
<tt><a href="Weblog.html#M000232">storage</a></tt> accessor to get to
|
90
|
+
entries, the <a href="Weblog.html">Weblog</a> class itself contains weblog
|
91
|
+
configuration information and methods for managing the weblog.
|
92
|
+
</p>
|
93
|
+
<h2>Properties</h2>
|
94
|
+
<p>
|
95
|
+
The following accessors are available for retrieving configuration data,
|
96
|
+
all of which is stored in hobix.yaml.
|
97
|
+
</p>
|
98
|
+
<table>
|
99
|
+
<tr><td valign="top">title:</td><td>The title of the weblog.
|
100
|
+
|
101
|
+
</td></tr>
|
102
|
+
<tr><td valign="top"><a href="Weblog.html#M000225">link</a>:</td><td>The absolute url to the weblog. (When accessed through the class —
|
103
|
+
weblog.link — this is returned as a URI.)
|
104
|
+
|
105
|
+
</td></tr>
|
106
|
+
<tr><td valign="top">authors:</td><td>A hash, in which keys are author‘s abbreviated names, paired with
|
107
|
+
hashes of `name’, `url’ and `email’ information.
|
108
|
+
|
109
|
+
</td></tr>
|
110
|
+
<tr><td valign="top">contributors:</td><td>Same structure as the authors hash. For storing information on third-party
|
111
|
+
contributors.
|
112
|
+
|
113
|
+
</td></tr>
|
114
|
+
<tr><td valign="top">tagline:</td><td>The short catchphrase associated with the weblog.
|
115
|
+
|
116
|
+
</td></tr>
|
117
|
+
<tr><td valign="top">copyright:</td><td>Brief copyright information.
|
118
|
+
|
119
|
+
</td></tr>
|
120
|
+
<tr><td valign="top">period:</td><td>How often is the weblog updated? Frequency in seconds.
|
121
|
+
|
122
|
+
</td></tr>
|
123
|
+
<tr><td valign="top">path:</td><td>Complete system path to the directory containing hobix.yaml.
|
124
|
+
|
125
|
+
</td></tr>
|
126
|
+
<tr><td valign="top"><a href="Weblog.html#M000249">sections</a>:</td><td>Specially tagged directories which act as independent subsites or hidden
|
127
|
+
categories.
|
128
|
+
|
129
|
+
</td></tr>
|
130
|
+
<tr><td valign="top">requires:</td><td>A list of required libraries, paired with possible configuration data for a
|
131
|
+
library.
|
132
|
+
|
133
|
+
</td></tr>
|
134
|
+
<tr><td valign="top"><a href="Weblog.html#M000217">entry_path</a>:</td><td>Path to entry <a href="Weblog.html#M000232">storage</a>.
|
135
|
+
|
136
|
+
</td></tr>
|
137
|
+
<tr><td valign="top"><a href="Weblog.html#M000218">skel_path</a>:</td><td>Path to template‘s directory.
|
138
|
+
|
139
|
+
</td></tr>
|
140
|
+
<tr><td valign="top"><a href="Weblog.html#M000219">output_path</a>:</td><td>Path to output directory.
|
141
|
+
|
142
|
+
</td></tr>
|
143
|
+
<tr><td valign="top"><a href="Weblog.html#M000220">lib_path</a>:</td><td>Path to extension library directory.
|
144
|
+
|
145
|
+
</td></tr>
|
146
|
+
<tr><td valign="top">git:</td><td>If true, regenerations will commit to git and push the site to the blahg
|
147
|
+
remote.
|
148
|
+
|
149
|
+
</td></tr>
|
150
|
+
</table>
|
151
|
+
<h2>Regeneration</h2>
|
152
|
+
<p>
|
153
|
+
One of the primary uses of the <a href="Weblog.html">Weblog</a> class is to
|
154
|
+
coordinate regenerations of the site. More about regeneration can be found
|
155
|
+
in the documentation for the <tt><a
|
156
|
+
href="Weblog.html#M000240">regenerate</a></tt> method.
|
157
|
+
</p>
|
158
|
+
<h2>Skel Methods</h2>
|
159
|
+
<p>
|
160
|
+
The <a href="Weblog.html">Weblog</a> class also contains handlers for
|
161
|
+
template prefixes. (Templates are usually contained in `skel’).
|
162
|
+
</p>
|
163
|
+
<p>
|
164
|
+
Each `prefix’ has its accompanying skel_prefix method. So, for
|
165
|
+
`index’ templates (such as index.html.erb), the <a
|
166
|
+
href="Weblog.html#M000243">skel_index</a> method is executed and passed a
|
167
|
+
block which is supplied a hash by the skel method.
|
168
|
+
</p>
|
169
|
+
<p>
|
170
|
+
Usually this hash only needs to contain :page and :entries (or :entry)
|
171
|
+
items. Any other items will simply be added to the vars hash.
|
172
|
+
</p>
|
173
|
+
<p>
|
174
|
+
To give you a general idea, <a href="Weblog.html#M000243">skel_index</a>
|
175
|
+
looks something like this:
|
176
|
+
</p>
|
177
|
+
<pre>
|
178
|
+
def skel_index( path_storage, section_path )
|
179
|
+
index_entries = path_storage.lastn( @lastn )
|
180
|
+
page = Page.new( 'index', section_path )
|
181
|
+
page.prev = index_entries.last.created.strftime( "%Y/%m/index" )
|
182
|
+
page.timestamp = index_entries.first.created
|
183
|
+
page.updated = path_storage.last_updated( index_entries )
|
184
|
+
yield :page => page, :entries => index_entries
|
185
|
+
end
|
186
|
+
</pre>
|
187
|
+
<p>
|
188
|
+
The page object is instantiated, describing where output will go. The
|
189
|
+
entries list, describing which entries qualify for this prefix, is queried
|
190
|
+
from <a href="Weblog.html#M000232">storage</a>. We then yield back to the
|
191
|
+
regeneration system with our hash.
|
192
|
+
</p>
|
193
|
+
<p>
|
194
|
+
Creating your own template prefixes is simply a matter of adding a new skel
|
195
|
+
method for that prefix to the <a href="Weblog.html">Weblog</a> class.
|
196
|
+
</p>
|
197
|
+
<h1>Examples</h1>
|
198
|
+
<h2>Example 1: Viewing Configuration</h2>
|
199
|
+
<p>
|
200
|
+
Since configuration is stored in <a href="../YAML.html">YAML</a>, you can
|
201
|
+
generate the hobix.yaml configuration file by simply running
|
202
|
+
<tt>to_yaml</tt> on a weblog.
|
203
|
+
</p>
|
204
|
+
<pre>
|
205
|
+
require 'hobix/weblog'
|
206
|
+
weblog = Hobix::Weblog.load( '/my/blahhg/hobix.yaml' )
|
207
|
+
puts weblog.to_yaml
|
208
|
+
#=> --- # prints YAML configuration
|
209
|
+
</pre>
|
210
|
+
<h2>Example 2: Adding a Template Prefix</h2>
|
211
|
+
<p>
|
212
|
+
On Hobix.com, only news entries are shown on the front page. The site also
|
213
|
+
has `about’ and `learn’ entry paths for storing the faqs and
|
214
|
+
tutorials. Although I didn‘t want to display the complete text of
|
215
|
+
these items, I did want a sidebar to contain links to them.
|
216
|
+
</p>
|
217
|
+
<p>
|
218
|
+
So I added a `sidebar’ prefix, which loads from these entry paths. I
|
219
|
+
have a sidebar.html.erb, which is included using Apache SSIs. The advantage
|
220
|
+
to this approach is that when an update occurs in either of these paths,
|
221
|
+
the sidebar will be updated in the next regeneration. Rather than having to
|
222
|
+
<a href="Weblog.html#M000240">regenerate</a> every page in the site to see
|
223
|
+
the change reflected.
|
224
|
+
</p>
|
225
|
+
<p>
|
226
|
+
I added a `lib/hobix.com.rb’ to the site‘s `lib’
|
227
|
+
directory. And in hobix.yaml, I included a line requiring this file. The
|
228
|
+
file simply contains the new skel method.
|
229
|
+
</p>
|
230
|
+
<pre>
|
231
|
+
module Hobix
|
232
|
+
class Weblog
|
233
|
+
def skel_sidebar( path_storage, section_path )
|
234
|
+
## Load `about' and `learn' entries
|
235
|
+
abouts = path_storage.find( :all => true, :inpath => 'about' ).reverse
|
236
|
+
learns = path_storage.find( :all => true, :inpath => 'learn' ).reverse
|
237
|
+
|
238
|
+
## Create page data
|
239
|
+
page = Page.new( 'sidebar', section_path )
|
240
|
+
page.updated = path_storage.last_updated( abouts + learns )
|
241
|
+
yield :page => page,
|
242
|
+
:about_entries => abouts, :learn_entries => learns
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
246
|
+
</pre>
|
247
|
+
<p>
|
248
|
+
There is a lot going on here. I‘ll try to explain the most vital
|
249
|
+
parts and leave the rest up to you.
|
250
|
+
</p>
|
251
|
+
<p>
|
252
|
+
First, <a href="Weblog.html#M000232">storage</a> queries don‘t return
|
253
|
+
full <a href="Entry.html">Entry</a> objects. You can read more about this
|
254
|
+
in the +<a href="BaseStorage.html">Hobix::BaseStorage</a>+ class docs. The
|
255
|
+
<a href="Weblog.html#M000232">storage</a> query returns Arrays which
|
256
|
+
contain each entry‘s id (a String) and the entry‘s modification
|
257
|
+
time (a Time object).
|
258
|
+
</p>
|
259
|
+
<p>
|
260
|
+
See, the regeneration system will do the business of loading the full
|
261
|
+
entries. The skel method‘s job is just to report which entries
|
262
|
+
<b>qualify</b> for a template. The regeneration system will only <a
|
263
|
+
href="Weblog.html#M000228">load</a> those entries if an update is needed.
|
264
|
+
</p>
|
265
|
+
<p>
|
266
|
+
We create a <a href="Page.html">Page</a> object, which dictates that the
|
267
|
+
output will be saved to /sidebar.ext. A modification time is discovered by
|
268
|
+
passing a combined list to +Hobix::BaseStorage#last_updated+. The
|
269
|
+
<tt>updated</tt> property is being set to the latest timestamp among the
|
270
|
+
about and learn entries.
|
271
|
+
</p>
|
272
|
+
<p>
|
273
|
+
PLEASE NOTE: The <tt>updated</tt> property is very important. The
|
274
|
+
regeneration system will use this timestamp to determine what pages need
|
275
|
+
updating. See +<a href="Weblog.html#M000240">Hobix::Weblog#regenerate</a>+
|
276
|
+
for more.
|
277
|
+
</p>
|
278
|
+
<p>
|
279
|
+
We then yield to the regeneration system. Note that any hash key which ends
|
280
|
+
with `entries’ will have its contents loaded as full <a
|
281
|
+
href="Entry.html">Entry</a> objects, should the prefix qualify for
|
282
|
+
regeneration.
|
283
|
+
</p>
|
284
|
+
<h2>The page_storage variable</h2>
|
285
|
+
<p>
|
286
|
+
The <tt>page_storage</tt> variable passed into the method is a trimmed copy
|
287
|
+
of the +<a href="Weblog.html#M000232">Weblog#storage</a>+ variable. Whereas
|
288
|
+
+<a href="Weblog.html#M000232">Weblog#storage</a>+ gives you access to all
|
289
|
+
stored entries, <tt>page_storage</tt> only gives you access to entries
|
290
|
+
within a certain path.
|
291
|
+
</p>
|
292
|
+
<p>
|
293
|
+
So, if you have a template skel/index.html.quick, then this template will
|
294
|
+
be passed a <tt>path_storage</tt> variable which encompasses all entries.
|
295
|
+
However, for template skel/friends/eric/index.html.quick will be given a
|
296
|
+
<tt>path_storage</tt> which includes only entries in the
|
297
|
+
`friends/eric’ path.
|
298
|
+
</p>
|
299
|
+
<p>
|
300
|
+
The simple rule is: if you want to have access to <a
|
301
|
+
href="Weblog.html#M000228">load</a> from the entire weblog <a
|
302
|
+
href="Weblog.html#M000232">storage</a>, use <tt><a
|
303
|
+
href="Weblog.html#M000232">storage</a></tt>. If you want your template to
|
304
|
+
honor its path, use <tt>path_storage</tt>. Both are +<a
|
305
|
+
href="BaseStorage.html">Hobix::BaseStorage</a>+ objects and respond to the
|
306
|
+
same methods.
|
307
|
+
</p>
|
308
|
+
|
309
|
+
</div>
|
310
|
+
|
311
|
+
|
312
|
+
</div>
|
313
|
+
|
314
|
+
<div id="method-list">
|
315
|
+
<h3 class="section-bar">Methods</h3>
|
316
|
+
|
317
|
+
<div class="name-list">
|
318
|
+
<a href="#M000207">add_entry_class</a>
|
319
|
+
<a href="#M000255">authorize</a>
|
320
|
+
<a href="#M000230">build_pages</a>
|
321
|
+
<a href="#M000222">central_ext</a>
|
322
|
+
<a href="#M000221">central_prefix</a>
|
323
|
+
<a href="#M000242">commit_to_git</a>
|
324
|
+
<a href="#M000214">default_central_ext</a>
|
325
|
+
<a href="#M000213">default_central_prefix</a>
|
326
|
+
<a href="#M000215">default_entry_class</a>
|
327
|
+
<a href="#M000209">default_entry_path</a>
|
328
|
+
<a href="#M000216">default_index_class</a>
|
329
|
+
<a href="#M000212">default_lib_path</a>
|
330
|
+
<a href="#M000211">default_output_path</a>
|
331
|
+
<a href="#M000210">default_skel_path</a>
|
332
|
+
<a href="#M000223">entry_class</a>
|
333
|
+
<a href="#M000217">entry_path</a>
|
334
|
+
<a href="#M000227">expand_path</a>
|
335
|
+
<a href="#M000236">facet_for</a>
|
336
|
+
<a href="#M000235">facets</a>
|
337
|
+
<a href="#M000224">index_class</a>
|
338
|
+
<a href="#M000253">join_path</a>
|
339
|
+
<a href="#M000220">lib_path</a>
|
340
|
+
<a href="#M000225">link</a>
|
341
|
+
<a href="#M000226">linklist</a>
|
342
|
+
<a href="#M000228">load</a>
|
343
|
+
<a href="#M000254">load_and_validate_entry</a>
|
344
|
+
<a href="#M000256">method_missing</a>
|
345
|
+
<a href="#M000239">output_entry_map</a>
|
346
|
+
<a href="#M000238">output_map</a>
|
347
|
+
<a href="#M000219">output_path</a>
|
348
|
+
<a href="#M000233">outputs</a>
|
349
|
+
<a href="#M000257">p_publish</a>
|
350
|
+
<a href="#M000234">publishers</a>
|
351
|
+
<a href="#M000240">regenerate</a>
|
352
|
+
<a href="#M000237">reset_output_map</a>
|
353
|
+
<a href="#M000241">retouch</a>
|
354
|
+
<a href="#M000229">save</a>
|
355
|
+
<a href="#M000249">sections</a>
|
356
|
+
<a href="#M000251">sections_ignored</a>
|
357
|
+
<a href="#M000250">sections_sorts</a>
|
358
|
+
<a href="#M000231">setup</a>
|
359
|
+
<a href="#M000244">skel_daily</a>
|
360
|
+
<a href="#M000247">skel_entry</a>
|
361
|
+
<a href="#M000243">skel_index</a>
|
362
|
+
<a href="#M000245">skel_monthly</a>
|
363
|
+
<a href="#M000218">skel_path</a>
|
364
|
+
<a href="#M000248">skel_section</a>
|
365
|
+
<a href="#M000252">skel_tags</a>
|
366
|
+
<a href="#M000246">skel_yearly</a>
|
367
|
+
<a href="#M000208">start</a>
|
368
|
+
<a href="#M000232">storage</a>
|
369
|
+
<a href="#M000258">to_yaml_type</a>
|
370
|
+
</div>
|
371
|
+
</div>
|
372
|
+
|
373
|
+
</div>
|
374
|
+
|
375
|
+
|
376
|
+
<!-- if includes -->
|
377
|
+
<div id="includes">
|
378
|
+
<h3 class="section-bar">Included Modules</h3>
|
379
|
+
|
380
|
+
<div id="includes-list">
|
381
|
+
<span class="include-name"><a href="BaseProperties.html">BaseProperties</a></span>
|
382
|
+
</div>
|
383
|
+
</div>
|
384
|
+
|
385
|
+
<div id="section">
|
386
|
+
|
387
|
+
<div id="class-list">
|
388
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
389
|
+
|
390
|
+
Class <a href="Weblog/AuthorNotFound.html" class="link">Hobix::Weblog::AuthorNotFound</a><br />
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
<div id="attribute-list">
|
398
|
+
<h3 class="section-bar">Attributes</h3>
|
399
|
+
|
400
|
+
<div class="name-list">
|
401
|
+
<table>
|
402
|
+
<tr class="top-aligned-row context-row">
|
403
|
+
<td class="context-item-name">hobix_yaml</td>
|
404
|
+
<td class="context-item-value"> [R] </td>
|
405
|
+
<td class="context-item-desc"></td>
|
406
|
+
</tr>
|
407
|
+
<tr class="top-aligned-row context-row">
|
408
|
+
<td class="context-item-name">path</td>
|
409
|
+
<td class="context-item-value"> [RW] </td>
|
410
|
+
<td class="context-item-desc"></td>
|
411
|
+
</tr>
|
412
|
+
</table>
|
413
|
+
</div>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
|
417
|
+
|
418
|
+
<!-- if method_list -->
|
419
|
+
<div id="methods">
|
420
|
+
<h3 class="section-bar">Public Class methods</h3>
|
421
|
+
|
422
|
+
<div id="method-M000207" class="method-detail">
|
423
|
+
<a name="M000207"></a>
|
424
|
+
|
425
|
+
<div class="method-heading">
|
426
|
+
<a href="#M000207" class="method-signature">
|
427
|
+
<span class="method-name">add_entry_class</span><span class="method-args">( c )</span>
|
428
|
+
</a>
|
429
|
+
</div>
|
430
|
+
|
431
|
+
<div class="method-description">
|
432
|
+
<p><a class="source-toggle" href="#"
|
433
|
+
onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
|
434
|
+
<div class="method-source-code" id="M000207-source">
|
435
|
+
<pre>
|
436
|
+
<span class="ruby-comment cmt"># File lib/hobix/base.rb, line 295</span>
|
437
|
+
295: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">add_entry_class</span>( <span class="ruby-identifier">c</span> )
|
438
|
+
296: <span class="ruby-ivar">@@entry_classes</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">c</span>
|
439
|
+
297: <span class="ruby-keyword kw">end</span>
|
440
|
+
</pre>
|
441
|
+
</div>
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
|
445
|
+
<div id="method-M000228" class="method-detail">
|
446
|
+
<a name="M000228"></a>
|
447
|
+
|
448
|
+
<div class="method-heading">
|
449
|
+
<a href="#M000228" class="method-signature">
|
450
|
+
<span class="method-name">load</span><span class="method-args">( hobix_yaml )</span>
|
451
|
+
</a>
|
452
|
+
</div>
|
453
|
+
|
454
|
+
<div class="method-description">
|
455
|
+
<p>
|
456
|
+
Load the weblog information from a <a href="../YAML.html">YAML</a> file and
|
457
|
+
<tt><a href="Weblog.html#M000208">start</a></tt> the <a
|
458
|
+
href="Weblog.html">Weblog</a>.
|
459
|
+
</p>
|
460
|
+
<p><a class="source-toggle" href="#"
|
461
|
+
onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
|
462
|
+
<div class="method-source-code" id="M000228-source">
|
463
|
+
<pre>
|
464
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 411</span>
|
465
|
+
411: <span class="ruby-keyword kw">def</span> <span class="ruby-constant">Weblog</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>( <span class="ruby-identifier">hobix_yaml</span> )
|
466
|
+
412: <span class="ruby-identifier">hobix_yaml</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-identifier">hobix_yaml</span> )
|
467
|
+
413: <span class="ruby-identifier">weblog</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>( <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">open</span>( <span class="ruby-identifier">hobix_yaml</span> ) )
|
468
|
+
414: <span class="ruby-identifier">weblog</span>.<span class="ruby-identifier">start</span>( <span class="ruby-identifier">hobix_yaml</span> )
|
469
|
+
415: <span class="ruby-identifier">weblog</span>
|
470
|
+
416: <span class="ruby-keyword kw">end</span>
|
471
|
+
</pre>
|
472
|
+
</div>
|
473
|
+
</div>
|
474
|
+
</div>
|
475
|
+
|
476
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
477
|
+
|
478
|
+
<div id="method-M000255" class="method-detail">
|
479
|
+
<a name="M000255"></a>
|
480
|
+
|
481
|
+
<div class="method-heading">
|
482
|
+
<a href="#M000255" class="method-signature">
|
483
|
+
<span class="method-name">authorize</span><span class="method-args">( user, pass )</span>
|
484
|
+
</a>
|
485
|
+
</div>
|
486
|
+
|
487
|
+
<div class="method-description">
|
488
|
+
<p><a class="source-toggle" href="#"
|
489
|
+
onclick="toggleCode('M000255-source');return false;">[Source]</a></p>
|
490
|
+
<div class="method-source-code" id="M000255-source">
|
491
|
+
<pre>
|
492
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 853</span>
|
493
|
+
853: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authorize</span>( <span class="ruby-identifier">user</span>, <span class="ruby-identifier">pass</span> )
|
494
|
+
854: <span class="ruby-identifier">require</span> <span class="ruby-value str">'digest/sha1'</span>
|
495
|
+
855: <span class="ruby-identifier">authors</span>[<span class="ruby-identifier">user</span>][<span class="ruby-value str">'password'</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">SHA1</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">pass</span> )
|
496
|
+
856: <span class="ruby-keyword kw">end</span>
|
497
|
+
</pre>
|
498
|
+
</div>
|
499
|
+
</div>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
<div id="method-M000230" class="method-detail">
|
503
|
+
<a name="M000230"></a>
|
504
|
+
|
505
|
+
<div class="method-heading">
|
506
|
+
<a href="#M000230" class="method-signature">
|
507
|
+
<span class="method-name">build_pages</span><span class="method-args">( page_name ) {|vars| ...}</span>
|
508
|
+
</a>
|
509
|
+
</div>
|
510
|
+
|
511
|
+
<div class="method-description">
|
512
|
+
<p>
|
513
|
+
Used by <tt><a href="Weblog.html#M000240">regenerate</a></tt> to construct
|
514
|
+
the vars hash by calling the appropriate skel method for each page.
|
515
|
+
</p>
|
516
|
+
<p><a class="source-toggle" href="#"
|
517
|
+
onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
|
518
|
+
<div class="method-source-code" id="M000230-source">
|
519
|
+
<pre>
|
520
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 432</span>
|
521
|
+
432: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">build_pages</span>( <span class="ruby-identifier">page_name</span> )
|
522
|
+
433: <span class="ruby-identifier">vars</span> = {}
|
523
|
+
434: <span class="ruby-identifier">paths</span> = <span class="ruby-identifier">page_name</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'/'</span> )
|
524
|
+
435: <span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
525
|
+
436: <span class="ruby-identifier">try_page</span> = <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">join</span>( <span class="ruby-value str">'_'</span> ).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">'-'</span>,<span class="ruby-value str">'_'</span>)
|
526
|
+
437: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span> <span class="ruby-node">"skel_#{ try_page }"</span>
|
527
|
+
438: <span class="ruby-identifier">section_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">page_name</span> )
|
528
|
+
439: <span class="ruby-identifier">path_storage</span> = <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">path_storage</span>( <span class="ruby-identifier">section_path</span> )
|
529
|
+
440: <span class="ruby-identifier">method</span>( <span class="ruby-node">"skel_#{ try_page }"</span> ).<span class="ruby-identifier">call</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">vars</span><span class="ruby-operator">|</span>
|
530
|
+
441: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:weblog</span>] = <span class="ruby-keyword kw">self</span>
|
531
|
+
442: <span class="ruby-identifier">raise</span> <span class="ruby-constant">TypeError</span>, <span class="ruby-node">"No `page' variable returned from skel_#{ try_page }."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>]
|
532
|
+
443: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">vars</span>
|
533
|
+
444: <span class="ruby-keyword kw">end</span>
|
534
|
+
445: <span class="ruby-keyword kw">return</span>
|
535
|
+
446: <span class="ruby-keyword kw">end</span>
|
536
|
+
447: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">slice!</span>( <span class="ruby-value">-2</span> ) <span class="ruby-comment cmt">## go up a directory</span>
|
537
|
+
448: <span class="ruby-keyword kw">end</span>
|
538
|
+
449: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:weblog</span>] = <span class="ruby-keyword kw">self</span>
|
539
|
+
450: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>] = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">page_name</span> )
|
540
|
+
451: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">timestamp</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>
|
541
|
+
452: <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">vars</span>
|
542
|
+
453: <span class="ruby-keyword kw">end</span>
|
543
|
+
</pre>
|
544
|
+
</div>
|
545
|
+
</div>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
<div id="method-M000222" class="method-detail">
|
549
|
+
<a name="M000222"></a>
|
550
|
+
|
551
|
+
<div class="method-heading">
|
552
|
+
<a href="#M000222" class="method-signature">
|
553
|
+
<span class="method-name">central_ext</span><span class="method-args">()</span>
|
554
|
+
</a>
|
555
|
+
</div>
|
556
|
+
|
557
|
+
<div class="method-description">
|
558
|
+
<p><a class="source-toggle" href="#"
|
559
|
+
onclick="toggleCode('M000222-source');return false;">[Source]</a></p>
|
560
|
+
<div class="method-source-code" id="M000222-source">
|
561
|
+
<pre>
|
562
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 364</span>
|
563
|
+
364: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">central_ext</span>; <span class="ruby-ivar">@central_ext</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\w*$/</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@central_ext</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">default_central_ext</span>; <span class="ruby-keyword kw">end</span>
|
564
|
+
</pre>
|
565
|
+
</div>
|
566
|
+
</div>
|
567
|
+
</div>
|
568
|
+
|
569
|
+
<div id="method-M000221" class="method-detail">
|
570
|
+
<a name="M000221"></a>
|
571
|
+
|
572
|
+
<div class="method-heading">
|
573
|
+
<a href="#M000221" class="method-signature">
|
574
|
+
<span class="method-name">central_prefix</span><span class="method-args">()</span>
|
575
|
+
</a>
|
576
|
+
</div>
|
577
|
+
|
578
|
+
<div class="method-description">
|
579
|
+
<p><a class="source-toggle" href="#"
|
580
|
+
onclick="toggleCode('M000221-source');return false;">[Source]</a></p>
|
581
|
+
<div class="method-source-code" id="M000221-source">
|
582
|
+
<pre>
|
583
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 363</span>
|
584
|
+
363: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">central_prefix</span>; <span class="ruby-ivar">@central_prefix</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[\w\.]+$/</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@central_prefix</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">default_central_prefix</span>; <span class="ruby-keyword kw">end</span>
|
585
|
+
</pre>
|
586
|
+
</div>
|
587
|
+
</div>
|
588
|
+
</div>
|
589
|
+
|
590
|
+
<div id="method-M000242" class="method-detail">
|
591
|
+
<a name="M000242"></a>
|
592
|
+
|
593
|
+
<div class="method-heading">
|
594
|
+
<a href="#M000242" class="method-signature">
|
595
|
+
<span class="method-name">commit_to_git</span><span class="method-args">()</span>
|
596
|
+
</a>
|
597
|
+
</div>
|
598
|
+
|
599
|
+
<div class="method-description">
|
600
|
+
<p>
|
601
|
+
Method to commit to the local git repo and push pure happiness to the
|
602
|
+
remote server named blahg (which should be of webserving character and a
|
603
|
+
pleasant demeanor).
|
604
|
+
</p>
|
605
|
+
<p><a class="source-toggle" href="#"
|
606
|
+
onclick="toggleCode('M000242-source');return false;">[Source]</a></p>
|
607
|
+
<div class="method-source-code" id="M000242-source">
|
608
|
+
<pre>
|
609
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 661</span>
|
610
|
+
661: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">commit_to_git</span>
|
611
|
+
662: <span class="ruby-identifier">puts</span> <span class="ruby-value">`git add .`</span>
|
612
|
+
663: <span class="ruby-identifier">puts</span> <span class="ruby-value">`git commit -a -m "New poshts for the syhtt"`</span>
|
613
|
+
664: <span class="ruby-identifier">puts</span> <span class="ruby-value">`git push blahg master`</span>
|
614
|
+
665: <span class="ruby-keyword kw">end</span>
|
615
|
+
</pre>
|
616
|
+
</div>
|
617
|
+
</div>
|
618
|
+
</div>
|
619
|
+
|
620
|
+
<div id="method-M000214" class="method-detail">
|
621
|
+
<a name="M000214"></a>
|
622
|
+
|
623
|
+
<div class="method-heading">
|
624
|
+
<a href="#M000214" class="method-signature">
|
625
|
+
<span class="method-name">default_central_ext</span><span class="method-args">()</span>
|
626
|
+
</a>
|
627
|
+
</div>
|
628
|
+
|
629
|
+
<div class="method-description">
|
630
|
+
<p><a class="source-toggle" href="#"
|
631
|
+
onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
|
632
|
+
<div class="method-source-code" id="M000214-source">
|
633
|
+
<pre>
|
634
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 355</span>
|
635
|
+
355: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_central_ext</span>; <span class="ruby-value str">"html"</span>; <span class="ruby-keyword kw">end</span>
|
636
|
+
</pre>
|
637
|
+
</div>
|
638
|
+
</div>
|
639
|
+
</div>
|
640
|
+
|
641
|
+
<div id="method-M000213" class="method-detail">
|
642
|
+
<a name="M000213"></a>
|
643
|
+
|
644
|
+
<div class="method-heading">
|
645
|
+
<a href="#M000213" class="method-signature">
|
646
|
+
<span class="method-name">default_central_prefix</span><span class="method-args">()</span>
|
647
|
+
</a>
|
648
|
+
</div>
|
649
|
+
|
650
|
+
<div class="method-description">
|
651
|
+
<p><a class="source-toggle" href="#"
|
652
|
+
onclick="toggleCode('M000213-source');return false;">[Source]</a></p>
|
653
|
+
<div class="method-source-code" id="M000213-source">
|
654
|
+
<pre>
|
655
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 354</span>
|
656
|
+
354: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_central_prefix</span>; <span class="ruby-value str">"entry"</span>; <span class="ruby-keyword kw">end</span>
|
657
|
+
</pre>
|
658
|
+
</div>
|
659
|
+
</div>
|
660
|
+
</div>
|
661
|
+
|
662
|
+
<div id="method-M000215" class="method-detail">
|
663
|
+
<a name="M000215"></a>
|
664
|
+
|
665
|
+
<div class="method-heading">
|
666
|
+
<a href="#M000215" class="method-signature">
|
667
|
+
<span class="method-name">default_entry_class</span><span class="method-args">()</span>
|
668
|
+
</a>
|
669
|
+
</div>
|
670
|
+
|
671
|
+
<div class="method-description">
|
672
|
+
<p><a class="source-toggle" href="#"
|
673
|
+
onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
|
674
|
+
<div class="method-source-code" id="M000215-source">
|
675
|
+
<pre>
|
676
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 356</span>
|
677
|
+
356: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_entry_class</span>; <span class="ruby-value str">"Hobix::Entry"</span>; <span class="ruby-keyword kw">end</span>
|
678
|
+
</pre>
|
679
|
+
</div>
|
680
|
+
</div>
|
681
|
+
</div>
|
682
|
+
|
683
|
+
<div id="method-M000209" class="method-detail">
|
684
|
+
<a name="M000209"></a>
|
685
|
+
|
686
|
+
<div class="method-heading">
|
687
|
+
<a href="#M000209" class="method-signature">
|
688
|
+
<span class="method-name">default_entry_path</span><span class="method-args">()</span>
|
689
|
+
</a>
|
690
|
+
</div>
|
691
|
+
|
692
|
+
<div class="method-description">
|
693
|
+
<p><a class="source-toggle" href="#"
|
694
|
+
onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
|
695
|
+
<div class="method-source-code" id="M000209-source">
|
696
|
+
<pre>
|
697
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 350</span>
|
698
|
+
350: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_entry_path</span>; <span class="ruby-value str">"entries"</span>; <span class="ruby-keyword kw">end</span>
|
699
|
+
</pre>
|
700
|
+
</div>
|
701
|
+
</div>
|
702
|
+
</div>
|
703
|
+
|
704
|
+
<div id="method-M000216" class="method-detail">
|
705
|
+
<a name="M000216"></a>
|
706
|
+
|
707
|
+
<div class="method-heading">
|
708
|
+
<a href="#M000216" class="method-signature">
|
709
|
+
<span class="method-name">default_index_class</span><span class="method-args">()</span>
|
710
|
+
</a>
|
711
|
+
</div>
|
712
|
+
|
713
|
+
<div class="method-description">
|
714
|
+
<p><a class="source-toggle" href="#"
|
715
|
+
onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
|
716
|
+
<div class="method-source-code" id="M000216-source">
|
717
|
+
<pre>
|
718
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 357</span>
|
719
|
+
357: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_index_class</span>; <span class="ruby-value str">"Hobix::IndexEntry"</span>; <span class="ruby-keyword kw">end</span>
|
720
|
+
</pre>
|
721
|
+
</div>
|
722
|
+
</div>
|
723
|
+
</div>
|
724
|
+
|
725
|
+
<div id="method-M000212" class="method-detail">
|
726
|
+
<a name="M000212"></a>
|
727
|
+
|
728
|
+
<div class="method-heading">
|
729
|
+
<a href="#M000212" class="method-signature">
|
730
|
+
<span class="method-name">default_lib_path</span><span class="method-args">()</span>
|
731
|
+
</a>
|
732
|
+
</div>
|
733
|
+
|
734
|
+
<div class="method-description">
|
735
|
+
<p><a class="source-toggle" href="#"
|
736
|
+
onclick="toggleCode('M000212-source');return false;">[Source]</a></p>
|
737
|
+
<div class="method-source-code" id="M000212-source">
|
738
|
+
<pre>
|
739
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 353</span>
|
740
|
+
353: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_lib_path</span>; <span class="ruby-value str">"lib"</span>; <span class="ruby-keyword kw">end</span>
|
741
|
+
</pre>
|
742
|
+
</div>
|
743
|
+
</div>
|
744
|
+
</div>
|
745
|
+
|
746
|
+
<div id="method-M000211" class="method-detail">
|
747
|
+
<a name="M000211"></a>
|
748
|
+
|
749
|
+
<div class="method-heading">
|
750
|
+
<a href="#M000211" class="method-signature">
|
751
|
+
<span class="method-name">default_output_path</span><span class="method-args">()</span>
|
752
|
+
</a>
|
753
|
+
</div>
|
754
|
+
|
755
|
+
<div class="method-description">
|
756
|
+
<p><a class="source-toggle" href="#"
|
757
|
+
onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
|
758
|
+
<div class="method-source-code" id="M000211-source">
|
759
|
+
<pre>
|
760
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 352</span>
|
761
|
+
352: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_output_path</span>; <span class="ruby-value str">"htdocs"</span>; <span class="ruby-keyword kw">end</span>
|
762
|
+
</pre>
|
763
|
+
</div>
|
764
|
+
</div>
|
765
|
+
</div>
|
766
|
+
|
767
|
+
<div id="method-M000210" class="method-detail">
|
768
|
+
<a name="M000210"></a>
|
769
|
+
|
770
|
+
<div class="method-heading">
|
771
|
+
<a href="#M000210" class="method-signature">
|
772
|
+
<span class="method-name">default_skel_path</span><span class="method-args">()</span>
|
773
|
+
</a>
|
774
|
+
</div>
|
775
|
+
|
776
|
+
<div class="method-description">
|
777
|
+
<p><a class="source-toggle" href="#"
|
778
|
+
onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
|
779
|
+
<div class="method-source-code" id="M000210-source">
|
780
|
+
<pre>
|
781
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 351</span>
|
782
|
+
351: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">default_skel_path</span>; <span class="ruby-value str">"skel"</span>; <span class="ruby-keyword kw">end</span>
|
783
|
+
</pre>
|
784
|
+
</div>
|
785
|
+
</div>
|
786
|
+
</div>
|
787
|
+
|
788
|
+
<div id="method-M000223" class="method-detail">
|
789
|
+
<a name="M000223"></a>
|
790
|
+
|
791
|
+
<div class="method-heading">
|
792
|
+
<a href="#M000223" class="method-signature">
|
793
|
+
<span class="method-name">entry_class</span><span class="method-args">( tag = nil )</span>
|
794
|
+
</a>
|
795
|
+
</div>
|
796
|
+
|
797
|
+
<div class="method-description">
|
798
|
+
<p><a class="source-toggle" href="#"
|
799
|
+
onclick="toggleCode('M000223-source');return false;">[Source]</a></p>
|
800
|
+
<div class="method-source-code" id="M000223-source">
|
801
|
+
<pre>
|
802
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 365</span>
|
803
|
+
365: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entry_class</span>( <span class="ruby-identifier">tag</span> = <span class="ruby-keyword kw">nil</span> )
|
804
|
+
366: <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@entry_class</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[\w:]+$/</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@entry_class</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">default_entry_class</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">tag</span>
|
805
|
+
367:
|
806
|
+
368: <span class="ruby-identifier">found_class</span> = <span class="ruby-keyword kw">nil</span>
|
807
|
+
369: <span class="ruby-identifier">raise</span> <span class="ruby-ivar">@@entry_classes</span>.<span class="ruby-identifier">inspect</span>
|
808
|
+
370: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@entry_classes</span>
|
809
|
+
371:
|
810
|
+
372: <span class="ruby-identifier">found_class</span> = <span class="ruby-ivar">@@entry_classes</span>.<span class="ruby-identifier">find</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
811
|
+
373: <span class="ruby-identifier">tag</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">name</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'::'</span> ).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
|
812
|
+
374: <span class="ruby-keyword kw">end</span>
|
813
|
+
375: <span class="ruby-keyword kw">end</span>
|
814
|
+
376:
|
815
|
+
377: <span class="ruby-keyword kw">begin</span>
|
816
|
+
378: <span class="ruby-identifier">found_class</span> <span class="ruby-operator">||</span> <span class="ruby-constant">Hobix</span>.<span class="ruby-identifier">const_find</span>( <span class="ruby-identifier">tag</span> )
|
817
|
+
379: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
818
|
+
380: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">"No such entry class #{ tag }"</span>
|
819
|
+
381: <span class="ruby-keyword kw">end</span>
|
820
|
+
382: <span class="ruby-keyword kw">end</span>
|
821
|
+
</pre>
|
822
|
+
</div>
|
823
|
+
</div>
|
824
|
+
</div>
|
825
|
+
|
826
|
+
<div id="method-M000217" class="method-detail">
|
827
|
+
<a name="M000217"></a>
|
828
|
+
|
829
|
+
<div class="method-heading">
|
830
|
+
<a href="#M000217" class="method-signature">
|
831
|
+
<span class="method-name">entry_path</span><span class="method-args">()</span>
|
832
|
+
</a>
|
833
|
+
</div>
|
834
|
+
|
835
|
+
<div class="method-description">
|
836
|
+
<p><a class="source-toggle" href="#"
|
837
|
+
onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
|
838
|
+
<div class="method-source-code" id="M000217-source">
|
839
|
+
<pre>
|
840
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 359</span>
|
841
|
+
359: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entry_path</span>; <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-ivar">@entry_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_entry_path</span>, <span class="ruby-ivar">@path</span> ).<span class="ruby-identifier">untaint</span>; <span class="ruby-keyword kw">end</span>
|
842
|
+
</pre>
|
843
|
+
</div>
|
844
|
+
</div>
|
845
|
+
</div>
|
846
|
+
|
847
|
+
<div id="method-M000227" class="method-detail">
|
848
|
+
<a name="M000227"></a>
|
849
|
+
|
850
|
+
<div class="method-heading">
|
851
|
+
<a href="#M000227" class="method-signature">
|
852
|
+
<span class="method-name">expand_path</span><span class="method-args">( path )</span>
|
853
|
+
</a>
|
854
|
+
</div>
|
855
|
+
|
856
|
+
<div class="method-description">
|
857
|
+
<p>
|
858
|
+
Translate paths relative to the weblahhg‘s URL. This is especially
|
859
|
+
important if a weblog isn‘t at the root directory for a domain.
|
860
|
+
</p>
|
861
|
+
<p><a class="source-toggle" href="#"
|
862
|
+
onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
|
863
|
+
<div class="method-source-code" id="M000227-source">
|
864
|
+
<pre>
|
865
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 406</span>
|
866
|
+
406: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">expand_path</span>( <span class="ruby-identifier">path</span> )
|
867
|
+
407: <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/^\/+/</span>, <span class="ruby-value str">''</span> ), <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">link</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/\/*$/</span>, <span class="ruby-value str">'/'</span> ) ).<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/^C:/</span>, <span class="ruby-value str">''</span>)
|
868
|
+
408: <span class="ruby-keyword kw">end</span>
|
869
|
+
</pre>
|
870
|
+
</div>
|
871
|
+
</div>
|
872
|
+
</div>
|
873
|
+
|
874
|
+
<div id="method-M000236" class="method-detail">
|
875
|
+
<a name="M000236"></a>
|
876
|
+
|
877
|
+
<div class="method-heading">
|
878
|
+
<a href="#M000236" class="method-signature">
|
879
|
+
<span class="method-name">facet_for</span><span class="method-args">( app )</span>
|
880
|
+
</a>
|
881
|
+
</div>
|
882
|
+
|
883
|
+
<div class="method-description">
|
884
|
+
<p><a class="source-toggle" href="#"
|
885
|
+
onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
|
886
|
+
<div class="method-source-code" id="M000236-source">
|
887
|
+
<pre>
|
888
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 489</span>
|
889
|
+
489: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">facet_for</span>( <span class="ruby-identifier">app</span> )
|
890
|
+
490: <span class="ruby-identifier">facets</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">get</span> <span class="ruby-identifier">app</span> }
|
891
|
+
491: <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">BaseFacet</span>.<span class="ruby-identifier">not_found</span> <span class="ruby-identifier">app</span>
|
892
|
+
492: <span class="ruby-keyword kw">end</span>
|
893
|
+
</pre>
|
894
|
+
</div>
|
895
|
+
</div>
|
896
|
+
</div>
|
897
|
+
|
898
|
+
<div id="method-M000235" class="method-detail">
|
899
|
+
<a name="M000235"></a>
|
900
|
+
|
901
|
+
<div class="method-heading">
|
902
|
+
<a href="#M000235" class="method-signature">
|
903
|
+
<span class="method-name">facets</span><span class="method-args">()</span>
|
904
|
+
</a>
|
905
|
+
</div>
|
906
|
+
|
907
|
+
<div class="method-description">
|
908
|
+
<p>
|
909
|
+
Returns an Array of all facet plugins in use. (There can be many.)
|
910
|
+
</p>
|
911
|
+
<p><a class="source-toggle" href="#"
|
912
|
+
onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
|
913
|
+
<div class="method-source-code" id="M000235-source">
|
914
|
+
<pre>
|
915
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 485</span>
|
916
|
+
485: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">facets</span>
|
917
|
+
486: <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">BaseFacet</span> }
|
918
|
+
487: <span class="ruby-keyword kw">end</span>
|
919
|
+
</pre>
|
920
|
+
</div>
|
921
|
+
</div>
|
922
|
+
</div>
|
923
|
+
|
924
|
+
<div id="method-M000224" class="method-detail">
|
925
|
+
<a name="M000224"></a>
|
926
|
+
|
927
|
+
<div class="method-heading">
|
928
|
+
<a href="#M000224" class="method-signature">
|
929
|
+
<span class="method-name">index_class</span><span class="method-args">( tag = nil )</span>
|
930
|
+
</a>
|
931
|
+
</div>
|
932
|
+
|
933
|
+
<div class="method-description">
|
934
|
+
<p><a class="source-toggle" href="#"
|
935
|
+
onclick="toggleCode('M000224-source');return false;">[Source]</a></p>
|
936
|
+
<div class="method-source-code" id="M000224-source">
|
937
|
+
<pre>
|
938
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 383</span>
|
939
|
+
383: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">index_class</span>( <span class="ruby-identifier">tag</span> = <span class="ruby-keyword kw">nil</span> )
|
940
|
+
384: <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@index_class</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^[\w:]+$/</span> <span class="ruby-operator">?</span> <span class="ruby-ivar">@index_class</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">default_index_class</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">tag</span>
|
941
|
+
385: <span class="ruby-keyword kw">begin</span>
|
942
|
+
386: <span class="ruby-constant">Hobix</span>.<span class="ruby-identifier">const_find</span>( <span class="ruby-identifier">tag</span> )
|
943
|
+
387: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">NameError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
944
|
+
388: <span class="ruby-identifier">raise</span> <span class="ruby-constant">NameError</span>, <span class="ruby-node">"No such index class #{ tag }"</span>
|
945
|
+
389: <span class="ruby-keyword kw">end</span>
|
946
|
+
390: <span class="ruby-keyword kw">end</span>
|
947
|
+
</pre>
|
948
|
+
</div>
|
949
|
+
</div>
|
950
|
+
</div>
|
951
|
+
|
952
|
+
<div id="method-M000253" class="method-detail">
|
953
|
+
<a name="M000253"></a>
|
954
|
+
|
955
|
+
<div class="method-heading">
|
956
|
+
<a href="#M000253" class="method-signature">
|
957
|
+
<span class="method-name">join_path</span><span class="method-args">( prefix, suffix )</span>
|
958
|
+
</a>
|
959
|
+
</div>
|
960
|
+
|
961
|
+
<div class="method-description">
|
962
|
+
<p><a class="source-toggle" href="#"
|
963
|
+
onclick="toggleCode('M000253-source');return false;">[Source]</a></p>
|
964
|
+
<div class="method-source-code" id="M000253-source">
|
965
|
+
<pre>
|
966
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 832</span>
|
967
|
+
832: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">join_path</span>( <span class="ruby-identifier">prefix</span>, <span class="ruby-identifier">suffix</span> )
|
968
|
+
833: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">prefix</span>
|
969
|
+
834: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">''</span>, <span class="ruby-value str">'.'</span>
|
970
|
+
835: <span class="ruby-identifier">suffix</span>
|
971
|
+
836: <span class="ruby-keyword kw">else</span>
|
972
|
+
837: <span class="ruby-node">"#{ prefix }/#{ suffix }"</span>
|
973
|
+
838: <span class="ruby-keyword kw">end</span>
|
974
|
+
839: <span class="ruby-keyword kw">end</span>
|
975
|
+
</pre>
|
976
|
+
</div>
|
977
|
+
</div>
|
978
|
+
</div>
|
979
|
+
|
980
|
+
<div id="method-M000220" class="method-detail">
|
981
|
+
<a name="M000220"></a>
|
982
|
+
|
983
|
+
<div class="method-heading">
|
984
|
+
<a href="#M000220" class="method-signature">
|
985
|
+
<span class="method-name">lib_path</span><span class="method-args">()</span>
|
986
|
+
</a>
|
987
|
+
</div>
|
988
|
+
|
989
|
+
<div class="method-description">
|
990
|
+
<p><a class="source-toggle" href="#"
|
991
|
+
onclick="toggleCode('M000220-source');return false;">[Source]</a></p>
|
992
|
+
<div class="method-source-code" id="M000220-source">
|
993
|
+
<pre>
|
994
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 362</span>
|
995
|
+
362: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lib_path</span>; <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-ivar">@lib_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_lib_path</span>, <span class="ruby-ivar">@path</span> ).<span class="ruby-identifier">untaint</span>; <span class="ruby-keyword kw">end</span>
|
996
|
+
</pre>
|
997
|
+
</div>
|
998
|
+
</div>
|
999
|
+
</div>
|
1000
|
+
|
1001
|
+
<div id="method-M000225" class="method-detail">
|
1002
|
+
<a name="M000225"></a>
|
1003
|
+
|
1004
|
+
<div class="method-heading">
|
1005
|
+
<a href="#M000225" class="method-signature">
|
1006
|
+
<span class="method-name">link</span><span class="method-args">()</span>
|
1007
|
+
</a>
|
1008
|
+
</div>
|
1009
|
+
|
1010
|
+
<div class="method-description">
|
1011
|
+
<p><a class="source-toggle" href="#"
|
1012
|
+
onclick="toggleCode('M000225-source');return false;">[Source]</a></p>
|
1013
|
+
<div class="method-source-code" id="M000225-source">
|
1014
|
+
<pre>
|
1015
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 392</span>
|
1016
|
+
392: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">link</span>
|
1017
|
+
393: <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse</span>( <span class="ruby-ivar">@link</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/\/$/</span>, <span class="ruby-value str">''</span> ) ).<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">UriStr</span>
|
1018
|
+
394: <span class="ruby-keyword kw">end</span>
|
1019
|
+
</pre>
|
1020
|
+
</div>
|
1021
|
+
</div>
|
1022
|
+
</div>
|
1023
|
+
|
1024
|
+
<div id="method-M000226" class="method-detail">
|
1025
|
+
<a name="M000226"></a>
|
1026
|
+
|
1027
|
+
<div class="method-heading">
|
1028
|
+
<a href="#M000226" class="method-signature">
|
1029
|
+
<span class="method-name">linklist</span><span class="method-args">()</span>
|
1030
|
+
</a>
|
1031
|
+
</div>
|
1032
|
+
|
1033
|
+
<div class="method-description">
|
1034
|
+
<p><a class="source-toggle" href="#"
|
1035
|
+
onclick="toggleCode('M000226-source');return false;">[Source]</a></p>
|
1036
|
+
<div class="method-source-code" id="M000226-source">
|
1037
|
+
<pre>
|
1038
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 396</span>
|
1039
|
+
396: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">linklist</span>
|
1040
|
+
397: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@linklist</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-operator">::</span><span class="ruby-constant">Array</span>
|
1041
|
+
398: <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">transfer</span>( <span class="ruby-value str">'hobix.com,2004/linklist'</span>, {<span class="ruby-value str">'links'</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@linklist</span>} )
|
1042
|
+
399: <span class="ruby-keyword kw">else</span>
|
1043
|
+
400: <span class="ruby-ivar">@linklist</span>
|
1044
|
+
401: <span class="ruby-keyword kw">end</span>
|
1045
|
+
402: <span class="ruby-keyword kw">end</span>
|
1046
|
+
</pre>
|
1047
|
+
</div>
|
1048
|
+
</div>
|
1049
|
+
</div>
|
1050
|
+
|
1051
|
+
<div id="method-M000254" class="method-detail">
|
1052
|
+
<a name="M000254"></a>
|
1053
|
+
|
1054
|
+
<div class="method-heading">
|
1055
|
+
<a href="#M000254" class="method-signature">
|
1056
|
+
<span class="method-name">load_and_validate_entry</span><span class="method-args">( entry_id )</span>
|
1057
|
+
</a>
|
1058
|
+
</div>
|
1059
|
+
|
1060
|
+
<div class="method-description">
|
1061
|
+
<p>
|
1062
|
+
Loads an entry from <tt><a href="Weblog.html#M000232">storage</a></tt>,
|
1063
|
+
first validating that the author is listed in the weblog config.
|
1064
|
+
</p>
|
1065
|
+
<p><a class="source-toggle" href="#"
|
1066
|
+
onclick="toggleCode('M000254-source');return false;">[Source]</a></p>
|
1067
|
+
<div class="method-source-code" id="M000254-source">
|
1068
|
+
<pre>
|
1069
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 845</span>
|
1070
|
+
845: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_and_validate_entry</span>( <span class="ruby-identifier">entry_id</span> )
|
1071
|
+
846: <span class="ruby-identifier">entry</span> = <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">load_entry</span>( <span class="ruby-identifier">entry_id</span> )
|
1072
|
+
847: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">authors</span>.<span class="ruby-identifier">has_key?</span>( <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">author</span> )
|
1073
|
+
848: <span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthorNotFound</span>, <span class="ruby-node">"Invalid author '#{ entry.author }' found in entry #{ entry_id }"</span>
|
1074
|
+
849: <span class="ruby-keyword kw">end</span>
|
1075
|
+
850: <span class="ruby-identifier">entry</span>
|
1076
|
+
851: <span class="ruby-keyword kw">end</span>
|
1077
|
+
</pre>
|
1078
|
+
</div>
|
1079
|
+
</div>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
<div id="method-M000256" class="method-detail">
|
1083
|
+
<a name="M000256"></a>
|
1084
|
+
|
1085
|
+
<div class="method-heading">
|
1086
|
+
<a href="#M000256" class="method-signature">
|
1087
|
+
<span class="method-name">method_missing</span><span class="method-args">( methId, *args )</span>
|
1088
|
+
</a>
|
1089
|
+
</div>
|
1090
|
+
|
1091
|
+
<div class="method-description">
|
1092
|
+
<p>
|
1093
|
+
For convenience, <a href="Weblog.html#M000232">storage</a> queries can be
|
1094
|
+
made through the <a href="Weblog.html">Weblog</a> class. Queries will
|
1095
|
+
return the full <a href="Entry.html">Entry</a> data, though, so it‘s
|
1096
|
+
best to use this only when you‘re scripting and need data quick.
|
1097
|
+
</p>
|
1098
|
+
<p><a class="source-toggle" href="#"
|
1099
|
+
onclick="toggleCode('M000256-source');return false;">[Source]</a></p>
|
1100
|
+
<div class="method-source-code" id="M000256-source">
|
1101
|
+
<pre>
|
1102
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 861</span>
|
1103
|
+
861: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>( <span class="ruby-identifier">methId</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> )
|
1104
|
+
862: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">methId</span>
|
1105
|
+
863: <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">method</span>( <span class="ruby-identifier">methId</span> ).<span class="ruby-identifier">call</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">args</span> ).<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
1106
|
+
864: <span class="ruby-identifier">load_and_validate_entry</span>( <span class="ruby-identifier">e</span>.<span class="ruby-identifier">id</span> )
|
1107
|
+
865: <span class="ruby-keyword kw">end</span>
|
1108
|
+
866: <span class="ruby-keyword kw">end</span>
|
1109
|
+
867: <span class="ruby-keyword kw">end</span>
|
1110
|
+
</pre>
|
1111
|
+
</div>
|
1112
|
+
</div>
|
1113
|
+
</div>
|
1114
|
+
|
1115
|
+
<div id="method-M000239" class="method-detail">
|
1116
|
+
<a name="M000239"></a>
|
1117
|
+
|
1118
|
+
<div class="method-heading">
|
1119
|
+
<a href="#M000239" class="method-signature">
|
1120
|
+
<span class="method-name">output_entry_map</span><span class="method-args">()</span>
|
1121
|
+
</a>
|
1122
|
+
</div>
|
1123
|
+
|
1124
|
+
<div class="method-description">
|
1125
|
+
<p>
|
1126
|
+
Built from the map of output destinations described by <tt><a
|
1127
|
+
href="Weblog.html#M000238">output_map</a></tt>, this map pairs entry IDs
|
1128
|
+
against their canonical destinations. The @<a
|
1129
|
+
href="Weblog.html#M000221">central_prefix</a> and @<a
|
1130
|
+
href="Weblog.html#M000222">central_ext</a> variables determine what output
|
1131
|
+
is canonical.
|
1132
|
+
</p>
|
1133
|
+
<p><a class="source-toggle" href="#"
|
1134
|
+
onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
|
1135
|
+
<div class="method-source-code" id="M000239-source">
|
1136
|
+
<pre>
|
1137
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 552</span>
|
1138
|
+
552: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_entry_map</span>
|
1139
|
+
553: <span class="ruby-identifier">output_map</span>
|
1140
|
+
554: <span class="ruby-ivar">@output_entry_map</span>
|
1141
|
+
555: <span class="ruby-keyword kw">end</span>
|
1142
|
+
</pre>
|
1143
|
+
</div>
|
1144
|
+
</div>
|
1145
|
+
</div>
|
1146
|
+
|
1147
|
+
<div id="method-M000238" class="method-detail">
|
1148
|
+
<a name="M000238"></a>
|
1149
|
+
|
1150
|
+
<div class="method-heading">
|
1151
|
+
<a href="#M000238" class="method-signature">
|
1152
|
+
<span class="method-name">output_map</span><span class="method-args">()</span>
|
1153
|
+
</a>
|
1154
|
+
</div>
|
1155
|
+
|
1156
|
+
<div class="method-description">
|
1157
|
+
<p>
|
1158
|
+
Reads <tt><a href="Weblog.html#M000218">skel_path</a></tt> for templates
|
1159
|
+
and builds a hash of all the various output files which will be generated.
|
1160
|
+
This method will cache the <a href="Weblog.html#M000238">output_map</a>
|
1161
|
+
once. Subsequent calls to <tt><a
|
1162
|
+
href="Weblog.html#M000238">output_map</a></tt> will quickly return the
|
1163
|
+
cached hash. To reset the cache, use <tt><a
|
1164
|
+
href="Weblog.html#M000237">reset_output_map</a></tt>.
|
1165
|
+
</p>
|
1166
|
+
<p><a class="source-toggle" href="#"
|
1167
|
+
onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
|
1168
|
+
<div class="method-source-code" id="M000238-source">
|
1169
|
+
<pre>
|
1170
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 501</span>
|
1171
|
+
501: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_map</span>
|
1172
|
+
502: <span class="ruby-ivar">@output_map</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">nil</span>
|
1173
|
+
503: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@output_map</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@output_map</span>
|
1174
|
+
504: <span class="ruby-identifier">path_watch</span> = {}
|
1175
|
+
505: <span class="ruby-ivar">@output_entry_map</span> = {}
|
1176
|
+
506: <span class="ruby-constant">Find</span><span class="ruby-operator">::</span><span class="ruby-identifier">find</span>( <span class="ruby-identifier">skel_path</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path</span><span class="ruby-operator">|</span>
|
1177
|
+
507: <span class="ruby-identifier">path</span>.<span class="ruby-identifier">untaint</span>
|
1178
|
+
508: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>)[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?.</span>
|
1179
|
+
509: <span class="ruby-constant">Find</span>.<span class="ruby-identifier">prune</span>
|
1180
|
+
510: <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">not</span> <span class="ruby-constant">FileTest</span>.<span class="ruby-identifier">directory?</span> <span class="ruby-identifier">path</span>
|
1181
|
+
511: <span class="ruby-identifier">tpl_path</span> = <span class="ruby-identifier">path</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-node">/^#{ Regexp::quote( skel_path ) }\/?/</span>, <span class="ruby-value str">''</span> )
|
1182
|
+
512: <span class="ruby-identifier">output</span> = <span class="ruby-identifier">outputs</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tpl_path</span> <span class="ruby-operator">=~</span> <span class="ruby-node">/\.#{ p.extension }$/</span>; <span class="ruby-identifier">tpl_path</span> = <span class="ruby-identifier">$`</span>; <span class="ruby-keyword kw">end</span> }
|
1183
|
+
513: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">output</span>
|
1184
|
+
514: <span class="ruby-comment cmt">## Figure out template extension and output filename</span>
|
1185
|
+
515: <span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">tpl_ext</span> = <span class="ruby-identifier">tpl_path</span>.<span class="ruby-identifier">dup</span>, <span class="ruby-value str">''</span>
|
1186
|
+
516: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">page_name</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\.\w+$/</span>; <span class="ruby-identifier">page_name</span> = <span class="ruby-identifier">$`</span>; <span class="ruby-identifier">tpl_ext</span> = <span class="ruby-identifier">$&</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">tpl_ext</span>; <span class="ruby-keyword kw">end</span>
|
1187
|
+
517: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tpl_ext</span>.<span class="ruby-identifier">empty?</span>
|
1188
|
+
518: <span class="ruby-comment cmt">## Build the output pages</span>
|
1189
|
+
519: <span class="ruby-identifier">build_pages</span>( <span class="ruby-identifier">page_name</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">vars</span><span class="ruby-operator">|</span>
|
1190
|
+
520: <span class="ruby-comment cmt">## Extension and Path</span>
|
1191
|
+
521: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">add_ext</span>( <span class="ruby-identifier">tpl_ext</span> )
|
1192
|
+
522: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:template</span>] = <span class="ruby-identifier">path</span>
|
1193
|
+
523: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:output</span>] = <span class="ruby-identifier">output</span>
|
1194
|
+
524: <span class="ruby-identifier">eid</span> = ( <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:entry</span>] <span class="ruby-operator">&&</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:entry</span>].<span class="ruby-identifier">id</span> ) <span class="ruby-operator">||</span> <span class="ruby-identifier">page_name</span>
|
1195
|
+
525: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@output_entry_map</span>[ <span class="ruby-identifier">eid</span> ]
|
1196
|
+
526: <span class="ruby-ivar">@output_entry_map</span>[ <span class="ruby-identifier">eid</span> ] = <span class="ruby-identifier">vars</span>
|
1197
|
+
527: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">tpl_ext</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'.'</span> )[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">central_ext</span>
|
1198
|
+
528: <span class="ruby-ivar">@output_entry_map</span>[ <span class="ruby-identifier">eid</span> ] = <span class="ruby-identifier">vars</span>
|
1199
|
+
529: <span class="ruby-keyword kw">end</span>
|
1200
|
+
530:
|
1201
|
+
531: <span class="ruby-comment cmt">## If output by a deeper page, skip</span>
|
1202
|
+
532: <span class="ruby-identifier">pub_name</span>, = <span class="ruby-identifier">path_watch</span>[<span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>]
|
1203
|
+
533: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">pub_name</span> <span class="ruby-keyword kw">and</span> <span class="ruby-operator">!</span>( <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>.<span class="ruby-identifier">index</span>( <span class="ruby-identifier">page_name</span> ) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-keyword kw">and</span>
|
1204
|
+
534: <span class="ruby-identifier">page_name</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-identifier">pub_name</span>.<span class="ruby-identifier">length</span> )
|
1205
|
+
535:
|
1206
|
+
536: <span class="ruby-identifier">path_watch</span>[<span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>] = [<span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">vars</span>]
|
1207
|
+
537: <span class="ruby-keyword kw">end</span>
|
1208
|
+
538: <span class="ruby-keyword kw">end</span>
|
1209
|
+
539: <span class="ruby-keyword kw">end</span>
|
1210
|
+
540: <span class="ruby-keyword kw">end</span>
|
1211
|
+
541: <span class="ruby-ivar">@output_map</span> = {}
|
1212
|
+
542: <span class="ruby-identifier">path_watch</span>.<span class="ruby-identifier">each_value</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">vars</span><span class="ruby-operator">|</span>
|
1213
|
+
543: <span class="ruby-ivar">@output_map</span>[<span class="ruby-identifier">page_name</span>] <span class="ruby-operator">||=</span> []
|
1214
|
+
544: <span class="ruby-ivar">@output_map</span>[<span class="ruby-identifier">page_name</span>] <span class="ruby-operator"><<</span> <span class="ruby-identifier">vars</span>
|
1215
|
+
545: <span class="ruby-keyword kw">end</span>
|
1216
|
+
546: <span class="ruby-ivar">@output_map</span>
|
1217
|
+
547: <span class="ruby-keyword kw">end</span>
|
1218
|
+
</pre>
|
1219
|
+
</div>
|
1220
|
+
</div>
|
1221
|
+
</div>
|
1222
|
+
|
1223
|
+
<div id="method-M000219" class="method-detail">
|
1224
|
+
<a name="M000219"></a>
|
1225
|
+
|
1226
|
+
<div class="method-heading">
|
1227
|
+
<a href="#M000219" class="method-signature">
|
1228
|
+
<span class="method-name">output_path</span><span class="method-args">()</span>
|
1229
|
+
</a>
|
1230
|
+
</div>
|
1231
|
+
|
1232
|
+
<div class="method-description">
|
1233
|
+
<p><a class="source-toggle" href="#"
|
1234
|
+
onclick="toggleCode('M000219-source');return false;">[Source]</a></p>
|
1235
|
+
<div class="method-source-code" id="M000219-source">
|
1236
|
+
<pre>
|
1237
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 361</span>
|
1238
|
+
361: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">output_path</span>; <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-ivar">@output_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_output_path</span>, <span class="ruby-ivar">@path</span> ).<span class="ruby-identifier">untaint</span>; <span class="ruby-keyword kw">end</span>
|
1239
|
+
</pre>
|
1240
|
+
</div>
|
1241
|
+
</div>
|
1242
|
+
</div>
|
1243
|
+
|
1244
|
+
<div id="method-M000233" class="method-detail">
|
1245
|
+
<a name="M000233"></a>
|
1246
|
+
|
1247
|
+
<div class="method-heading">
|
1248
|
+
<a href="#M000233" class="method-signature">
|
1249
|
+
<span class="method-name">outputs</span><span class="method-args">()</span>
|
1250
|
+
</a>
|
1251
|
+
</div>
|
1252
|
+
|
1253
|
+
<div class="method-description">
|
1254
|
+
<p>
|
1255
|
+
Returns an Array of all output plugins in use. (There can be many.)
|
1256
|
+
</p>
|
1257
|
+
<p><a class="source-toggle" href="#"
|
1258
|
+
onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
|
1259
|
+
<div class="method-source-code" id="M000233-source">
|
1260
|
+
<pre>
|
1261
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 473</span>
|
1262
|
+
473: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">outputs</span>
|
1263
|
+
474: <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">BaseOutput</span> }
|
1264
|
+
475: <span class="ruby-keyword kw">end</span>
|
1265
|
+
</pre>
|
1266
|
+
</div>
|
1267
|
+
</div>
|
1268
|
+
</div>
|
1269
|
+
|
1270
|
+
<div id="method-M000257" class="method-detail">
|
1271
|
+
<a name="M000257"></a>
|
1272
|
+
|
1273
|
+
<div class="method-heading">
|
1274
|
+
<a href="#M000257" class="method-signature">
|
1275
|
+
<span class="method-name">p_publish</span><span class="method-args">( obj )</span>
|
1276
|
+
</a>
|
1277
|
+
</div>
|
1278
|
+
|
1279
|
+
<div class="method-description">
|
1280
|
+
<p>
|
1281
|
+
Prints publication information the screen. Override this if you want to
|
1282
|
+
suppress output or change the display.
|
1283
|
+
</p>
|
1284
|
+
<p><a class="source-toggle" href="#"
|
1285
|
+
onclick="toggleCode('M000257-source');return false;">[Source]</a></p>
|
1286
|
+
<div class="method-source-code" id="M000257-source">
|
1287
|
+
<pre>
|
1288
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 871</span>
|
1289
|
+
871: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">p_publish</span>( <span class="ruby-identifier">obj</span> )
|
1290
|
+
872: <span class="ruby-identifier">puts</span> <span class="ruby-node">"## Page: #{ obj.link }, updated #{ obj.updated }"</span>
|
1291
|
+
873: <span class="ruby-keyword kw">end</span>
|
1292
|
+
</pre>
|
1293
|
+
</div>
|
1294
|
+
</div>
|
1295
|
+
</div>
|
1296
|
+
|
1297
|
+
<div id="method-M000234" class="method-detail">
|
1298
|
+
<a name="M000234"></a>
|
1299
|
+
|
1300
|
+
<div class="method-heading">
|
1301
|
+
<a href="#M000234" class="method-signature">
|
1302
|
+
<span class="method-name">publishers</span><span class="method-args">()</span>
|
1303
|
+
</a>
|
1304
|
+
</div>
|
1305
|
+
|
1306
|
+
<div class="method-description">
|
1307
|
+
<p>
|
1308
|
+
Returns an Array of all publisher plugins in use. (There can be many.)
|
1309
|
+
</p>
|
1310
|
+
<p><a class="source-toggle" href="#"
|
1311
|
+
onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
|
1312
|
+
<div class="method-source-code" id="M000234-source">
|
1313
|
+
<pre>
|
1314
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 479</span>
|
1315
|
+
479: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">publishers</span>
|
1316
|
+
480: <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">BasePublish</span> }
|
1317
|
+
481: <span class="ruby-keyword kw">end</span>
|
1318
|
+
</pre>
|
1319
|
+
</div>
|
1320
|
+
</div>
|
1321
|
+
</div>
|
1322
|
+
|
1323
|
+
<div id="method-M000240" class="method-detail">
|
1324
|
+
<a name="M000240"></a>
|
1325
|
+
|
1326
|
+
<div class="method-heading">
|
1327
|
+
<a href="#M000240" class="method-signature">
|
1328
|
+
<span class="method-name">regenerate</span><span class="method-args">( how = nil )</span>
|
1329
|
+
</a>
|
1330
|
+
</div>
|
1331
|
+
|
1332
|
+
<div class="method-description">
|
1333
|
+
<p>
|
1334
|
+
Regenerates the weblog, processing templates in <tt><a
|
1335
|
+
href="Weblog.html#M000218">skel_path</a></tt> with the data found in <tt><a
|
1336
|
+
href="Weblog.html#M000217">entry_path</a></tt>, storing output in <tt><a
|
1337
|
+
href="Weblog.html#M000219">output_path</a></tt>.
|
1338
|
+
</p>
|
1339
|
+
<p>
|
1340
|
+
The <em>how</em> parameter dictates how this is done, Currently, if
|
1341
|
+
<em>how</em> is nil the weblog is completely regen‘d. If it is
|
1342
|
+
:update, the weblog is only upgen‘d.
|
1343
|
+
</p>
|
1344
|
+
<h2>How Updates Work</h2>
|
1345
|
+
<p>
|
1346
|
+
It‘s very important to know how updates work, especially if you are
|
1347
|
+
writing custom skel methods or devious new kinds of templates. When
|
1348
|
+
performing an update, this method will skip pages if the following
|
1349
|
+
conditions are met:
|
1350
|
+
</p>
|
1351
|
+
<ol>
|
1352
|
+
<li>The <a href="Page.html">Page</a> object for a given output page must have
|
1353
|
+
its <tt>updated</tt> timestamp set.
|
1354
|
+
|
1355
|
+
</li>
|
1356
|
+
<li>The output file pointed to by the <a href="Page.html">Page</a> object must
|
1357
|
+
already exist.
|
1358
|
+
|
1359
|
+
</li>
|
1360
|
+
<li>The <tt>updated</tt> timestamp must be older than than the modification
|
1361
|
+
time of the output file.
|
1362
|
+
|
1363
|
+
</li>
|
1364
|
+
<li>The modification time of the input template must be older than than the
|
1365
|
+
modification time of the output file.
|
1366
|
+
|
1367
|
+
</li>
|
1368
|
+
</ol>
|
1369
|
+
<p>
|
1370
|
+
To ensure that your custom methods and templates are qualifying to be
|
1371
|
+
skipped on an upgen, be sure to set the <tt>updated</tt> timestamp of the
|
1372
|
+
<a href="Page.html">Page</a> object to the latest date of the
|
1373
|
+
content‘s modification.
|
1374
|
+
</p>
|
1375
|
+
<p><a class="source-toggle" href="#"
|
1376
|
+
onclick="toggleCode('M000240-source');return false;">[Source]</a></p>
|
1377
|
+
<div class="method-source-code" id="M000240-source">
|
1378
|
+
<pre>
|
1379
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 585</span>
|
1380
|
+
585: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">regenerate</span>( <span class="ruby-identifier">how</span> = <span class="ruby-keyword kw">nil</span> )
|
1381
|
+
586: <span class="ruby-identifier">retouch</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">how</span>
|
1382
|
+
587: <span class="ruby-keyword kw">end</span>
|
1383
|
+
</pre>
|
1384
|
+
</div>
|
1385
|
+
</div>
|
1386
|
+
</div>
|
1387
|
+
|
1388
|
+
<div id="method-M000237" class="method-detail">
|
1389
|
+
<a name="M000237"></a>
|
1390
|
+
|
1391
|
+
<div class="method-heading">
|
1392
|
+
<a href="#M000237" class="method-signature">
|
1393
|
+
<span class="method-name">reset_output_map</span><span class="method-args">()</span>
|
1394
|
+
</a>
|
1395
|
+
</div>
|
1396
|
+
|
1397
|
+
<div class="method-description">
|
1398
|
+
<p>
|
1399
|
+
Clears the hash used to cache the results of <tt><a
|
1400
|
+
href="Weblog.html#M000238">output_map</a></tt>.
|
1401
|
+
</p>
|
1402
|
+
<p><a class="source-toggle" href="#"
|
1403
|
+
onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
|
1404
|
+
<div class="method-source-code" id="M000237-source">
|
1405
|
+
<pre>
|
1406
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 495</span>
|
1407
|
+
495: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reset_output_map</span>; <span class="ruby-ivar">@output_map</span> = <span class="ruby-keyword kw">nil</span>; <span class="ruby-keyword kw">end</span>
|
1408
|
+
</pre>
|
1409
|
+
</div>
|
1410
|
+
</div>
|
1411
|
+
</div>
|
1412
|
+
|
1413
|
+
<div id="method-M000241" class="method-detail">
|
1414
|
+
<a name="M000241"></a>
|
1415
|
+
|
1416
|
+
<div class="method-heading">
|
1417
|
+
<a href="#M000241" class="method-signature">
|
1418
|
+
<span class="method-name">retouch</span><span class="method-args">( only_path = nil, how = nil )</span>
|
1419
|
+
</a>
|
1420
|
+
</div>
|
1421
|
+
|
1422
|
+
<div class="method-description">
|
1423
|
+
<p><a class="source-toggle" href="#"
|
1424
|
+
onclick="toggleCode('M000241-source');return false;">[Source]</a></p>
|
1425
|
+
<div class="method-source-code" id="M000241-source">
|
1426
|
+
<pre>
|
1427
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 588</span>
|
1428
|
+
588: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">retouch</span>( <span class="ruby-identifier">only_path</span> = <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">how</span> = <span class="ruby-keyword kw">nil</span> )
|
1429
|
+
589: <span class="ruby-identifier">published</span> = {}
|
1430
|
+
590: <span class="ruby-identifier">published_types</span> = []
|
1431
|
+
591: <span class="ruby-identifier">output_map</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">page_name</span>, <span class="ruby-identifier">outputs</span><span class="ruby-operator">|</span>
|
1432
|
+
592: <span class="ruby-identifier">puts</span> <span class="ruby-node">"[Building #{ page_name } pages]"</span>
|
1433
|
+
593: <span class="ruby-identifier">outputs</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">vars</span><span class="ruby-operator">|</span>
|
1434
|
+
594: <span class="ruby-identifier">full_out_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-identifier">output_path</span>, <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'/'</span> ) )
|
1435
|
+
595: <span class="ruby-comment cmt">## If retouching, skip pages outside of path</span>
|
1436
|
+
596: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">only_path</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>.<span class="ruby-identifier">index</span>( <span class="ruby-value str">"/"</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">only_path</span> ) <span class="ruby-operator">!=</span> <span class="ruby-value">0</span>
|
1437
|
+
597:
|
1438
|
+
598: <span class="ruby-comment cmt">## If updating, skip any that are unchanged</span>
|
1439
|
+
599: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">how</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:update</span> <span class="ruby-keyword kw">and</span>
|
1440
|
+
600: <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>( <span class="ruby-identifier">full_out_path</span> ) <span class="ruby-keyword kw">and</span>
|
1441
|
+
601: <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>( <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:template</span>] ) <span class="ruby-operator"><</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>( <span class="ruby-identifier">full_out_path</span> ) <span class="ruby-keyword kw">and</span>
|
1442
|
+
602: ( <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">updated</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span>
|
1443
|
+
603: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">updated</span> <span class="ruby-operator"><</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">mtime</span>( <span class="ruby-identifier">full_out_path</span> ) )
|
1444
|
+
604:
|
1445
|
+
605: <span class="ruby-identifier">p_publish</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>]
|
1446
|
+
606: <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var_name</span><span class="ruby-operator">|</span>
|
1447
|
+
607: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">var_name</span>.<span class="ruby-identifier">to_s</span>
|
1448
|
+
608: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/entry$/</span>
|
1449
|
+
609: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:no_load</span>]
|
1450
|
+
610: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">var_name</span>] = <span class="ruby-identifier">load_and_validate_entry</span>( <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">var_name</span>].<span class="ruby-identifier">id</span> )
|
1451
|
+
611: <span class="ruby-keyword kw">end</span>
|
1452
|
+
612: <span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/entries$/</span>
|
1453
|
+
613: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:no_load</span>]
|
1454
|
+
614: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">var_name</span>].<span class="ruby-identifier">collect!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
|
1455
|
+
615: <span class="ruby-identifier">load_and_validate_entry</span>( <span class="ruby-identifier">e</span>.<span class="ruby-identifier">id</span> )
|
1456
|
+
616: <span class="ruby-keyword kw">end</span>
|
1457
|
+
617: <span class="ruby-keyword kw">end</span>
|
1458
|
+
618: <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">var_name</span>].<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">EntryEnum</span>
|
1459
|
+
619: <span class="ruby-keyword kw">end</span>
|
1460
|
+
620: <span class="ruby-keyword kw">end</span>
|
1461
|
+
621:
|
1462
|
+
622: <span class="ruby-comment cmt">## Publish the page</span>
|
1463
|
+
623: <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">dup</span>
|
1464
|
+
624: <span class="ruby-identifier">output</span> = <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">:output</span> )
|
1465
|
+
625: <span class="ruby-identifier">template</span> = <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">delete</span>( <span class="ruby-identifier">:template</span> )
|
1466
|
+
626: <span class="ruby-identifier">txt</span> = <span class="ruby-identifier">output</span>.<span class="ruby-identifier">load</span>( <span class="ruby-identifier">template</span>, <span class="ruby-identifier">vars</span> )
|
1467
|
+
627: <span class="ruby-comment cmt">## A plugin perhaps needs to change the output page name</span>
|
1468
|
+
628: <span class="ruby-identifier">full_out_path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-identifier">output_path</span>, <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'/'</span> ) )
|
1469
|
+
629: <span class="ruby-identifier">saved_umask</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">umask</span>( <span class="ruby-value">0002</span> ) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
1470
|
+
630: <span class="ruby-keyword kw">begin</span>
|
1471
|
+
631: <span class="ruby-constant">File</span>.<span class="ruby-identifier">makedirs</span>( <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">full_out_path</span> ) )
|
1472
|
+
632: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>( <span class="ruby-identifier">full_out_path</span>, <span class="ruby-value str">'w'</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
1473
|
+
633: <span class="ruby-identifier">f</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">txt</span>
|
1474
|
+
634: <span class="ruby-keyword kw">end</span>
|
1475
|
+
635: <span class="ruby-keyword kw">ensure</span>
|
1476
|
+
636: <span class="ruby-constant">File</span>.<span class="ruby-identifier">umask</span>( <span class="ruby-identifier">saved_umask</span> ) <span class="ruby-keyword kw">rescue</span> <span class="ruby-keyword kw">nil</span>
|
1477
|
+
637: <span class="ruby-keyword kw">end</span>
|
1478
|
+
638: <span class="ruby-identifier">published</span>[<span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>].<span class="ruby-identifier">link</span>] = <span class="ruby-identifier">vars</span>[<span class="ruby-identifier">:page</span>]
|
1479
|
+
639: <span class="ruby-identifier">published_types</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">page_name</span>
|
1480
|
+
640: <span class="ruby-keyword kw">end</span>
|
1481
|
+
641: <span class="ruby-keyword kw">end</span>
|
1482
|
+
642: <span class="ruby-identifier">published_types</span>.<span class="ruby-identifier">uniq!</span>
|
1483
|
+
643: <span class="ruby-identifier">publishers</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
1484
|
+
644: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:watch</span>
|
1485
|
+
645: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">watch</span> <span class="ruby-operator">&</span> <span class="ruby-identifier">published_types</span> <span class="ruby-operator">!=</span> []
|
1486
|
+
646: <span class="ruby-identifier">p</span>.<span class="ruby-identifier">publish</span>( <span class="ruby-identifier">published</span> )
|
1487
|
+
647: <span class="ruby-keyword kw">end</span>
|
1488
|
+
648: <span class="ruby-keyword kw">else</span>
|
1489
|
+
649: <span class="ruby-identifier">p</span>.<span class="ruby-identifier">publish</span>( <span class="ruby-identifier">published</span> )
|
1490
|
+
650: <span class="ruby-keyword kw">end</span>
|
1491
|
+
651: <span class="ruby-keyword kw">end</span>
|
1492
|
+
652:
|
1493
|
+
653: <span class="ruby-identifier">commit_to_git</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@git</span>
|
1494
|
+
654:
|
1495
|
+
655: <span class="ruby-identifier">reset_output_map</span>
|
1496
|
+
656: <span class="ruby-keyword kw">end</span>
|
1497
|
+
</pre>
|
1498
|
+
</div>
|
1499
|
+
</div>
|
1500
|
+
</div>
|
1501
|
+
|
1502
|
+
<div id="method-M000229" class="method-detail">
|
1503
|
+
<a name="M000229"></a>
|
1504
|
+
|
1505
|
+
<div class="method-heading">
|
1506
|
+
<a href="#M000229" class="method-signature">
|
1507
|
+
<span class="method-name">save</span><span class="method-args">( file = @hobix_yaml )</span>
|
1508
|
+
</a>
|
1509
|
+
</div>
|
1510
|
+
|
1511
|
+
<div class="method-description">
|
1512
|
+
<p>
|
1513
|
+
Save the weblog configuration to its hobix.yaml (or optionally provide a
|
1514
|
+
path where you would like to <a href="Weblog.html#M000229">save</a>.)
|
1515
|
+
</p>
|
1516
|
+
<p><a class="source-toggle" href="#"
|
1517
|
+
onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
|
1518
|
+
<div class="method-source-code" id="M000229-source">
|
1519
|
+
<pre>
|
1520
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 420</span>
|
1521
|
+
420: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>( <span class="ruby-identifier">file</span> = <span class="ruby-ivar">@hobix_yaml</span> )
|
1522
|
+
421: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">file</span>
|
1523
|
+
422: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">"Missing argument: path to save configuration (0 of 1)"</span>
|
1524
|
+
423: <span class="ruby-keyword kw">end</span>
|
1525
|
+
424: <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">open</span>( <span class="ruby-identifier">file</span>, <span class="ruby-value str">'w'</span> ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
|
1526
|
+
425: <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">dump</span>( <span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">f</span> )
|
1527
|
+
426: <span class="ruby-keyword kw">end</span>
|
1528
|
+
427: <span class="ruby-keyword kw">self</span>
|
1529
|
+
428: <span class="ruby-keyword kw">end</span>
|
1530
|
+
</pre>
|
1531
|
+
</div>
|
1532
|
+
</div>
|
1533
|
+
</div>
|
1534
|
+
|
1535
|
+
<div id="method-M000249" class="method-detail">
|
1536
|
+
<a name="M000249"></a>
|
1537
|
+
|
1538
|
+
<div class="method-heading">
|
1539
|
+
<a href="#M000249" class="method-signature">
|
1540
|
+
<span class="method-name">sections</span><span class="method-args">( opts = nil )</span>
|
1541
|
+
</a>
|
1542
|
+
</div>
|
1543
|
+
|
1544
|
+
<div class="method-description">
|
1545
|
+
<p>
|
1546
|
+
Receive a Hash pairing all section ids with the options for that section.
|
1547
|
+
</p>
|
1548
|
+
<p><a class="source-toggle" href="#"
|
1549
|
+
onclick="toggleCode('M000249-source');return false;">[Source]</a></p>
|
1550
|
+
<div class="method-source-code" id="M000249-source">
|
1551
|
+
<pre>
|
1552
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 786</span>
|
1553
|
+
786: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sections</span>( <span class="ruby-identifier">opts</span> = <span class="ruby-keyword kw">nil</span> )
|
1554
|
+
787: <span class="ruby-identifier">sections</span> = <span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">load</span>( <span class="ruby-constant">Marshal</span><span class="ruby-operator">::</span><span class="ruby-identifier">dump</span>( <span class="ruby-ivar">@sections</span> ) )
|
1555
|
+
788: <span class="ruby-identifier">observes</span> = <span class="ruby-operator">!</span><span class="ruby-identifier">sections</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>[<span class="ruby-value str">'observe'</span>] }
|
1556
|
+
789: <span class="ruby-identifier">storage</span>.<span class="ruby-identifier">sections</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
|
1557
|
+
790: <span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>] <span class="ruby-operator">||=</span> {}
|
1558
|
+
791: <span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>][<span class="ruby-value str">'observe'</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>].<span class="ruby-identifier">has_key?</span>( <span class="ruby-value str">'ignore'</span> ) <span class="ruby-operator">?</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>][<span class="ruby-value str">'ignore'</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">observes</span>
|
1559
|
+
792: <span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>][<span class="ruby-value str">'ignore'</span>] <span class="ruby-operator">||=</span> <span class="ruby-operator">!</span><span class="ruby-identifier">sections</span>[<span class="ruby-identifier">s</span>][<span class="ruby-value str">'observe'</span>]
|
1560
|
+
793: <span class="ruby-keyword kw">end</span>
|
1561
|
+
794: <span class="ruby-identifier">sections</span>
|
1562
|
+
795: <span class="ruby-keyword kw">end</span>
|
1563
|
+
</pre>
|
1564
|
+
</div>
|
1565
|
+
</div>
|
1566
|
+
</div>
|
1567
|
+
|
1568
|
+
<div id="method-M000251" class="method-detail">
|
1569
|
+
<a name="M000251"></a>
|
1570
|
+
|
1571
|
+
<div class="method-heading">
|
1572
|
+
<a href="#M000251" class="method-signature">
|
1573
|
+
<span class="method-name">sections_ignored</span><span class="method-args">()</span>
|
1574
|
+
</a>
|
1575
|
+
</div>
|
1576
|
+
|
1577
|
+
<div class="method-description">
|
1578
|
+
<p>
|
1579
|
+
Returns an Array of entry paths ignored by general querying. Storage
|
1580
|
+
plugins must withhold these entries from queries, unless the :all =>
|
1581
|
+
true setting is passed to the query.
|
1582
|
+
</p>
|
1583
|
+
<p><a class="source-toggle" href="#"
|
1584
|
+
onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
|
1585
|
+
<div class="method-source-code" id="M000251-source">
|
1586
|
+
<pre>
|
1587
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 811</span>
|
1588
|
+
811: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sections_ignored</span>
|
1589
|
+
812: <span class="ruby-identifier">sections</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
1590
|
+
813: <span class="ruby-identifier">k</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>[<span class="ruby-value str">'ignore'</span>]
|
1591
|
+
814: <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">compact</span>
|
1592
|
+
815: <span class="ruby-keyword kw">end</span>
|
1593
|
+
</pre>
|
1594
|
+
</div>
|
1595
|
+
</div>
|
1596
|
+
</div>
|
1597
|
+
|
1598
|
+
<div id="method-M000250" class="method-detail">
|
1599
|
+
<a name="M000250"></a>
|
1600
|
+
|
1601
|
+
<div class="method-heading">
|
1602
|
+
<a href="#M000250" class="method-signature">
|
1603
|
+
<span class="method-name">sections_sorts</span><span class="method-args">()</span>
|
1604
|
+
</a>
|
1605
|
+
</div>
|
1606
|
+
|
1607
|
+
<div class="method-description">
|
1608
|
+
<p>
|
1609
|
+
Returns a hash of special sorting cases. Key is the entry path, value is
|
1610
|
+
the sorting method. Storage plugins must honor these default sorts.
|
1611
|
+
</p>
|
1612
|
+
<p><a class="source-toggle" href="#"
|
1613
|
+
onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
|
1614
|
+
<div class="method-source-code" id="M000250-source">
|
1615
|
+
<pre>
|
1616
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 800</span>
|
1617
|
+
800: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sections_sorts</span>
|
1618
|
+
801: <span class="ruby-ivar">@sections</span>.<span class="ruby-identifier">inject</span>( {} ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sorts</span>, <span class="ruby-identifier">set</span><span class="ruby-operator">|</span>
|
1619
|
+
802: <span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span> = <span class="ruby-identifier">set</span>
|
1620
|
+
803: <span class="ruby-identifier">sorts</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>[<span class="ruby-value str">'sort_by'</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span>[<span class="ruby-value str">'sort_by'</span>]
|
1621
|
+
804: <span class="ruby-identifier">sorts</span>
|
1622
|
+
805: <span class="ruby-keyword kw">end</span>
|
1623
|
+
806: <span class="ruby-keyword kw">end</span>
|
1624
|
+
</pre>
|
1625
|
+
</div>
|
1626
|
+
</div>
|
1627
|
+
</div>
|
1628
|
+
|
1629
|
+
<div id="method-M000231" class="method-detail">
|
1630
|
+
<a name="M000231"></a>
|
1631
|
+
|
1632
|
+
<div class="method-heading">
|
1633
|
+
<a href="#M000231" class="method-signature">
|
1634
|
+
<span class="method-name">setup</span><span class="method-args">()</span>
|
1635
|
+
</a>
|
1636
|
+
</div>
|
1637
|
+
|
1638
|
+
<div class="method-description">
|
1639
|
+
<p>
|
1640
|
+
Sets up a weblog. Should only be run once (which <a
|
1641
|
+
href="../Hobix.html">Hobix</a> performs automatically upon blog creation).
|
1642
|
+
</p>
|
1643
|
+
<p><a class="source-toggle" href="#"
|
1644
|
+
onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
|
1645
|
+
<div class="method-source-code" id="M000231-source">
|
1646
|
+
<pre>
|
1647
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 457</span>
|
1648
|
+
457: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">setup</span>
|
1649
|
+
458: <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
|
1650
|
+
459: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:setup</span>
|
1651
|
+
460: <span class="ruby-identifier">p</span>.<span class="ruby-identifier">setup</span>
|
1652
|
+
461: <span class="ruby-keyword kw">end</span>
|
1653
|
+
462: <span class="ruby-keyword kw">end</span>
|
1654
|
+
463: <span class="ruby-keyword kw">end</span>
|
1655
|
+
</pre>
|
1656
|
+
</div>
|
1657
|
+
</div>
|
1658
|
+
</div>
|
1659
|
+
|
1660
|
+
<div id="method-M000244" class="method-detail">
|
1661
|
+
<a name="M000244"></a>
|
1662
|
+
|
1663
|
+
<div class="method-heading">
|
1664
|
+
<a href="#M000244" class="method-signature">
|
1665
|
+
<span class="method-name">skel_daily</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => curr[1]| ...}</span>
|
1666
|
+
</a>
|
1667
|
+
</div>
|
1668
|
+
|
1669
|
+
<div class="method-description">
|
1670
|
+
<p>
|
1671
|
+
Handler for templates with `daily’ prefix. These templates will
|
1672
|
+
receive a list of entries for each day that has at least one entry created
|
1673
|
+
in its time period. This handler requests daily pages to be output as
|
1674
|
+
`/%Y/%m/%d.ext’.
|
1675
|
+
</p>
|
1676
|
+
<p><a class="source-toggle" href="#"
|
1677
|
+
onclick="toggleCode('M000244-source');return false;">[Source]</a></p>
|
1678
|
+
<div class="method-source-code" id="M000244-source">
|
1679
|
+
<pre>
|
1680
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 683</span>
|
1681
|
+
683: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_daily</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1682
|
+
684: <span class="ruby-identifier">entry_range</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>
|
1683
|
+
685: <span class="ruby-identifier">first_time</span>, <span class="ruby-identifier">last_time</span> = <span class="ruby-identifier">entry_range</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">created</span>, <span class="ruby-identifier">entry_range</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">created</span>
|
1684
|
+
686: <span class="ruby-identifier">start</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>( <span class="ruby-identifier">first_time</span>.<span class="ruby-identifier">year</span>, <span class="ruby-identifier">first_time</span>.<span class="ruby-identifier">month</span>, <span class="ruby-identifier">first_time</span>.<span class="ruby-identifier">day</span>, <span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-value">0</span> ) <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
1685
|
+
687: <span class="ruby-identifier">stop</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>( <span class="ruby-identifier">last_time</span>.<span class="ruby-identifier">year</span>, <span class="ruby-identifier">last_time</span>.<span class="ruby-identifier">month</span>, <span class="ruby-identifier">last_time</span>.<span class="ruby-identifier">day</span>, <span class="ruby-value">23</span>, <span class="ruby-value">59</span>, <span class="ruby-value">59</span> )
|
1686
|
+
688: <span class="ruby-identifier">days</span> = []
|
1687
|
+
689: <span class="ruby-identifier">one_day</span> = <span class="ruby-value">24</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span> <span class="ruby-operator">*</span> <span class="ruby-value">60</span>
|
1688
|
+
690: <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">start</span> <span class="ruby-operator">></span> <span class="ruby-identifier">stop</span>
|
1689
|
+
691: <span class="ruby-identifier">day_entries</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">within</span>( <span class="ruby-identifier">start</span>, <span class="ruby-identifier">start</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">one_day</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span> )
|
1690
|
+
692: <span class="ruby-identifier">days</span> <span class="ruby-operator"><<</span> [<span class="ruby-identifier">day_entries</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">created</span>, <span class="ruby-identifier">day_entries</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">day_entries</span>.<span class="ruby-identifier">empty?</span>
|
1691
|
+
693: <span class="ruby-identifier">start</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">one_day</span>
|
1692
|
+
694: <span class="ruby-keyword kw">end</span>
|
1693
|
+
695: <span class="ruby-identifier">days</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">Enumerable</span>
|
1694
|
+
696: <span class="ruby-identifier">days</span>.<span class="ruby-identifier">each_with_neighbors</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prev</span>, <span class="ruby-identifier">curr</span>, <span class="ruby-identifier">nextd</span><span class="ruby-operator">|</span>
|
1695
|
+
697: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/%d"</span> ), <span class="ruby-identifier">section_path</span> )
|
1696
|
+
698: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">prev</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/%d"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prev</span>
|
1697
|
+
699: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">nextd</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/%d"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nextd</span>
|
1698
|
+
700: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">timestamp</span> = <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>]
|
1699
|
+
701: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>] )
|
1700
|
+
702: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>]
|
1701
|
+
703: <span class="ruby-keyword kw">end</span>
|
1702
|
+
704: <span class="ruby-keyword kw">end</span>
|
1703
|
+
</pre>
|
1704
|
+
</div>
|
1705
|
+
</div>
|
1706
|
+
</div>
|
1707
|
+
|
1708
|
+
<div id="method-M000247" class="method-detail">
|
1709
|
+
<a name="M000247"></a>
|
1710
|
+
|
1711
|
+
<div class="method-heading">
|
1712
|
+
<a href="#M000247" class="method-signature">
|
1713
|
+
<span class="method-name">skel_entry</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entry => entry| ...}</span>
|
1714
|
+
</a>
|
1715
|
+
</div>
|
1716
|
+
|
1717
|
+
<div class="method-description">
|
1718
|
+
<p>
|
1719
|
+
Handler for templates with `entry’ prefix. These templates will
|
1720
|
+
receive one entry for each entry in the weblog. The handler requests entry
|
1721
|
+
pages to be output as `/shortName.ext’.
|
1722
|
+
</p>
|
1723
|
+
<p><a class="source-toggle" href="#"
|
1724
|
+
onclick="toggleCode('M000247-source');return false;">[Source]</a></p>
|
1725
|
+
<div class="method-source-code" id="M000247-source">
|
1726
|
+
<pre>
|
1727
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 749</span>
|
1728
|
+
749: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_entry</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1729
|
+
750: <span class="ruby-identifier">all_entries</span> = [<span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>]
|
1730
|
+
751: <span class="ruby-identifier">all_entries</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">sections_ignored</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ign</span><span class="ruby-operator">|</span> <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>( <span class="ruby-identifier">:all</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">:inpath</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ign</span> ) }
|
1731
|
+
752: <span class="ruby-identifier">all_entries</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry_set</span><span class="ruby-operator">|</span>
|
1732
|
+
753: <span class="ruby-identifier">entry_set</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">Enumerable</span>
|
1733
|
+
754: <span class="ruby-identifier">entry_set</span>.<span class="ruby-identifier">each_with_neighbors</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">nexte</span>, <span class="ruby-identifier">entry</span>, <span class="ruby-identifier">prev</span><span class="ruby-operator">|</span>
|
1734
|
+
755: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">id</span> )
|
1735
|
+
756: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">prev</span>.<span class="ruby-identifier">id</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prev</span>
|
1736
|
+
757: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">nexte</span>.<span class="ruby-identifier">id</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nexte</span>
|
1737
|
+
758: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">timestamp</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">created</span>
|
1738
|
+
759: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">updated</span>( <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">id</span> )
|
1739
|
+
760: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entry</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entry</span>
|
1740
|
+
761: <span class="ruby-keyword kw">end</span>
|
1741
|
+
762: <span class="ruby-keyword kw">end</span>
|
1742
|
+
763: <span class="ruby-keyword kw">end</span>
|
1743
|
+
</pre>
|
1744
|
+
</div>
|
1745
|
+
</div>
|
1746
|
+
</div>
|
1747
|
+
|
1748
|
+
<div id="method-M000243" class="method-detail">
|
1749
|
+
<a name="M000243"></a>
|
1750
|
+
|
1751
|
+
<div class="method-heading">
|
1752
|
+
<a href="#M000243" class="method-signature">
|
1753
|
+
<span class="method-name">skel_index</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => index_entries| ...}</span>
|
1754
|
+
</a>
|
1755
|
+
</div>
|
1756
|
+
|
1757
|
+
<div class="method-description">
|
1758
|
+
<p>
|
1759
|
+
Handler for templates with `index’ prefix. These templates will
|
1760
|
+
receive entries loaded by +<a
|
1761
|
+
href="BaseStorage.html#M000121">Hobix::BaseStorage#lastn</a>+. Only one
|
1762
|
+
index page is requested by this handler.
|
1763
|
+
</p>
|
1764
|
+
<p><a class="source-toggle" href="#"
|
1765
|
+
onclick="toggleCode('M000243-source');return false;">[Source]</a></p>
|
1766
|
+
<div class="method-source-code" id="M000243-source">
|
1767
|
+
<pre>
|
1768
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 670</span>
|
1769
|
+
670: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_index</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1770
|
+
671: <span class="ruby-identifier">index_entries</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">lastn</span>( <span class="ruby-ivar">@lastn</span> )
|
1771
|
+
672: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-value str">'index'</span>, <span class="ruby-identifier">section_path</span> )
|
1772
|
+
673: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">index_entries</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">created</span>.<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/index"</span> )
|
1773
|
+
674: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">timestamp</span> = <span class="ruby-identifier">index_entries</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">created</span>
|
1774
|
+
675: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">index_entries</span> )
|
1775
|
+
676: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">index_entries</span>
|
1776
|
+
677: <span class="ruby-keyword kw">end</span>
|
1777
|
+
</pre>
|
1778
|
+
</div>
|
1779
|
+
</div>
|
1780
|
+
</div>
|
1781
|
+
|
1782
|
+
<div id="method-M000245" class="method-detail">
|
1783
|
+
<a name="M000245"></a>
|
1784
|
+
|
1785
|
+
<div class="method-heading">
|
1786
|
+
<a href="#M000245" class="method-signature">
|
1787
|
+
<span class="method-name">skel_monthly</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => entries| ...}</span>
|
1788
|
+
</a>
|
1789
|
+
</div>
|
1790
|
+
|
1791
|
+
<div class="method-description">
|
1792
|
+
<p>
|
1793
|
+
Handler for templates with `monthly’ prefix. These templates will
|
1794
|
+
receive a list of entries for each month that has at least one entry
|
1795
|
+
created in its time period. This handler requests monthly pages to be
|
1796
|
+
output as `/%Y/%m/index.ext’.
|
1797
|
+
</p>
|
1798
|
+
<p><a class="source-toggle" href="#"
|
1799
|
+
onclick="toggleCode('M000245-source');return false;">[Source]</a></p>
|
1800
|
+
<div class="method-source-code" id="M000245-source">
|
1801
|
+
<pre>
|
1802
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 710</span>
|
1803
|
+
710: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_monthly</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1804
|
+
711: <span class="ruby-identifier">months</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">get_months</span>( <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span> )
|
1805
|
+
712: <span class="ruby-identifier">months</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">Enumerable</span>
|
1806
|
+
713: <span class="ruby-identifier">months</span>.<span class="ruby-identifier">each_with_neighbors</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prev</span>, <span class="ruby-identifier">curr</span>, <span class="ruby-identifier">nextm</span><span class="ruby-operator">|</span>
|
1807
|
+
714: <span class="ruby-identifier">entries</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">within</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>] )
|
1808
|
+
715: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/index"</span> ), <span class="ruby-identifier">section_path</span> )
|
1809
|
+
716: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">prev</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/index"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prev</span>
|
1810
|
+
717: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">nextm</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/%m/index"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nextm</span>
|
1811
|
+
718: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">timestamp</span> = <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>]
|
1812
|
+
719: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">entries</span> )
|
1813
|
+
720: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entries</span>
|
1814
|
+
721: <span class="ruby-keyword kw">end</span>
|
1815
|
+
722: <span class="ruby-keyword kw">end</span>
|
1816
|
+
</pre>
|
1817
|
+
</div>
|
1818
|
+
</div>
|
1819
|
+
</div>
|
1820
|
+
|
1821
|
+
<div id="method-M000218" class="method-detail">
|
1822
|
+
<a name="M000218"></a>
|
1823
|
+
|
1824
|
+
<div class="method-heading">
|
1825
|
+
<a href="#M000218" class="method-signature">
|
1826
|
+
<span class="method-name">skel_path</span><span class="method-args">()</span>
|
1827
|
+
</a>
|
1828
|
+
</div>
|
1829
|
+
|
1830
|
+
<div class="method-description">
|
1831
|
+
<p><a class="source-toggle" href="#"
|
1832
|
+
onclick="toggleCode('M000218-source');return false;">[Source]</a></p>
|
1833
|
+
<div class="method-source-code" id="M000218-source">
|
1834
|
+
<pre>
|
1835
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 360</span>
|
1836
|
+
360: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_path</span>; <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>( <span class="ruby-ivar">@skel_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default_skel_path</span>, <span class="ruby-ivar">@path</span> ).<span class="ruby-identifier">untaint</span>; <span class="ruby-keyword kw">end</span>
|
1837
|
+
</pre>
|
1838
|
+
</div>
|
1839
|
+
</div>
|
1840
|
+
</div>
|
1841
|
+
|
1842
|
+
<div id="method-M000248" class="method-detail">
|
1843
|
+
<a name="M000248"></a>
|
1844
|
+
|
1845
|
+
<div class="method-heading">
|
1846
|
+
<a href="#M000248" class="method-signature">
|
1847
|
+
<span class="method-name">skel_section</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => entries| ...}</span>
|
1848
|
+
</a>
|
1849
|
+
</div>
|
1850
|
+
|
1851
|
+
<div class="method-description">
|
1852
|
+
<p>
|
1853
|
+
Handler for templates with `section’ prefix. These templates will
|
1854
|
+
receive all entries below a given directory. The handler requests will be
|
1855
|
+
output as `/section/index.ext’.
|
1856
|
+
</p>
|
1857
|
+
<p><a class="source-toggle" href="#"
|
1858
|
+
onclick="toggleCode('M000248-source');return false;">[Source]</a></p>
|
1859
|
+
<div class="method-source-code" id="M000248-source">
|
1860
|
+
<pre>
|
1861
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 768</span>
|
1862
|
+
768: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_section</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1863
|
+
769: <span class="ruby-identifier">section_map</span> = {}
|
1864
|
+
770: <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">all</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">entry</span><span class="ruby-operator">|</span>
|
1865
|
+
771: <span class="ruby-identifier">dirs</span> = <span class="ruby-identifier">entry</span>.<span class="ruby-identifier">id</span>.<span class="ruby-identifier">split</span>( <span class="ruby-value str">'/'</span> )
|
1866
|
+
772: <span class="ruby-keyword kw">while</span> ( <span class="ruby-identifier">dirs</span>.<span class="ruby-identifier">pop</span>; <span class="ruby-identifier">dirs</span>.<span class="ruby-identifier">first</span> )
|
1867
|
+
773: <span class="ruby-identifier">section</span> = <span class="ruby-identifier">dirs</span>.<span class="ruby-identifier">join</span>( <span class="ruby-value str">'/'</span> )
|
1868
|
+
774: <span class="ruby-identifier">section_map</span>[ <span class="ruby-identifier">section</span> ] <span class="ruby-operator">||=</span> []
|
1869
|
+
775: <span class="ruby-identifier">section_map</span>[ <span class="ruby-identifier">section</span> ] <span class="ruby-operator"><<</span> <span class="ruby-identifier">entry</span>
|
1870
|
+
776: <span class="ruby-keyword kw">end</span>
|
1871
|
+
777: <span class="ruby-keyword kw">end</span>
|
1872
|
+
778: <span class="ruby-identifier">section_map</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">section</span>, <span class="ruby-identifier">entries</span><span class="ruby-operator">|</span>
|
1873
|
+
779: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-node">"/#{ section }/index"</span> )
|
1874
|
+
780: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">entries</span> )
|
1875
|
+
781: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entries</span>
|
1876
|
+
782: <span class="ruby-keyword kw">end</span>
|
1877
|
+
783: <span class="ruby-keyword kw">end</span>
|
1878
|
+
</pre>
|
1879
|
+
</div>
|
1880
|
+
</div>
|
1881
|
+
</div>
|
1882
|
+
|
1883
|
+
<div id="method-M000252" class="method-detail">
|
1884
|
+
<a name="M000252"></a>
|
1885
|
+
|
1886
|
+
<div class="method-heading">
|
1887
|
+
<a href="#M000252" class="method-signature">
|
1888
|
+
<span class="method-name">skel_tags</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => entries| ...}</span>
|
1889
|
+
</a>
|
1890
|
+
</div>
|
1891
|
+
|
1892
|
+
<div class="method-description">
|
1893
|
+
<p>
|
1894
|
+
Handler for templates with `tags’ prefix. These templates will
|
1895
|
+
receive a tag with all entries tagged with it. The handler requests will be
|
1896
|
+
output as `/tags/<tag>/index.ext’.
|
1897
|
+
</p>
|
1898
|
+
<p><a class="source-toggle" href="#"
|
1899
|
+
onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
|
1900
|
+
<div class="method-source-code" id="M000252-source">
|
1901
|
+
<pre>
|
1902
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 820</span>
|
1903
|
+
820: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_tags</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1904
|
+
821: <span class="ruby-comment cmt"># Get a list of all known tags</span>
|
1905
|
+
822: <span class="ruby-identifier">tags</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>( <span class="ruby-identifier">:all</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span> ).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">tags</span> }.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">uniq</span>
|
1906
|
+
823:
|
1907
|
+
824: <span class="ruby-identifier">tags</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tag</span><span class="ruby-operator">|</span>
|
1908
|
+
825: <span class="ruby-identifier">entries</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>.<span class="ruby-identifier">find_all</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">tags</span>.<span class="ruby-identifier">member?</span> <span class="ruby-identifier">tag</span> }
|
1909
|
+
826: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-identifier">join</span>( <span class="ruby-value str">'tags'</span>,<span class="ruby-identifier">tag</span>,<span class="ruby-value str">'index'</span> ), <span class="ruby-identifier">section_path</span> )
|
1910
|
+
827: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">entries</span> )
|
1911
|
+
828: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entries</span>
|
1912
|
+
829: <span class="ruby-keyword kw">end</span>
|
1913
|
+
830: <span class="ruby-keyword kw">end</span>
|
1914
|
+
</pre>
|
1915
|
+
</div>
|
1916
|
+
</div>
|
1917
|
+
</div>
|
1918
|
+
|
1919
|
+
<div id="method-M000246" class="method-detail">
|
1920
|
+
<a name="M000246"></a>
|
1921
|
+
|
1922
|
+
<div class="method-heading">
|
1923
|
+
<a href="#M000246" class="method-signature">
|
1924
|
+
<span class="method-name">skel_yearly</span><span class="method-args">( path_storage, section_path ) {|:page => page, :entries => entries| ...}</span>
|
1925
|
+
</a>
|
1926
|
+
</div>
|
1927
|
+
|
1928
|
+
<div class="method-description">
|
1929
|
+
<p>
|
1930
|
+
Handler for templates with `yearly’ prefix. These templates will
|
1931
|
+
receive a list of entries for each month that has at least one entry
|
1932
|
+
created in its time period. This handler requests yearly pages to be output
|
1933
|
+
as `/%Y/index.ext’.
|
1934
|
+
</p>
|
1935
|
+
<p><a class="source-toggle" href="#"
|
1936
|
+
onclick="toggleCode('M000246-source');return false;">[Source]</a></p>
|
1937
|
+
<div class="method-source-code" id="M000246-source">
|
1938
|
+
<pre>
|
1939
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 728</span>
|
1940
|
+
728: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">skel_yearly</span>( <span class="ruby-identifier">path_storage</span>, <span class="ruby-identifier">section_path</span> )
|
1941
|
+
729: <span class="ruby-identifier">entry_range</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">find</span>
|
1942
|
+
730: <span class="ruby-identifier">first_time</span>, <span class="ruby-identifier">last_time</span> = <span class="ruby-identifier">entry_range</span>.<span class="ruby-identifier">last</span>.<span class="ruby-identifier">created</span>, <span class="ruby-identifier">entry_range</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">created</span>
|
1943
|
+
731: <span class="ruby-identifier">years</span> = (<span class="ruby-identifier">first_time</span>.<span class="ruby-identifier">year</span><span class="ruby-operator">..</span><span class="ruby-identifier">last_time</span>.<span class="ruby-identifier">year</span>).<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">y</span><span class="ruby-operator">|</span>
|
1944
|
+
732: [ <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>( <span class="ruby-identifier">y</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span> ), <span class="ruby-constant">Time</span>.<span class="ruby-identifier">mktime</span>( <span class="ruby-identifier">y</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>, <span class="ruby-value">1</span>, <span class="ruby-value">1</span> ) <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ]
|
1945
|
+
733: <span class="ruby-keyword kw">end</span>
|
1946
|
+
734: <span class="ruby-identifier">years</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">Enumerable</span>
|
1947
|
+
735: <span class="ruby-identifier">years</span>.<span class="ruby-identifier">each_with_neighbors</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prev</span>, <span class="ruby-identifier">curr</span>, <span class="ruby-identifier">nextm</span><span class="ruby-operator">|</span>
|
1948
|
+
736: <span class="ruby-identifier">entries</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">within</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>], <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>] )
|
1949
|
+
737: <span class="ruby-identifier">page</span> = <span class="ruby-constant">Page</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">curr</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/index"</span> ), <span class="ruby-identifier">section_path</span> )
|
1950
|
+
738: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">prev</span> = <span class="ruby-identifier">prev</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/index"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">prev</span>
|
1951
|
+
739: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">nextm</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">strftime</span>( <span class="ruby-value str">"%Y/index"</span> ) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">nextm</span>
|
1952
|
+
740: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">timestamp</span> = <span class="ruby-identifier">curr</span>[<span class="ruby-value">1</span>]
|
1953
|
+
741: <span class="ruby-identifier">page</span>.<span class="ruby-identifier">updated</span> = <span class="ruby-identifier">path_storage</span>.<span class="ruby-identifier">last_updated</span>( <span class="ruby-identifier">entries</span> )
|
1954
|
+
742: <span class="ruby-keyword kw">yield</span> <span class="ruby-operator">:</span><span class="ruby-identifier">page</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">page</span>, <span class="ruby-identifier">:entries</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">entries</span>
|
1955
|
+
743: <span class="ruby-keyword kw">end</span>
|
1956
|
+
744: <span class="ruby-keyword kw">end</span>
|
1957
|
+
</pre>
|
1958
|
+
</div>
|
1959
|
+
</div>
|
1960
|
+
</div>
|
1961
|
+
|
1962
|
+
<div id="method-M000208" class="method-detail">
|
1963
|
+
<a name="M000208"></a>
|
1964
|
+
|
1965
|
+
<div class="method-heading">
|
1966
|
+
<a href="#M000208" class="method-signature">
|
1967
|
+
<span class="method-name">start</span><span class="method-args">( hobix_yaml )</span>
|
1968
|
+
</a>
|
1969
|
+
</div>
|
1970
|
+
|
1971
|
+
<div class="method-description">
|
1972
|
+
<p>
|
1973
|
+
After the weblog is initialize, the <tt><a
|
1974
|
+
href="Weblog.html#M000208">start</a></tt> method is called with the full
|
1975
|
+
system path to the directory containing the configuration.
|
1976
|
+
</p>
|
1977
|
+
<p>
|
1978
|
+
This method sets up all the paths and loads the plugins.
|
1979
|
+
</p>
|
1980
|
+
<p><a class="source-toggle" href="#"
|
1981
|
+
onclick="toggleCode('M000208-source');return false;">[Source]</a></p>
|
1982
|
+
<div class="method-source-code" id="M000208-source">
|
1983
|
+
<pre>
|
1984
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 323</span>
|
1985
|
+
323: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">start</span>( <span class="ruby-identifier">hobix_yaml</span> )
|
1986
|
+
324: <span class="ruby-ivar">@hobix_yaml</span> = <span class="ruby-identifier">hobix_yaml</span>
|
1987
|
+
325: <span class="ruby-ivar">@path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>( <span class="ruby-identifier">hobix_yaml</span> )
|
1988
|
+
326: <span class="ruby-ivar">@sections</span> <span class="ruby-operator">||=</span> {}
|
1989
|
+
327: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>( <span class="ruby-identifier">lib_path</span> )
|
1990
|
+
328: <span class="ruby-identifier">$LOAD_PATH</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">lib_path</span>
|
1991
|
+
329: <span class="ruby-keyword kw">end</span>
|
1992
|
+
330: <span class="ruby-ivar">@plugins</span> = []
|
1993
|
+
331: <span class="ruby-ivar">@requires</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">req</span><span class="ruby-operator">|</span>
|
1994
|
+
332: <span class="ruby-identifier">opts</span> = <span class="ruby-keyword kw">nil</span>
|
1995
|
+
333: <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:to_str</span>
|
1996
|
+
334: <span class="ruby-identifier">req</span>, <span class="ruby-identifier">opts</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">first</span>
|
1997
|
+
335: <span class="ruby-keyword kw">end</span>
|
1998
|
+
336: <span class="ruby-identifier">plugin_conf</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>( <span class="ruby-ivar">@path</span>, <span class="ruby-identifier">req</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/\W+/</span>, <span class="ruby-value str">'.'</span> ) )
|
1999
|
+
337: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span> <span class="ruby-identifier">plugin_conf</span>
|
2000
|
+
338: <span class="ruby-identifier">puts</span> <span class="ruby-node">"*** Loading #{ plugin_conf }"</span>
|
2001
|
+
339: <span class="ruby-identifier">plugin_conf</span> = <span class="ruby-constant">YAML</span><span class="ruby-operator">::</span><span class="ruby-identifier">load_file</span> <span class="ruby-identifier">plugin_conf</span>
|
2002
|
+
340: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">opts</span>
|
2003
|
+
341: <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">merge!</span> <span class="ruby-identifier">plugin_conf</span>
|
2004
|
+
342: <span class="ruby-keyword kw">else</span>
|
2005
|
+
343: <span class="ruby-identifier">opts</span> = <span class="ruby-identifier">plugin_conf</span>
|
2006
|
+
344: <span class="ruby-keyword kw">end</span>
|
2007
|
+
345: <span class="ruby-keyword kw">end</span>
|
2008
|
+
346: <span class="ruby-ivar">@plugins</span> <span class="ruby-operator">+=</span> <span class="ruby-constant">Hobix</span><span class="ruby-operator">::</span><span class="ruby-constant">BasePlugin</span><span class="ruby-operator">::</span><span class="ruby-identifier">start</span>( <span class="ruby-identifier">req</span>, <span class="ruby-identifier">opts</span>, <span class="ruby-keyword kw">self</span> )
|
2009
|
+
347: <span class="ruby-keyword kw">end</span>
|
2010
|
+
348: <span class="ruby-keyword kw">end</span>
|
2011
|
+
</pre>
|
2012
|
+
</div>
|
2013
|
+
</div>
|
2014
|
+
</div>
|
2015
|
+
|
2016
|
+
<div id="method-M000232" class="method-detail">
|
2017
|
+
<a name="M000232"></a>
|
2018
|
+
|
2019
|
+
<div class="method-heading">
|
2020
|
+
<a href="#M000232" class="method-signature">
|
2021
|
+
<span class="method-name">storage</span><span class="method-args">()</span>
|
2022
|
+
</a>
|
2023
|
+
</div>
|
2024
|
+
|
2025
|
+
<div class="method-description">
|
2026
|
+
<p>
|
2027
|
+
Returns the <a href="Weblog.html#M000232">storage</a> plugin currently in
|
2028
|
+
use. (There can be only one per weblog.)
|
2029
|
+
</p>
|
2030
|
+
<p><a class="source-toggle" href="#"
|
2031
|
+
onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
|
2032
|
+
<div class="method-source-code" id="M000232-source">
|
2033
|
+
<pre>
|
2034
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 467</span>
|
2035
|
+
467: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">storage</span>
|
2036
|
+
468: <span class="ruby-ivar">@plugins</span>.<span class="ruby-identifier">detect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">BaseStorage</span> }
|
2037
|
+
469: <span class="ruby-keyword kw">end</span>
|
2038
|
+
</pre>
|
2039
|
+
</div>
|
2040
|
+
</div>
|
2041
|
+
</div>
|
2042
|
+
|
2043
|
+
<div id="method-M000258" class="method-detail">
|
2044
|
+
<a name="M000258"></a>
|
2045
|
+
|
2046
|
+
<div class="method-heading">
|
2047
|
+
<a href="#M000258" class="method-signature">
|
2048
|
+
<span class="method-name">to_yaml_type</span><span class="method-args">()</span>
|
2049
|
+
</a>
|
2050
|
+
</div>
|
2051
|
+
|
2052
|
+
<div class="method-description">
|
2053
|
+
<p>
|
2054
|
+
Returns the <a href="../YAML.html">YAML</a> type information, which expands
|
2055
|
+
to tag:hobix.com,2004:weblog.
|
2056
|
+
</p>
|
2057
|
+
<p><a class="source-toggle" href="#"
|
2058
|
+
onclick="toggleCode('M000258-source');return false;">[Source]</a></p>
|
2059
|
+
<div class="method-source-code" id="M000258-source">
|
2060
|
+
<pre>
|
2061
|
+
<span class="ruby-comment cmt"># File lib/hobix/weblog.rb, line 879</span>
|
2062
|
+
879: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_yaml_type</span>
|
2063
|
+
880: <span class="ruby-value str">"!hobix.com,2004/weblog"</span>
|
2064
|
+
881: <span class="ruby-keyword kw">end</span>
|
2065
|
+
</pre>
|
2066
|
+
</div>
|
2067
|
+
</div>
|
2068
|
+
</div>
|
2069
|
+
|
2070
|
+
|
2071
|
+
</div>
|
2072
|
+
|
2073
|
+
|
2074
|
+
</div>
|
2075
|
+
|
2076
|
+
|
2077
|
+
<div id="validator-badges">
|
2078
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
2079
|
+
</div>
|
2080
|
+
|
2081
|
+
</body>
|
2082
|
+
</html>
|