hobix 0.4 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/COPYING +18 -0
  2. data/README +18 -0
  3. data/Rakefile +96 -0
  4. data/bin/hobix +7 -3
  5. data/contrib/blosxom-to-hobix.rb +253 -0
  6. data/contrib/txp-to-hobix.rb +56 -0
  7. data/contrib/webrick-all-mine.rb +20 -0
  8. data/doc/CHANGELOG +285 -0
  9. data/doc/rdoc/classes/Hobix/API.html +382 -0
  10. data/doc/rdoc/classes/Hobix/Article.html +111 -0
  11. data/doc/rdoc/classes/Hobix/BaseContent.html +692 -0
  12. data/doc/rdoc/classes/Hobix/BaseEntry.html +218 -0
  13. data/doc/rdoc/classes/Hobix/BaseFacet.html +205 -0
  14. data/doc/rdoc/classes/Hobix/BaseOutput.html +122 -0
  15. data/doc/rdoc/classes/Hobix/BasePlugin.html +201 -0
  16. data/doc/rdoc/classes/Hobix/BaseProperties/ClassMethods.html +243 -0
  17. data/doc/rdoc/classes/Hobix/BaseProperties.html +218 -0
  18. data/doc/rdoc/classes/Hobix/BasePublish.html +157 -0
  19. data/doc/rdoc/classes/Hobix/BaseStorage.html +417 -0
  20. data/doc/rdoc/classes/Hobix/BixWik/Entry.html +196 -0
  21. data/doc/rdoc/classes/Hobix/BixWik/IndexEntry.html +170 -0
  22. data/doc/rdoc/classes/Hobix/BixWik/WikiRedCloth.html +111 -0
  23. data/doc/rdoc/classes/Hobix/BixWik.html +418 -0
  24. data/doc/rdoc/classes/Hobix/BixWikPlugin.html +158 -0
  25. data/doc/rdoc/classes/Hobix/CommandLine.html +1970 -0
  26. data/doc/rdoc/classes/Hobix/Comment.html +113 -0
  27. data/doc/rdoc/classes/Hobix/Config.html +212 -0
  28. data/doc/rdoc/classes/Hobix/DataMarsh.html +667 -0
  29. data/doc/rdoc/classes/Hobix/Entry.html +178 -0
  30. data/doc/rdoc/classes/Hobix/EntryEnum.html +162 -0
  31. data/doc/rdoc/classes/Hobix/Enumerable.html +170 -0
  32. data/doc/rdoc/classes/Hobix/Facets/WikiEdit.html +180 -0
  33. data/doc/rdoc/classes/Hobix/Facets.html +111 -0
  34. data/doc/rdoc/classes/Hobix/LinkList.html +182 -0
  35. data/doc/rdoc/classes/Hobix/Out/Quick.html +412 -0
  36. data/doc/rdoc/classes/Hobix/Out.html +119 -0
  37. data/doc/rdoc/classes/Hobix/Page.html +381 -0
  38. data/doc/rdoc/classes/Hobix/Trackback.html +113 -0
  39. data/doc/rdoc/classes/Hobix/UriStr.html +198 -0
  40. data/doc/rdoc/classes/Hobix/WebApp/QueryString.html +207 -0
  41. data/doc/rdoc/classes/Hobix/WebApp/QueryValidationFailure.html +111 -0
  42. data/doc/rdoc/classes/Hobix/WebApp.html +1383 -0
  43. data/doc/rdoc/classes/Hobix/Weblog/AuthorNotFound.html +111 -0
  44. data/doc/rdoc/classes/Hobix/Weblog.html +2082 -0
  45. data/doc/rdoc/classes/Hobix.html +399 -0
  46. data/doc/rdoc/classes/Kernel.html +139 -0
  47. data/doc/rdoc/classes/Regexp.html +154 -0
  48. data/doc/rdoc/classes/YAML/Omap.html +144 -0
  49. data/doc/rdoc/classes/YAML.html +111 -0
  50. data/doc/rdoc/created.rid +1 -0
  51. data/doc/rdoc/files/COPYING.html +129 -0
  52. data/doc/rdoc/files/README.html +131 -0
  53. data/doc/rdoc/files/doc/CHANGELOG.html +101 -0
  54. data/doc/rdoc/files/lib/hobix/api_rb.html +119 -0
  55. data/doc/rdoc/files/lib/hobix/article_rb.html +126 -0
  56. data/doc/rdoc/files/lib/hobix/base_rb.html +128 -0
  57. data/doc/rdoc/files/lib/hobix/bixwik_rb.html +126 -0
  58. data/doc/rdoc/files/lib/hobix/commandline_rb.html +140 -0
  59. data/doc/rdoc/files/lib/hobix/comments_rb.html +126 -0
  60. data/doc/rdoc/files/lib/hobix/config_rb.html +125 -0
  61. data/doc/rdoc/files/lib/hobix/datamarsh_rb.html +108 -0
  62. data/doc/rdoc/files/lib/hobix/entry_rb.html +118 -0
  63. data/doc/rdoc/files/lib/hobix/linklist_rb.html +127 -0
  64. data/doc/rdoc/files/lib/hobix/publisher_rb.html +126 -0
  65. data/doc/rdoc/files/lib/hobix/trackbacks_rb.html +128 -0
  66. data/doc/rdoc/files/lib/hobix/webapp_rb.html +127 -0
  67. data/doc/rdoc/files/lib/hobix/weblog_rb.html +135 -0
  68. data/doc/rdoc/files/lib/hobix_rb.html +127 -0
  69. data/doc/rdoc/fr_class_index.html +67 -0
  70. data/doc/rdoc/fr_file_index.html +44 -0
  71. data/doc/rdoc/fr_method_index.html +307 -0
  72. data/doc/rdoc/index.html +24 -0
  73. data/doc/rdoc/rdoc-style.css +208 -0
  74. data/git_hobix_update.php +13 -0
  75. data/lib/hobix/base.rb +6 -3
  76. data/lib/hobix/bixwik.rb +12 -12
  77. data/lib/hobix/commandline.rb +18 -2
  78. data/lib/hobix/comments.rb +4 -5
  79. data/lib/hobix/entry.rb +2 -1
  80. data/lib/hobix/facets/comments.rb +31 -6
  81. data/lib/hobix/linklist.rb +6 -1
  82. data/lib/hobix/out/atom.rb +29 -20
  83. data/lib/hobix/out/quick.rb +8 -6
  84. data/lib/hobix/out/rss.rb +16 -3
  85. data/lib/hobix/plugin/akismet.rb +196 -0
  86. data/lib/hobix/plugin/calendar.rb +6 -14
  87. data/lib/hobix/plugin/recent_comments.rb +4 -2
  88. data/lib/hobix/plugin/tags.rb +1 -1
  89. data/lib/hobix/storage/filesys.rb +41 -31
  90. data/lib/hobix/trackbacks.rb +1 -2
  91. data/lib/hobix/weblog.rb +73 -40
  92. data/lib/hobix.rb +9 -2
  93. data/share/default-blog/hobix.yaml +16 -0
  94. data/share/default-blog/htdocs/site.css +174 -0
  95. data/share/default-blog/skel/entry.html.quick +0 -0
  96. data/share/default-blog/skel/index.atom.atom +0 -0
  97. data/share/default-blog/skel/index.html.quick-summary +0 -0
  98. data/share/default-blog/skel/index.xml.rss +0 -0
  99. data/share/default-blog/skel/index.yaml.okaynews +0 -0
  100. data/share/default-blog/skel/monthly.html.quick-archive +0 -0
  101. data/share/default-blog/skel/section.html.quick-archive +0 -0
  102. data/share/default-blog/skel/yearly.html.quick-archive +0 -0
  103. data/share/default-blog-modes.yaml +7 -0
  104. data/share/default-blog.apache-cgi.patch +8 -0
  105. data/share/default-blog.apache-ssi.patch +38 -0
  106. data/share/default-blog.apache2-ssi.patch +3 -0
  107. data/share/default-blog.cgi.patch +8 -0
  108. data/share/default-blog.comments.patch +5 -0
  109. data/share/default-blog.prototype.patch +766 -0
  110. data/share/default-blog.publisher.patch +5 -0
  111. data/share/default-blog.wiki.patch +29 -0
  112. data/share/publisher/css/control.css +90 -0
  113. data/share/publisher/css/form.css +238 -0
  114. data/share/publisher/css/form.import.css +72 -0
  115. data/share/publisher/css/main-menu.css +134 -0
  116. data/share/publisher/i/hobix-emblazen-1.png +0 -0
  117. data/share/publisher/i/hobix-emblazen-2.png +0 -0
  118. data/share/publisher/i/hobix-emblazen-3.png +0 -0
  119. data/share/publisher/i/hobix-emblazen-4.png +0 -0
  120. data/share/publisher/i/hobix-emblazen-5.png +0 -0
  121. data/share/publisher/i/hobix-emblazen-6.png +0 -0
  122. data/share/publisher/i/hobix-emblazen-7.png +0 -0
  123. data/share/publisher/index.erb +66 -0
  124. data/share/publisher/js/controls.js +261 -0
  125. data/share/publisher/js/dragdrop.js +476 -0
  126. data/share/publisher/js/effects.js +570 -0
  127. data/share/publisher/js/prototype.js +1011 -0
  128. metadata +196 -53
  129. checksums.yaml +0 -7
@@ -0,0 +1,218 @@
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::BaseEntry</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::BaseEntry</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
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="BaseContent.html">
69
+ BaseContent
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ The <a href="BaseEntry.html">BaseEntry</a> class is the underlying class
86
+ for all <a href="../Hobix.html">Hobix</a> entries (i.e. the content for
87
+ your website/blahhg.)
88
+ </p>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000107">content_ratings</a>&nbsp;&nbsp;
100
+ <a href="#M000108">inherited</a>&nbsp;&nbsp;
101
+ <a href="#M000109">to_search</a>&nbsp;&nbsp;
102
+ </div>
103
+ </div>
104
+
105
+ </div>
106
+
107
+
108
+ <!-- if includes -->
109
+
110
+ <div id="section">
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+ <!-- if method_list -->
120
+ <div id="methods">
121
+ <h3 class="section-bar">Public Class methods</h3>
122
+
123
+ <div id="method-M000108" class="method-detail">
124
+ <a name="M000108"></a>
125
+
126
+ <div class="method-heading">
127
+ <a href="#M000108" class="method-signature">
128
+ <span class="method-name">inherited</span><span class="method-args">( sub )</span>
129
+ </a>
130
+ </div>
131
+
132
+ <div class="method-description">
133
+ <p><a class="source-toggle" href="#"
134
+ onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
135
+ <div class="method-source-code" id="M000108-source">
136
+ <pre>
137
+ <span class="ruby-comment cmt"># File lib/hobix/base.rb, line 459</span>
138
+ 459: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">inherited</span>( <span class="ruby-identifier">sub</span> )
139
+ 460: <span class="ruby-constant">Weblog</span><span class="ruby-operator">::</span><span class="ruby-identifier">add_entry_class</span>( <span class="ruby-identifier">sub</span> )
140
+ 461: <span class="ruby-keyword kw">end</span>
141
+ </pre>
142
+ </div>
143
+ </div>
144
+ </div>
145
+
146
+ <h3 class="section-bar">Public Instance methods</h3>
147
+
148
+ <div id="method-M000107" class="method-detail">
149
+ <a name="M000107"></a>
150
+
151
+ <div class="method-heading">
152
+ <a href="#M000107" class="method-signature">
153
+ <span class="method-name">content_ratings</span><span class="method-args">()</span>
154
+ </a>
155
+ </div>
156
+
157
+ <div class="method-description">
158
+ <p><a class="source-toggle" href="#"
159
+ onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
160
+ <div class="method-source-code" id="M000107-source">
161
+ <pre>
162
+ <span class="ruby-comment cmt"># File lib/hobix/base.rb, line 457</span>
163
+ 457: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_ratings</span><span class="ruby-identifier">content_ratings</span>; <span class="ruby-ivar">@content_ratings</span> <span class="ruby-operator">||</span> [<span class="ruby-identifier">:ham</span>]; <span class="ruby-keyword kw">end</span>
164
+ </pre>
165
+ </div>
166
+ </div>
167
+ </div>
168
+
169
+ <div id="method-M000109" class="method-detail">
170
+ <a name="M000109"></a>
171
+
172
+ <div class="method-heading">
173
+ <a href="#M000109" class="method-signature">
174
+ <span class="method-name">to_search</span><span class="method-args">()</span>
175
+ </a>
176
+ </div>
177
+
178
+ <div class="method-description">
179
+ <p>
180
+ Build the searchable text
181
+ </p>
182
+ <p><a class="source-toggle" href="#"
183
+ onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
184
+ <div class="method-source-code" id="M000109-source">
185
+ <pre>
186
+ <span class="ruby-comment cmt"># File lib/hobix/base.rb, line 464</span>
187
+ 464: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_search</span>
188
+ 465: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">properties</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">opts</span><span class="ruby-operator">|</span>
189
+ 466: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">opts</span>
190
+ 467: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">instance_variable_get</span>( <span class="ruby-node">&quot;@#{ name }&quot;</span> )
191
+ 468: <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">val</span>
192
+ 469: <span class="ruby-identifier">val</span> = <span class="ruby-identifier">val</span>.<span class="ruby-identifier">strftime</span> <span class="ruby-value str">&quot;%Y-%m-%dT%H:%M:%S&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-identifier">:strftime</span>
193
+ 470: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">:search</span>]
194
+ 471: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:prefix</span>
195
+ 472: <span class="ruby-node">&quot;#{ name }:&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span>
196
+ 473: <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:fulltext</span>
197
+ 474: <span class="ruby-identifier">val</span>.<span class="ruby-identifier">to_s</span>
198
+ 475: <span class="ruby-keyword kw">end</span>
199
+ 476: <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">join</span> <span class="ruby-value str">&quot;\n&quot;</span>
200
+ 477: <span class="ruby-keyword kw">end</span>
201
+ </pre>
202
+ </div>
203
+ </div>
204
+ </div>
205
+
206
+
207
+ </div>
208
+
209
+
210
+ </div>
211
+
212
+
213
+ <div id="validator-badges">
214
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
215
+ </div>
216
+
217
+ </body>
218
+ </html>
@@ -0,0 +1,205 @@
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::BaseFacet</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::BaseFacet</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
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="BasePlugin.html">
69
+ BasePlugin
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ The <a href="BaseFacet.html">BaseFacet</a> plugin is the superclass for all
86
+ plugins which have an interface (CGI, UI, etc.) These interfaces expose
87
+ some functionality to the user through an entry form or series of views.
88
+ </p>
89
+
90
+ </div>
91
+
92
+
93
+ </div>
94
+
95
+ <div id="method-list">
96
+ <h3 class="section-bar">Methods</h3>
97
+
98
+ <div class="name-list">
99
+ <a href="#M000280">not_found</a>&nbsp;&nbsp;
100
+ <a href="#M000281">protect</a>&nbsp;&nbsp;
101
+ </div>
102
+ </div>
103
+
104
+ </div>
105
+
106
+
107
+ <!-- if includes -->
108
+
109
+ <div id="section">
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+ <!-- if method_list -->
119
+ <div id="methods">
120
+ <h3 class="section-bar">Public Class methods</h3>
121
+
122
+ <div id="method-M000280" class="method-detail">
123
+ <a name="M000280"></a>
124
+
125
+ <div class="method-heading">
126
+ <a href="#M000280" class="method-signature">
127
+ <span class="method-name">not_found</span><span class="method-args">(app)</span>
128
+ </a>
129
+ </div>
130
+
131
+ <div class="method-description">
132
+ <p><a class="source-toggle" href="#"
133
+ onclick="toggleCode('M000280-source');return false;">[Source]</a></p>
134
+ <div class="method-source-code" id="M000280-source">
135
+ <pre>
136
+ <span class="ruby-comment cmt"># File lib/hobix/base.rb, line 166</span>
137
+ 166: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">not_found</span> <span class="ruby-identifier">app</span>
138
+ 167: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">send_not_found</span> <span class="ruby-node">&quot;Action `#{ app.action_uri }' not found. If this address should work, check your plugins.&quot;</span>
139
+ 168: <span class="ruby-keyword kw">end</span>
140
+ </pre>
141
+ </div>
142
+ </div>
143
+ </div>
144
+
145
+ <h3 class="section-bar">Public Instance methods</h3>
146
+
147
+ <div id="method-M000281" class="method-detail">
148
+ <a name="M000281"></a>
149
+
150
+ <div class="method-heading">
151
+ <a href="#M000281" class="method-signature">
152
+ <span class="method-name">protect</span><span class="method-args">(app, weblog)</span>
153
+ </a>
154
+ </div>
155
+
156
+ <div class="method-description">
157
+ <p><a class="source-toggle" href="#"
158
+ onclick="toggleCode('M000281-source');return false;">[Source]</a></p>
159
+ <div class="method-source-code" id="M000281-source">
160
+ <pre>
161
+ <span class="ruby-comment cmt"># File lib/hobix/base.rb, line 169</span>
162
+ 169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">protect</span> <span class="ruby-identifier">app</span>, <span class="ruby-identifier">weblog</span>
163
+ 170: <span class="ruby-identifier">auth</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'HTTP_AUTHORIZATION'</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'X-HTTP_AUTHORIZATION'</span>]
164
+ 171: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">auth</span>
165
+ 172: <span class="ruby-identifier">realm</span> = <span class="ruby-value str">'Hobix login'</span>
166
+ 173: <span class="ruby-identifier">auth_type</span>, <span class="ruby-identifier">auth</span> = <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">split</span> <span class="ruby-value str">' '</span>, <span class="ruby-value">2</span>
167
+ 174: <span class="ruby-identifier">authorized</span> = <span class="ruby-keyword kw">false</span>
168
+ 175: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">auth_type</span>.<span class="ruby-identifier">downcase</span>
169
+ 176: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'basic'</span>
170
+ 177: <span class="ruby-identifier">require</span> <span class="ruby-value str">'base64'</span>
171
+ 178: <span class="ruby-identifier">name</span>, <span class="ruby-identifier">pass</span> = <span class="ruby-constant">Base64</span><span class="ruby-operator">::</span><span class="ruby-identifier">decode64</span>( <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">strip</span> ).<span class="ruby-identifier">split</span> <span class="ruby-value str">':'</span>, <span class="ruby-value">2</span>
172
+ 179: <span class="ruby-identifier">authorized</span> = <span class="ruby-identifier">weblog</span>.<span class="ruby-identifier">authorize</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">pass</span>
173
+ 180: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'digest'</span>
174
+ 181: <span class="ruby-identifier">require</span> <span class="ruby-value str">'md5'</span>
175
+ 182: <span class="ruby-identifier">opts</span> = {}
176
+ 183: <span class="ruby-identifier">auth</span>.<span class="ruby-identifier">gsub</span>( <span class="ruby-regexp re">/(\w+)=&quot;(.*?)&quot;/</span> ) { <span class="ruby-identifier">opts</span>[<span class="ruby-identifier">$1</span>] = <span class="ruby-identifier">$2</span> }
177
+ 184: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">opts</span>.<span class="ruby-identifier">inspect</span>
178
+ 185: <span class="ruby-keyword kw">end</span>
179
+ 186: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">authorized</span>
180
+ 187: <span class="ruby-keyword kw">end</span>
181
+ 188:
182
+ 189: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">send_unauthorized</span>
183
+ 190: <span class="ruby-comment cmt"># nonce = [&quot;#{ Time.now.to_f }:#{ app.action_uri }&quot;].pack(&quot;m&quot;).gsub /\s/, ''</span>
184
+ 191: <span class="ruby-comment cmt"># app.set_header 'WWW-Authenticate', %{Digest qop=&quot;auth&quot;, realm=&quot;#{ realm }&quot;, nonce=&quot;#{ nonce }&quot;, algorithm=&quot;MD5&quot;}</span>
185
+ 192: <span class="ruby-identifier">app</span>.<span class="ruby-identifier">set_header</span> <span class="ruby-value str">'WWW-Authenticate'</span>, <span class="ruby-node">%{Basic realm=&quot;#{ realm }&quot;}</span>
186
+ 193: <span class="ruby-keyword kw">false</span>
187
+ 194: <span class="ruby-keyword kw">end</span>
188
+ </pre>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+
194
+ </div>
195
+
196
+
197
+ </div>
198
+
199
+
200
+ <div id="validator-badges">
201
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
202
+ </div>
203
+
204
+ </body>
205
+ </html>
@@ -0,0 +1,122 @@
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::BaseOutput</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::BaseOutput</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
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="BasePlugin.html">
69
+ BasePlugin
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ The <a href="BaseOutput.html">BaseOutput</a> plugin is the underlying class
86
+ for all output plugins. These plugins are associated to templates. Based on
87
+ a template&#8216;s suffix, the proper output plugin is loaded and used to
88
+ generate page output.
89
+ </p>
90
+
91
+ </div>
92
+
93
+
94
+ </div>
95
+
96
+
97
+ </div>
98
+
99
+
100
+ <!-- if includes -->
101
+
102
+ <div id="section">
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ <!-- if method_list -->
112
+
113
+
114
+ </div>
115
+
116
+
117
+ <div id="validator-badges">
118
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
119
+ </div>
120
+
121
+ </body>
122
+ </html>