ramaze 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Rakefile +42 -0
  2. data/doc/allison/LICENSE +184 -0
  3. data/doc/allison/README +37 -0
  4. data/doc/allison/allison.css +300 -0
  5. data/doc/allison/allison.gif +0 -0
  6. data/doc/allison/allison.js +307 -0
  7. data/doc/allison/allison.rb +287 -0
  8. data/doc/allison/cache/BODY +588 -0
  9. data/doc/allison/cache/CLASS_INDEX +4 -0
  10. data/doc/allison/cache/CLASS_PAGE +1 -0
  11. data/doc/allison/cache/FILE_INDEX +4 -0
  12. data/doc/allison/cache/FILE_PAGE +1 -0
  13. data/doc/allison/cache/FONTS +1 -0
  14. data/doc/allison/cache/FR_INDEX_BODY +1 -0
  15. data/doc/allison/cache/IMGPATH +1 -0
  16. data/doc/allison/cache/INDEX +1 -0
  17. data/doc/allison/cache/JAVASCRIPT +307 -0
  18. data/doc/allison/cache/METHOD_INDEX +4 -0
  19. data/doc/allison/cache/METHOD_LIST +1 -0
  20. data/doc/allison/cache/SRC_PAGE +1 -0
  21. data/doc/allison/cache/STYLE +322 -0
  22. data/doc/allison/cache/URL +1 -0
  23. data/doc/readme_chunks/principles.txt +33 -18
  24. data/doc/tutorial/todolist.html +599 -0
  25. data/doc/tutorial/todolist.txt +230 -230
  26. data/examples/identity.rb +21 -0
  27. data/examples/nitro_form.rb +22 -0
  28. data/lib/ramaze/controller.rb +1 -1
  29. data/lib/ramaze/dispatcher.rb +10 -4
  30. data/lib/ramaze/helper/{openid.rb → identity.rb} +15 -6
  31. data/lib/ramaze/helper/nitroform.rb +10 -0
  32. data/lib/ramaze/helper/stack.rb +1 -1
  33. data/lib/ramaze/inform.rb +18 -8
  34. data/lib/ramaze/snippets/kernel/aquire.rb +3 -3
  35. data/lib/ramaze/snippets/object/traits.rb +1 -1
  36. data/lib/ramaze/snippets/ramaze/caller_info.rb +17 -1
  37. data/lib/ramaze/snippets/ramaze/caller_lines.rb +1 -1
  38. data/lib/ramaze/store/yaml.rb +10 -1
  39. data/lib/ramaze/template/ezamar.rb +10 -5
  40. data/lib/ramaze/trinity/request.rb +12 -2
  41. data/lib/ramaze/version.rb +1 -1
  42. data/lib/ramaze.rb +5 -3
  43. data/spec/public/error404.xhtml +1 -0
  44. data/spec/spec_all.rb +21 -19
  45. data/spec/spec_helper.rb +1 -1
  46. data/spec/tc_error.rb +18 -4
  47. data/spec/tc_helper_cache.rb +1 -1
  48. data/spec/tc_helper_flash.rb +1 -2
  49. metadata +32 -4
data/Rakefile CHANGED
@@ -390,3 +390,45 @@ task 'build-readme' do
390
390
  end
391
391
  end
392
392
  end
393
+
394
+ task 'tutorial2html' do
395
+ require 'bluecloth'
396
+
397
+ basefile = File.join('doc', 'tutorial', 'todolist')
398
+
399
+ content = File.read(basefile + '.txt')
400
+
401
+ html = BlueCloth.new(content).to_html
402
+
403
+ wrap = %{
404
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
405
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
406
+ <html>
407
+ <head>
408
+ <title>Ramaze Tutorial: Todolist</title>
409
+ <style>
410
+ body {
411
+ background: #eee;
412
+ }
413
+ code {
414
+ background: #ddd;
415
+ }
416
+ pre code {
417
+ background: #ddd;
418
+ width: 70%;
419
+ display: block;
420
+ margin: 1em;
421
+ padding: 0.7em;
422
+ overflow: auto;
423
+ }
424
+ </style>
425
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
426
+ </head>
427
+ <body>
428
+ #{html}
429
+ </body>
430
+ </html>
431
+ }.strip
432
+
433
+ File.open(basefile + '.html', 'w+'){|f| f.puts(wrap) }
434
+ end
@@ -0,0 +1,184 @@
1
+ Academic Free License (AFL) v. 3.0
2
+
3
+ This Academic Free License (the "License") applies to any original work
4
+ of authorship (the "Original Work") whose owner (the "Licensor") has
5
+ placed the following licensing notice adjacent to the copyright notice
6
+ for the Original Work:
7
+
8
+ Licensed under the Academic Free License version 3.0
9
+
10
+ 1) Grant of Copyright License. Licensor grants You a worldwide,
11
+ royalty-free, non-exclusive, sublicensable license, for the duration of
12
+ the copyright, to do the following:
13
+
14
+ a) to reproduce the Original Work in copies, either alone or as part of
15
+ a collective work;
16
+
17
+ b) to translate, adapt, alter, transform, modify, or arrange the
18
+ Original Work, thereby creating derivative works ("Derivative Works")
19
+ based upon the Original Work;
20
+
21
+ c) to distribute or communicate copies of the Original Work and
22
+ Derivative Works to the public, under any license of your choice that
23
+ does not contradict the terms and conditions, including Licensor's
24
+ reserved rights and remedies, in this Academic Free License;
25
+
26
+ d) to perform the Original Work publicly; and
27
+
28
+ e) to display the Original Work publicly.
29
+
30
+ 2) Grant of Patent License. Licensor grants You a worldwide,
31
+ royalty-free, non-exclusive, sublicensable license, under patent claims
32
+ owned or controlled by the Licensor that are embodied in the Original
33
+ Work as furnished by the Licensor, for the duration of the patents, to
34
+ make, use, sell, offer for sale, have made, and import the Original Work
35
+ and Derivative Works.
36
+
37
+ 3) Grant of Source Code License. The term "Source Code" means the
38
+ preferred form of the Original Work for making modifications to it and
39
+ all available documentation describing how to modify the Original Work.
40
+ Licensor agrees to provide a machine-readable copy of the Source Code of
41
+ the Original Work along with each copy of the Original Work that
42
+ Licensor distributes. Licensor reserves the right to satisfy this
43
+ obligation by placing a machine-readable copy of the Source Code in an
44
+ information repository reasonably calculated to permit inexpensive and
45
+ convenient access by You for as long as Licensor continues to distribute
46
+ the Original Work.
47
+
48
+ 4) Exclusions From License Grant. Neither the names of Licensor, nor the
49
+ names of any contributors to the Original Work, nor any of their
50
+ trademarks or service marks, may be used to endorse or promote products
51
+ derived from this Original Work without express prior permission of the
52
+ Licensor. Except as expressly stated herein, nothing in this License
53
+ grants any license to Licensor's trademarks, copyrights, patents, trade
54
+ secrets or any other intellectual property. No patent license is granted
55
+ to make, use, sell, offer for sale, have made, or import embodiments of
56
+ any patent claims other than the licensed claims defined in Section 2.
57
+ No license is granted to the trademarks of Licensor even if such marks
58
+ are included in the Original Work. Nothing in this License shall be
59
+ interpreted to prohibit Licensor from licensing under terms different
60
+ from this License any Original Work that Licensor otherwise would have a
61
+ right to license.
62
+
63
+ 5) External Deployment. The term "External Deployment" means the use,
64
+ distribution, or communication of the Original Work or Derivative Works
65
+ in any way such that the Original Work or Derivative Works may be used
66
+ by anyone other than You, whether those works are distributed or
67
+ communicated to those persons or made available as an application
68
+ intended for use over a network. As an express condition for the grants
69
+ of license hereunder, You must treat any External Deployment by You of
70
+ the Original Work or a Derivative Work as a distribution under section
71
+ 1(c).
72
+
73
+ 6) Attribution Rights. You must retain, in the Source Code of any
74
+ Derivative Works that You create, all copyright, patent, or trademark
75
+ notices from the Source Code of the Original Work, as well as any
76
+ notices of licensing and any descriptive text identified therein as an
77
+ "Attribution Notice." You must cause the Source Code for any Derivative
78
+ Works that You create to carry a prominent Attribution Notice reasonably
79
+ calculated to inform recipients that You have modified the Original
80
+ Work.
81
+
82
+ 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants
83
+ that the copyright in and to the Original Work and the patent rights
84
+ granted herein by Licensor are owned by the Licensor or are sublicensed
85
+ to You under the terms of this License with the permission of the
86
+ contributor(s) of those copyrights and patent rights. Except as
87
+ expressly stated in the immediately preceding sentence, the Original
88
+ Work is provided under this License on an "AS IS" BASIS and WITHOUT
89
+ WARRANTY, either express or implied, including, without limitation, the
90
+ warranties of non-infringement, merchantability or fitness for a
91
+ particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
92
+ WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
93
+ part of this License. No license to the Original Work is granted by this
94
+ License except under this disclaimer.
95
+
96
+ 8) Limitation of Liability. Under no circumstances and under no legal
97
+ theory, whether in tort (including negligence), contract, or otherwise,
98
+ shall the Licensor be liable to anyone for any indirect, special,
99
+ incidental, or consequential damages of any character arising as a
100
+ result of this License or the use of the Original Work including,
101
+ without limitation, damages for loss of goodwill, work stoppage,
102
+ computer failure or malfunction, or any and all other commercial damages
103
+ or losses. This limitation of liability shall not apply to the extent
104
+ applicable law prohibits such limitation.
105
+
106
+ 9) Acceptance and Termination. If, at any time, You expressly assented
107
+ to this License, that assent indicates your clear and irrevocable
108
+ acceptance of this License and all of its terms and conditions. If You
109
+ distribute or communicate copies of the Original Work or a Derivative
110
+ Work, You must make a reasonable effort under the circumstances to
111
+ obtain the express assent of recipients to the terms of this License.
112
+ This License conditions your rights to undertake the activities listed
113
+ in Section 1, including your right to create Derivative Works based upon
114
+ the Original Work, and doing so without honoring these terms and
115
+ conditions is prohibited by copyright law and international treaty.
116
+ Nothing in this License is intended to affect copyright exceptions and
117
+ limitations (including "fair use" or "fair dealing"). This License shall
118
+ terminate immediately and You may no longer exercise any of the rights
119
+ granted to You by this License upon your failure to honor the conditions
120
+ in Section 1(c).
121
+
122
+ 10) Termination for Patent Action. This License shall terminate
123
+ automatically and You may no longer exercise any of the rights granted
124
+ to You by this License as of the date You commence an action, including
125
+ a cross-claim or counterclaim, against Licensor or any licensee alleging
126
+ that the Original Work infringes a patent. This termination provision
127
+ shall not apply for an action alleging patent infringement by
128
+ combinations of the Original Work with other software or hardware.
129
+
130
+ 11) Jurisdiction, Venue and Governing Law. Any action or suit relating
131
+ to this License may be brought only in the courts of a jurisdiction
132
+ wherein the Licensor resides or in which Licensor conducts its primary
133
+ business, and under the laws of that jurisdiction excluding its
134
+ conflict-of-law provisions. The application of the United Nations
135
+ Convention on Contracts for the International Sale of Goods is expressly
136
+ excluded. Any use of the Original Work outside the scope of this License
137
+ or after its termination shall be subject to the requirements and
138
+ penalties of copyright or patent law in the appropriate jurisdiction.
139
+ This section shall survive the termination of this License.
140
+
141
+ 12) Attorneys' Fees. In any action to enforce the terms of this License
142
+ or seeking damages relating thereto, the prevailing party shall be
143
+ entitled to recover its costs and expenses, including, without
144
+ limitation, reasonable attorneys' fees and costs incurred in connection
145
+ with such action, including any appeal of such action. This section
146
+ shall survive the termination of this License.
147
+
148
+ 13) Miscellaneous. If any provision of this License is held to be
149
+ unenforceable, such provision shall be reformed only to the extent
150
+ necessary to make it enforceable.
151
+
152
+ 14) Definition of "You" in This License. "You" throughout this License,
153
+ whether in upper or lower case, means an individual or a legal entity
154
+ exercising rights under, and complying with all of the terms of, this
155
+ License. For legal entities, "You" includes any entity that controls, is
156
+ controlled by, or is under common control with you. For purposes of this
157
+ definition, "control" means (i) the power, direct or indirect, to cause
158
+ the direction or management of such entity, whether by contract or
159
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
160
+ outstanding shares, or (iii) beneficial ownership of such entity.
161
+
162
+ 15) Right to Use. You may use the Original Work in all ways not
163
+ otherwise restricted or conditioned by this License or by law, and
164
+ Licensor promises not to interfere with or be responsible for such uses
165
+ by You.
166
+
167
+ 16) Modification of This License. This License is Copyright (c) 2005
168
+ Lawrence Rosen. Permission is granted to copy, distribute, or
169
+ communicate this License without modification. Nothing in this License
170
+ permits You to modify this License as applied to the Original Work or to
171
+ Derivative Works. However, You may modify the text of this License and
172
+ copy, distribute or communicate your modified version (the "Modified
173
+ License") and apply it to other original works of authorship subject to
174
+ the following conditions: (i) You may not indicate in any way that your
175
+ Modified License is the "Academic Free License" or "AFL" and you may not
176
+ use those names in the name of your Modified License; (ii) You must
177
+ replace the notice specified in the first paragraph above with the
178
+ notice "Licensed under <insert your license name here>" or with a notice
179
+ of your own that is not confusingly similar to the notice in this
180
+ License; and (iii) You may not claim that your original works are open
181
+ source software unless your Modified License has been approved by Open
182
+ Source Initiative (OSI) and You comply with its license review and
183
+ certification process.
184
+
@@ -0,0 +1,37 @@
1
+
2
+ COPYRIGHT
3
+
4
+ Allison template for RDoc, copyright 2006 Cloudburst, LLC (see the LICENSE file)
5
+
6
+ DETAILED DOCUMENTATION
7
+
8
+ http://blog.evanweaver.com/articles/2006/06/02/allison
9
+
10
+ QUICKSTART
11
+
12
+ The best way to use the template is to set up a Rake task for your Ruby project or Rails app:
13
+ in Rakefile
14
+
15
+ require 'rake/rdoctask'
16
+
17
+ Rake::RDocTask.new do |rdoc|
18
+ files = ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb',
19
+ 'doc/**/*.rdoc', 'test/*.rb']
20
+ rdoc.rdoc_files.add(files)
21
+ rdoc.main = "README" # page to start on
22
+ rdoc.title = "My App's Documentation"
23
+ rdoc.template = "/path/to/allison/allison.rb"
24
+ rdoc.rdoc_dir = 'doc' # rdoc output folder
25
+ rdoc.options << '--line-numbers' << '--inline-source'
26
+ end
27
+
28
+ Then you can run rake rdoc to invoke the task and everything will be super awesome.
29
+
30
+ Note, pop-up source view is not supported. You have to use --inline-source.
31
+
32
+ CHANGELOG
33
+
34
+ 2.2 how come "require_gem" isn't called "activate_gem", since that's what it does. bah.
35
+ 2.1 hack to make gem versioning work
36
+ 2. caching in order to remove Markaby dependency
37
+ 1. first release
@@ -0,0 +1,300 @@
1
+
2
+ /* Stylesheet for Allison RDoc template */
3
+ /* Copyright 2006 Cloudburst LLC */
4
+
5
+ /* default styles */
6
+
7
+ * {
8
+ margin: 0
9
+ padding: 0
10
+ border: none
11
+ }
12
+
13
+ a {
14
+ color: @dark_teal = "#244"
15
+ font-weight: bold
16
+ text-decoration: none
17
+ }
18
+
19
+ a:hover {
20
+ text-decoration: underline
21
+ } a:visited {
22
+ font-weight: normal
23
+ }
24
+
25
+ html, body {
26
+ color: @body_color = "#270f2b"
27
+ background-color: @background_teal = "#eeffff"
28
+ text-align: center
29
+ margin: 0
30
+ padding: 0
31
+ }
32
+
33
+ p, ul, ol, li {
34
+ line-height: @lh = "1.4em"
35
+ margin: .4em
36
+ } p {
37
+ margin: @lh
38
+ } h1 {
39
+ margin-top: .4em
40
+ } #item_name {
41
+ margin-top: -.4em
42
+ }
43
+
44
+ h2 {
45
+ font-size: 2em
46
+ margin-top: 1em
47
+ margin-right: -1em
48
+ }
49
+
50
+
51
+ /* center everything */
52
+
53
+ #container {
54
+ margin: 20px auto 0 auto
55
+ width: @width = 900
56
+ text-align: left
57
+ }
58
+
59
+
60
+ @buffer = 10
61
+
62
+ /* header stuff */
63
+
64
+ #header {
65
+ padding: @buffer
66
+ padding-top: 0
67
+ width: @width - @buffer * 2
68
+ height: @d= 91 - @buffer * 2
69
+ _height: @d + @buffer
70
+ margin-bottom: 25px
71
+ vertical-align: baseline
72
+ background: url('data:image/gif;base64,%allison.gif%') no-repeat top right
73
+ background-color: @red_purple = "#cee"
74
+ overflow: hidden
75
+ } .curve {
76
+ background-color: @red_purple
77
+ margin: 0
78
+ padding: 0
79
+ height: 1px
80
+ overflow: hidden /* again, ie problem */
81
+ }
82
+
83
+ def curve(div_id, curve_array, width); s = ""; curve_array.length.times {|n| s += "\n##{div_id}#{curve_array.length - 1 - n}{border-left: #{curve_array[n]}px solid #{@background_teal}; border-right: #{curve_array[n]}px solid #{@background_teal}; width: #{width - curve_array[n]*2}px; _width: #{width - 20}px; }"}; s; end
84
+ @curves = [0, 1, 1, 1, 2, 2, 3, 4, 5, 7, 10]
85
+
86
+ curve("preheader_curve_", @curves, @width)
87
+
88
+ #header h1 {
89
+ color: @white = "#122"
90
+ font-size: 3em
91
+ margin: 0
92
+ } #header p {
93
+ margin: 0
94
+ padding: 0
95
+ padding-left: 3px
96
+ color: @white
97
+ } #header a {
98
+ color: @white
99
+ text-decoration: none
100
+ font-weight: bold
101
+ }
102
+
103
+ /* basic layout and navigation bars */
104
+
105
+ #left {
106
+ background-color: @deep_purple = "#cdd"
107
+ width: @left_width = 220
108
+ float: left
109
+ _width: @left_width - @buffer * 2
110
+ } #left a {
111
+ line-height: 1.2em
112
+ } #left div.curve {
113
+ float: left
114
+ background-color: @deep_purple
115
+ }
116
+
117
+ /* navigation bar colors and text styles */
118
+
119
+ .navigation {
120
+ width: @left_width - @buffer * 4
121
+ margin: @buffer
122
+ padding: @buffer
123
+ text-align: left
124
+ background-color: @background_teal
125
+ overflow: hidden
126
+ } .navigation a, {
127
+ margin-left: @buffer
128
+ } .navigation h3 {
129
+ font-weight: bold
130
+ margin-bottom: 5px
131
+ } .dark {
132
+ background-color: @gray_purple = "#bcc"
133
+ } .dark a, .dark span {
134
+ color: @white
135
+ margin-left: @buffer
136
+ } span.bpink {
137
+ color: @dark_teal
138
+ font-weight: bold
139
+ margin-left: @buffer
140
+ } span.bpink a, .dark span a {
141
+ margin-left: 0
142
+ } #spacer {
143
+ background-color: @background_teal
144
+ height: @buffer * 3
145
+ display: none
146
+ }
147
+
148
+ #content {
149
+ padding: @content_padding = 20
150
+ width: @width - @left_width - @content_padding * 2
151
+ background-color: @background_teal
152
+ float: left
153
+ }
154
+
155
+ .clear {
156
+ clear: both
157
+ }
158
+
159
+ #footer {
160
+ margin: 0 auto
161
+ text-align: right
162
+ background-color: @background_teal
163
+ font-size: .8em
164
+ padding: @buffer
165
+ } #footer a {
166
+ font-weight: normal
167
+ color: @gray_purple
168
+ }
169
+
170
+ /* for that dumb redirect index page I can't avoid */
171
+
172
+ #redirect {
173
+ text-align: center
174
+ } #redirect a {
175
+ color: @deep_purple
176
+ }
177
+
178
+ /* tables */
179
+
180
+ table {
181
+ width: @width - @left_width - @buffer * 8
182
+ border-collapse: collapse
183
+ }
184
+ td, th {
185
+ background-color: @background_teal
186
+ text-align: left
187
+ padding-left: @td = @buffer / 2
188
+ padding-right: @td
189
+ padding-top: @td
190
+ line-height: 1.2em
191
+ } th {
192
+ color: @white
193
+ background-color: @red_purple
194
+ } th.description {
195
+ text-align: center
196
+ } td.highlight {
197
+ color: @dark_teal
198
+ } td.first, th.first {
199
+ background-color: @red_purple
200
+ }
201
+
202
+
203
+ /* method details */
204
+
205
+ div.a_method {
206
+ background: @red_purple
207
+ padding: @buffer
208
+ margin-left: @buffer * 2 + 2
209
+ } div.a_method h3 {
210
+ color: @dark_teal
211
+ } div.a_method div {
212
+ background: #bdd
213
+ padding-left: @buffer
214
+ } div.a_method a.small {
215
+ font-size: .1em
216
+ line-height: .1em
217
+ } div.a_method p {
218
+ margin: .6em
219
+ margin-left: @lh
220
+ }
221
+
222
+ div.section_spacer {
223
+ height: 0
224
+ margin-top: @buffer * 2
225
+ }
226
+
227
+
228
+ /* index includes on the navigation bar */
229
+
230
+ div.index a {
231
+ font-size: .8em
232
+ } #method {
233
+ display: none
234
+ } #file, #class {
235
+ display: block
236
+ } div.list_header {
237
+ float: left
238
+ } div.list_header_link {
239
+ float: right
240
+ padding-top: 3px
241
+ } div.list_header_link a {
242
+ font-weight: normal
243
+ } #method_wrapper {
244
+ margin-bottom: 0
245
+ }
246
+
247
+ .index label {
248
+ font-size: 0.8em
249
+ } .index form input {
250
+ width: @left_width - @buffer * 11
251
+ } .index form {
252
+ margin-bottom: @buffer
253
+ }
254
+
255
+ curve("left_curve_", @curves.reverse, @left_width)
256
+
257
+ ol, ul {
258
+ margin-left: @buffer * 5
259
+ } ul {
260
+ list-style-type: square
261
+ }
262
+
263
+ p.source_link a {
264
+ text-align: right
265
+ font-weight: normal
266
+ } div.source {
267
+ display: none
268
+ } pre {
269
+ color: black
270
+ font-weight: normal
271
+ /* font-family: Courier, Courier New, monospace */
272
+ font-size: .8em
273
+ padding: @buffer
274
+ margin-left: @buffer * 2
275
+ overflow: auto
276
+ /* next 4 lines because IE sucks */
277
+ _position: relative
278
+ _width: @width - @left_width - (@buffer * 11 + 3)
279
+ _overflow-x:scroll
280
+ _overflow-y:visible
281
+ } div.source pre {
282
+ margin-left: 0
283
+ } p.source_link {
284
+ text-align: center
285
+ }
286
+
287
+ /* source code highlighting */
288
+
289
+ pre .ruby-value, pre .ruby-symbol {
290
+ color: @blue = "#1104bb"
291
+ } pre .ruby-value.str, pre .ruby-node {
292
+ color: @dark_teal #red = "#d20000"
293
+ } pre .ruby-ivar, pre .ruby-cvar {
294
+ } pre .ruby-comment {
295
+ color: @green = "#009500"
296
+ } pre .ruby-constant {
297
+ color: @orange = "#cd8802"
298
+ } pre .ruby-keyword {
299
+ color: @purple = "#8d04aa"
300
+ }