ramaze 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -259
- data/bin/ramaze +52 -25
- data/doc/AUTHORS +6 -0
- data/doc/CHANGELOG +1363 -42
- data/doc/INSTALL +1 -1
- data/doc/README +48 -35
- data/doc/README.html +637 -0
- data/doc/TODO +7 -16
- data/doc/allison/allison.css +6 -7
- data/doc/allison/allison.gif +0 -0
- data/doc/allison/cache/STYLE +1 -2
- data/doc/changes.txt +3375 -0
- data/doc/changes.xml +3378 -0
- data/doc/meta/announcement.txt +47 -0
- data/doc/meta/configuration.txt +179 -0
- data/doc/meta/internals.txt +111 -0
- data/doc/readme_chunks/features.txt +8 -16
- data/doc/readme_chunks/installing.txt +7 -1
- data/doc/tutorial/todolist.txt +2 -3
- data/examples/blog/main.rb +9 -8
- data/examples/blog/public/styles/blog.css +132 -0
- data/examples/blog/src/controller.rb +14 -41
- data/examples/blog/src/model.rb +12 -13
- data/examples/blog/src/view.rb +16 -0
- data/examples/blog/template/edit.xhtml +19 -8
- data/examples/blog/template/index.xhtml +14 -22
- data/examples/blog/template/new.xhtml +18 -5
- data/examples/caching.rb +5 -8
- data/examples/element.rb +3 -3
- data/examples/hello.rb +3 -5
- data/examples/simple.rb +4 -7
- data/examples/templates/template/external.haml +8 -7
- data/examples/templates/template/external.mab +11 -8
- data/examples/templates/template_amrita2.rb +4 -4
- data/examples/templates/template_erubis.rb +3 -3
- data/examples/templates/template_ezamar.rb +1 -2
- data/examples/templates/template_haml.rb +24 -23
- data/examples/templates/template_liquid.rb +3 -1
- data/examples/templates/template_markaby.rb +15 -9
- data/examples/todolist/src/element/page.rb +1 -1
- data/lib/proto/conf/benchmark.yaml +6 -20
- data/lib/proto/conf/debug.yaml +6 -19
- data/lib/proto/conf/live.yaml +7 -19
- data/lib/proto/conf/silent.yaml +6 -16
- data/lib/proto/conf/stage.yaml +6 -18
- data/lib/proto/public/error.zmr +2 -2
- data/lib/ramaze.rb +34 -72
- data/lib/ramaze/adapter.rb +21 -18
- data/lib/ramaze/adapter/mongrel.rb +0 -3
- data/lib/ramaze/adapter/webrick.rb +6 -6
- data/lib/ramaze/cache/memcached.rb +3 -0
- data/lib/ramaze/controller.rb +227 -183
- data/lib/ramaze/dispatcher.rb +34 -129
- data/lib/ramaze/dispatcher/action.rb +28 -0
- data/lib/ramaze/dispatcher/error.rb +43 -0
- data/lib/ramaze/dispatcher/file.rb +34 -0
- data/lib/ramaze/global.rb +89 -48
- data/lib/ramaze/helper/aspect.rb +8 -6
- data/lib/ramaze/helper/auth.rb +3 -3
- data/lib/ramaze/helper/cache.rb +2 -2
- data/lib/ramaze/helper/file.rb +14 -0
- data/lib/ramaze/helper/inform.rb +36 -0
- data/lib/ramaze/helper/link.rb +7 -3
- data/lib/ramaze/helper/markaby.rb +30 -0
- data/lib/ramaze/helper/redirect.rb +2 -0
- data/lib/ramaze/inform.rb +8 -182
- data/lib/ramaze/inform/analogger.rb +19 -0
- data/lib/ramaze/inform/growl.rb +28 -0
- data/lib/ramaze/inform/hub.rb +26 -0
- data/lib/ramaze/inform/informer.rb +92 -0
- data/lib/ramaze/inform/informing.rb +44 -0
- data/lib/ramaze/inform/syslog.rb +27 -0
- data/lib/ramaze/inform/xosd.rb +42 -0
- data/lib/ramaze/snippets.rb +6 -2
- data/lib/ramaze/snippets/object/traits.rb +13 -1
- data/lib/ramaze/snippets/ramaze/autoreload.rb +58 -2
- data/lib/ramaze/snippets/string/color.rb +27 -0
- data/lib/ramaze/snippets/string/each.rb +6 -0
- data/lib/ramaze/snippets/struct/fill.rb +15 -0
- data/lib/ramaze/template/ezamar.rb +13 -22
- data/lib/ramaze/template/ezamar/element.rb +12 -12
- data/lib/ramaze/template/liquid.rb +19 -18
- data/lib/ramaze/template/markaby.rb +37 -58
- data/lib/ramaze/tool/localize.rb +128 -0
- data/lib/ramaze/tool/tidy.rb +51 -21
- data/lib/ramaze/trinity.rb +3 -3
- data/lib/ramaze/trinity/request.rb +41 -23
- data/lib/ramaze/trinity/response.rb +10 -5
- data/lib/ramaze/trinity/session.rb +17 -3
- data/lib/ramaze/version.rb +2 -2
- data/rake_tasks/conf.rake +56 -0
- data/rake_tasks/gem.rake +44 -0
- data/rake_tasks/maintaince.rake +187 -0
- data/spec/all.rb +32 -0
- data/spec/examples/caching.rb +19 -0
- data/spec/examples/element.rb +15 -0
- data/spec/examples/hello.rb +11 -0
- data/spec/examples/simple.rb +51 -0
- data/spec/examples/templates/template_amrita2.rb +14 -0
- data/spec/examples/templates/template_erubis.rb +21 -0
- data/spec/examples/templates/template_ezamar.rb +22 -0
- data/spec/examples/templates/template_haml.rb +23 -0
- data/spec/examples/templates/template_liquid.rb +24 -0
- data/spec/examples/templates/template_markaby.rb +21 -0
- data/spec/helper.rb +81 -0
- data/spec/{spec_helper_context.rb → helper/context.rb} +1 -1
- data/spec/helper/layout.rb +55 -0
- data/spec/helper/mock_http.rb +66 -0
- data/spec/{spec_helper_requester.rb → helper/requester.rb} +0 -6
- data/spec/{spec_helper_simple_http.rb → helper/simple_http.rb} +57 -57
- data/spec/helper/wrap.rb +193 -0
- data/spec/{adapter_spec.rb → ramaze/adapter.rb} +7 -5
- data/spec/{tc_adapter_mongrel.rb → ramaze/adapter/mongrel.rb} +2 -2
- data/spec/{tc_adapter_webrick.rb → ramaze/adapter/webrick.rb} +2 -2
- data/spec/{tc_cache.rb → ramaze/cache.rb} +16 -16
- data/spec/ramaze/conf/locale_de.yaml +6 -0
- data/spec/ramaze/conf/locale_en.yaml +6 -0
- data/spec/ramaze/controller.rb +184 -0
- data/spec/ramaze/controller/template/greet.xhtml +1 -0
- data/spec/ramaze/controller/template_resolving.rb +54 -0
- data/spec/ramaze/dependencies.rb +16 -0
- data/spec/{tc_element.rb → ramaze/element.rb} +21 -19
- data/spec/ramaze/error.rb +64 -0
- data/spec/{tc_gestalt.rb → ramaze/gestalt.rb} +10 -10
- data/spec/{tc_global.rb → ramaze/global.rb} +7 -7
- data/spec/{tc_helper_aspect.rb → ramaze/helper/aspect.rb} +22 -14
- data/spec/{tc_helper_auth.rb → ramaze/helper/auth.rb} +9 -7
- data/spec/{tc_helper_cache.rb → ramaze/helper/cache.rb} +14 -24
- data/spec/{tc_helper_feed.rb → ramaze/helper/feed.rb} +12 -12
- data/spec/ramaze/helper/file.rb +17 -0
- data/spec/{tc_helper_flash.rb → ramaze/helper/flash.rb} +16 -17
- data/spec/{tc_helper_form.rb → ramaze/helper/form.rb} +25 -26
- data/spec/{tc_helper_link.rb → ramaze/helper/link.rb} +9 -9
- data/spec/{tc_helper_redirect.rb → ramaze/helper/redirect.rb} +11 -10
- data/spec/{tc_helper_stack.rb → ramaze/helper/stack.rb} +10 -11
- data/spec/ramaze/inform/informer.rb +40 -0
- data/spec/ramaze/inform/syslog.rb +10 -0
- data/spec/ramaze/localize.rb +40 -0
- data/spec/ramaze/morpher.rb +82 -0
- data/spec/ramaze/params.rb +124 -0
- data/spec/{public → ramaze/public}/error404.xhtml +0 -0
- data/spec/{public → ramaze/public}/favicon.ico +0 -0
- data/spec/{public → ramaze/public}/ramaze.png +0 -0
- data/spec/{public → ramaze/public}/test_download.css +0 -0
- data/spec/ramaze/request.rb +129 -0
- data/spec/{tc_request_mongrel.rb → ramaze/request/mongrel.rb} +2 -2
- data/spec/{tc_request_webrick.rb → ramaze/request/webrick.rb} +1 -1
- data/spec/{tc_session.rb → ramaze/session.rb} +18 -18
- data/spec/{tc_store.rb → ramaze/store/default.rb} +10 -10
- data/spec/{tc_store_yaml.rb → ramaze/store/yaml.rb} +9 -9
- data/spec/ramaze/template.rb +86 -0
- data/spec/{tc_template_amrita2.rb → ramaze/template/amrita2.rb} +5 -5
- data/spec/{template → ramaze/template}/amrita2/data.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/index.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/sum.amrita +0 -0
- data/spec/{tc_template_erubis.rb → ramaze/template/erubis.rb} +9 -9
- data/spec/{template → ramaze/template}/erubis/sum.rhtml +0 -0
- data/spec/ramaze/template/ezamar.rb +62 -0
- data/spec/{template → ramaze/template}/ezamar/another/long/action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/combined.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/file_only.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/index.zmr +0 -0
- data/spec/ramaze/template/ezamar/nested.zmr +1 -0
- data/spec/{template → ramaze/template}/ezamar/some__long__action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/sum.zmr +0 -0
- data/spec/{tc_template_haml.rb → ramaze/template/haml.rb} +7 -7
- data/spec/{template → ramaze/template}/haml/index.haml +0 -0
- data/spec/{template → ramaze/template}/haml/with_vars.haml +0 -0
- data/spec/{tc_template_liquid.rb → ramaze/template/liquid.rb} +7 -7
- data/spec/{template → ramaze/template}/liquid/index.liquid +0 -0
- data/spec/{template → ramaze/template}/liquid/products.liquid +0 -0
- data/spec/ramaze/template/markaby.rb +59 -0
- data/spec/{template → ramaze/template}/markaby/external.mab +0 -0
- data/spec/{template → ramaze/template}/markaby/sum.mab +0 -0
- data/spec/ramaze/template/ramaze/external.test +1 -0
- data/spec/{tc_tidy.rb → ramaze/tidy.rb} +3 -3
- metadata +145 -81
- data/examples/blog/public/screen.css +0 -106
- data/examples/blog/src/element.rb +0 -58
- data/examples/blog/template/view.xhtml +0 -15
- data/examples/blog/test/tc_entry.rb +0 -18
- data/lib/proto/public/404.jpg +0 -0
- data/spec/request_tc_helper.rb +0 -135
- data/spec/spec_all.rb +0 -118
- data/spec/spec_helper.rb +0 -66
- data/spec/tc_controller.rb +0 -49
- data/spec/tc_dependencies.rb +0 -13
- data/spec/tc_error.rb +0 -43
- data/spec/tc_morpher.rb +0 -88
- data/spec/tc_params.rb +0 -125
- data/spec/tc_template_ezamar.rb +0 -64
- data/spec/tc_template_markaby.rb +0 -72
- data/spec/template/ezamar/nested.zmr +0 -1
data/doc/INSTALL
CHANGED
@@ -26,7 +26,7 @@
|
|
26
26
|
To get the latest and sweetest, you can just pull from the repository and run
|
27
27
|
Ramaze that way.
|
28
28
|
|
29
|
-
$ darcs get http://manveru.mine.nu/ramaze
|
29
|
+
$ darcs get --partial http://manveru.mine.nu/ramaze
|
30
30
|
|
31
31
|
Please read the man page or `darcs help` for more information about updating
|
32
32
|
and creating your own patches.
|
data/doc/README
CHANGED
@@ -34,16 +34,14 @@ Ramaze offers following features at the moment:
|
|
34
34
|
|
35
35
|
Rack supports at the moment:
|
36
36
|
|
37
|
-
* Mongrel
|
37
|
+
* [Mongrel](http://mongrel.rubyforge.org/)
|
38
38
|
|
39
|
-
http://mongrel.rubyforge.org/
|
40
39
|
Mongrel is a fast HTTP library and server for Ruby that is intended for
|
41
40
|
hosting Ruby web applications of any kind using plain HTTP rather than
|
42
41
|
FastCGI or SCGI.
|
43
42
|
|
44
|
-
* WEBrick
|
43
|
+
* [WEBrick](http://www.webrick.org/)
|
45
44
|
|
46
|
-
http://www.webrick.org/
|
47
45
|
WEBrick is a Ruby library program to build HTTP servers.
|
48
46
|
|
49
47
|
* CGI
|
@@ -53,37 +51,31 @@ Ramaze offers following features at the moment:
|
|
53
51
|
|
54
52
|
|
55
53
|
* Templates
|
56
|
-
* Amrita2
|
54
|
+
* [Amrita2](http://amrita2.rubyforge.org/)
|
57
55
|
|
58
|
-
http://amrita2.rubyforge.org/
|
59
56
|
Amrita2 is a xml/xhtml template library for Ruby. It makes html documents
|
60
57
|
from a template and a model data.
|
61
58
|
|
62
|
-
* Erubis
|
59
|
+
* [Erubis](http://rubyforge.org/projects/erubis)
|
63
60
|
|
64
|
-
http://rubyforge.org/projects/erubis
|
65
61
|
Erubis is a fast, secure, and very extensible implementation of eRuby.
|
66
62
|
|
67
|
-
* Haml
|
63
|
+
* [Haml](http://haml.hamptoncatlin.com/)
|
68
64
|
|
69
|
-
http://haml.hamptoncatlin.com/
|
70
65
|
Haml takes your gross, ugly templates and replaces them with veritable Haiku.
|
71
66
|
|
72
|
-
* Liquid
|
67
|
+
* [Liquid](http://home.leetsoft.com/liquid)
|
73
68
|
|
74
|
-
http://home.leetsoft.com/liquid
|
75
69
|
Liquid's syntax and parse model are inspired by Django templates, as well
|
76
70
|
as PHP's smarty.
|
77
71
|
|
78
|
-
* Markaby
|
72
|
+
* [Markaby](http://code.whytheluckystiff.net/markaby/)
|
79
73
|
|
80
|
-
http://code.whytheluckystiff.net/markaby/
|
81
74
|
Markaby means Markup as Ruby.
|
82
75
|
|
83
76
|
* Ezamar
|
84
77
|
|
85
|
-
A simple homage to
|
86
|
-
for more information.
|
78
|
+
A simple homage to [Nitro](http://nitroproject.org)s templating.
|
87
79
|
|
88
80
|
* Cache
|
89
81
|
* Hash
|
@@ -113,45 +105,60 @@ Ramaze offers following features at the moment:
|
|
113
105
|
|
114
106
|
There are some basic principles that Ramaze tries to follow:
|
115
107
|
|
116
|
-
*
|
108
|
+
* KISS (Keep It Super Simple)
|
117
109
|
|
118
|
-
|
110
|
+
Ramaze doesn't introduce any major change of paradigm for everyone familiar
|
111
|
+
with Ruby and the basics of Web-development.
|
119
112
|
|
113
|
+
* POLS (Principle Of Least Surprise)
|
120
114
|
|
121
|
-
|
115
|
+
Ramaze tries to be intuitive and easy to learn. Most functionality is built in
|
116
|
+
a way to help, not to obfuscate or confuse.
|
122
117
|
|
123
|
-
|
118
|
+
* Modular design
|
124
119
|
|
120
|
+
Use what you want and how you want it.
|
125
121
|
|
126
|
-
|
122
|
+
Through Ruby Ramaze provides one of the most powerful programming-languages
|
123
|
+
available, giving you full control over your system.
|
127
124
|
|
128
|
-
|
125
|
+
Even the most essential parts of Ramaze can easily be replaced and/or modified
|
126
|
+
without losing the advantage of the whole framework.
|
129
127
|
|
128
|
+
* Minimal dependencies
|
130
129
|
|
131
|
-
|
130
|
+
Nothing besides Ruby is required for the basic features.
|
132
131
|
|
133
|
-
|
132
|
+
Of course you can take advantage of several wonderful libraries, but Ramaze is
|
133
|
+
built in a way to be run on any basic setup.
|
134
134
|
|
135
|
+
* Documentation
|
135
136
|
|
136
|
-
|
137
|
+
Document everything, classes, modules, methods, configuration...
|
137
138
|
|
138
|
-
|
139
|
+
Through 100% documentation Ramaze gives the developer easy and solid
|
140
|
+
understanding of the underlying concepts and functionality.
|
139
141
|
|
142
|
+
* Open development
|
140
143
|
|
141
|
-
|
144
|
+
Everyone is welcome to contribute to Ramaze in the easiest way possible. The
|
145
|
+
repository is open for patches passing the Test-suite.
|
142
146
|
|
143
|
-
|
147
|
+
* Examples
|
144
148
|
|
149
|
+
Everyone learns different, some only read the source, others browse
|
150
|
+
documentation, but everyone loves examples for a quick and painless start.
|
145
151
|
|
146
|
-
|
152
|
+
Ramaze addresses this need and offers a wide variety of examples of usage,
|
153
|
+
basic functionality, project-layout and more advanced applications.
|
147
154
|
|
148
|
-
|
155
|
+
* Fully BDD (Behaviour Driven Design)
|
149
156
|
|
157
|
+
Ramaze has a very complete set of so-called specifications built by RSpec.
|
158
|
+
These specs define the way Ramaze has to behave.
|
150
159
|
|
151
|
-
|
152
|
-
|
153
|
-
I happily accept all patches or feature-requests that you may have,
|
154
|
-
as long as they comply with these principles
|
160
|
+
The specs are checked every time a new patch is pushed into the repository,
|
161
|
+
deciding whether the changes the patch applies are valid and don't break the framework.
|
155
162
|
|
156
163
|
|
157
164
|
= Installation
|
@@ -165,12 +172,13 @@ There are some basic principles that Ramaze tries to follow:
|
|
165
172
|
in case you have RubyGems installed.
|
166
173
|
(this will work as soon as I have registered on RubyForge ;)
|
167
174
|
|
175
|
+
|
168
176
|
* via darcs
|
169
177
|
|
170
178
|
To get the latest and sweetest, you can just pull from the repository and run
|
171
179
|
Ramaze that way.
|
172
180
|
|
173
|
-
$ darcs get http://manveru.mine.nu/ramaze
|
181
|
+
$ darcs get --partial http://manveru.mine.nu/ramaze
|
174
182
|
|
175
183
|
Please read the man page or `darcs help` for more information about updating
|
176
184
|
and creating your own patches.
|
@@ -199,6 +207,11 @@ There are some basic principles that Ramaze tries to follow:
|
|
199
207
|
$ gzip -c ramaze_bundle > ramaze_bundle.gz
|
200
208
|
|
201
209
|
|
210
|
+
* via install.rb
|
211
|
+
|
212
|
+
Support for install.rb has been canceled and the file removed.
|
213
|
+
|
214
|
+
|
202
215
|
= Getting Started
|
203
216
|
|
204
217
|
Now that you have a vague idea of what you're about to get into you might just
|
data/doc/README.html
ADDED
@@ -0,0 +1,637 @@
|
|
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>File: README</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="fileHeader">
|
50
|
+
<h1>README</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>doc/README
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Fri May 11 20:47:35 +0900 2007</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<pre>
|
73
|
+
Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
|
74
|
+
All files in this distribution are subject to the terms of the Ruby license.
|
75
|
+
</pre>
|
76
|
+
<h1>About Ramaze</h1>
|
77
|
+
<p>
|
78
|
+
Ramaze is a very simple and straight-forward web-framework. The philosophy
|
79
|
+
of it could be expressed in a mix of KISS and POLS, trying to make simple
|
80
|
+
things simple and complex things possible.
|
81
|
+
</p>
|
82
|
+
<p>
|
83
|
+
This of course is nothing new to anyone who knows some ruby, but is often
|
84
|
+
forgotten in a chase for new functionality and features. Ramaze only tries
|
85
|
+
to give you the ultimate tools, but you have to use them yourself to
|
86
|
+
achieve perfect custom-tailored results.
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
Another one of the goals during development of Ramaze was to make every
|
90
|
+
part as modular and therefor reuasable as possible, not only to provide a
|
91
|
+
basic understanding after the first glance, but also to make it as simple
|
92
|
+
as possible to reuse parts of the code.
|
93
|
+
</p>
|
94
|
+
<p>
|
95
|
+
The original purpose of Ramaze was to act as a kind of framework to build
|
96
|
+
web-frameworks, this was made obsolete by the introduction of rack, which
|
97
|
+
provides this feature at a better level without trying to enforce any
|
98
|
+
structural layout of the resulting framework.
|
99
|
+
</p>
|
100
|
+
<h1>Features Overview</h1>
|
101
|
+
<p>
|
102
|
+
Ramaze offers following features at the moment:
|
103
|
+
</p>
|
104
|
+
<ul>
|
105
|
+
<li>Adapters
|
106
|
+
|
107
|
+
<pre>
|
108
|
+
Ramaze takes advantage of the rack library to provide a common way of
|
109
|
+
handling different ways to serve its content.
|
110
|
+
|
111
|
+
Rack supports at the moment:
|
112
|
+
|
113
|
+
* [Mongrel](http://mongrel.rubyforge.org/)
|
114
|
+
|
115
|
+
Mongrel is a fast HTTP library and server for Ruby that is intended for
|
116
|
+
hosting Ruby web applications of any kind using plain HTTP rather than
|
117
|
+
FastCGI or SCGI.
|
118
|
+
|
119
|
+
* [WEBrick](http://www.webrick.org/)
|
120
|
+
|
121
|
+
WEBrick is a Ruby library program to build HTTP servers.
|
122
|
+
|
123
|
+
* CGI
|
124
|
+
|
125
|
+
CGI is the Common Gateway Interface and is one of the most basic ways
|
126
|
+
to integrate into Webservers like Apache, Lighttpd or Nginx.
|
127
|
+
</pre>
|
128
|
+
</li>
|
129
|
+
<li>Templates
|
130
|
+
|
131
|
+
<ul>
|
132
|
+
<li>[Amrita2](<a
|
133
|
+
href="http://amrita2.rubyforge.org">amrita2.rubyforge.org</a>/)
|
134
|
+
|
135
|
+
<p>
|
136
|
+
Amrita2 is a xml/xhtml template library for Ruby. It makes html documents
|
137
|
+
from a template and a model data.
|
138
|
+
</p>
|
139
|
+
</li>
|
140
|
+
<li>[Erubis](<a
|
141
|
+
href="http://rubyforge.org/projects/erubis">rubyforge.org/projects/erubis</a>)
|
142
|
+
|
143
|
+
<p>
|
144
|
+
Erubis is a fast, secure, and very extensible implementation of eRuby.
|
145
|
+
</p>
|
146
|
+
</li>
|
147
|
+
<li>[Haml](<a href="http://haml.hamptoncatlin.com">haml.hamptoncatlin.com</a>/)
|
148
|
+
|
149
|
+
<p>
|
150
|
+
Haml takes your gross, ugly templates and replaces them with veritable
|
151
|
+
Haiku.
|
152
|
+
</p>
|
153
|
+
</li>
|
154
|
+
<li>[Liquid](<a
|
155
|
+
href="http://home.leetsoft.com/liquid">home.leetsoft.com/liquid</a>)
|
156
|
+
|
157
|
+
<p>
|
158
|
+
Liquid‘s syntax and parse model are inspired by Django templates, as
|
159
|
+
well as PHP‘s smarty.
|
160
|
+
</p>
|
161
|
+
</li>
|
162
|
+
<li>[Markaby](<a
|
163
|
+
href="http://code.whytheluckystiff.net/markaby">code.whytheluckystiff.net/markaby</a>/)
|
164
|
+
|
165
|
+
<p>
|
166
|
+
Markaby means Markup as Ruby.
|
167
|
+
</p>
|
168
|
+
</li>
|
169
|
+
<li>Ezamar
|
170
|
+
|
171
|
+
<p>
|
172
|
+
A simple homage to [Nitro](<a
|
173
|
+
href="http://nitroproject.org)s">nitroproject.org)s</a> templating.
|
174
|
+
</p>
|
175
|
+
</li>
|
176
|
+
</ul>
|
177
|
+
</li>
|
178
|
+
<li>Cache
|
179
|
+
|
180
|
+
<ul>
|
181
|
+
<li>Hash
|
182
|
+
|
183
|
+
</li>
|
184
|
+
<li>YAML::Store
|
185
|
+
|
186
|
+
</li>
|
187
|
+
<li>MemCache
|
188
|
+
|
189
|
+
</li>
|
190
|
+
</ul>
|
191
|
+
</li>
|
192
|
+
<li>Helper
|
193
|
+
|
194
|
+
<ul>
|
195
|
+
<li>Aspect
|
196
|
+
|
197
|
+
</li>
|
198
|
+
<li>Auth
|
199
|
+
|
200
|
+
</li>
|
201
|
+
<li>Cache
|
202
|
+
|
203
|
+
</li>
|
204
|
+
<li>Feed
|
205
|
+
|
206
|
+
</li>
|
207
|
+
<li>Flash
|
208
|
+
|
209
|
+
</li>
|
210
|
+
<li>Form
|
211
|
+
|
212
|
+
</li>
|
213
|
+
<li>Link
|
214
|
+
|
215
|
+
</li>
|
216
|
+
<li>OpenID
|
217
|
+
|
218
|
+
</li>
|
219
|
+
<li>Redirect
|
220
|
+
|
221
|
+
</li>
|
222
|
+
<li>Stack
|
223
|
+
|
224
|
+
</li>
|
225
|
+
</ul>
|
226
|
+
</li>
|
227
|
+
<li>Various
|
228
|
+
|
229
|
+
<ul>
|
230
|
+
<li>Sessions
|
231
|
+
|
232
|
+
</li>
|
233
|
+
<li>Global configuration system
|
234
|
+
|
235
|
+
</li>
|
236
|
+
<li>Simple request/response handling
|
237
|
+
|
238
|
+
</li>
|
239
|
+
<li>Custom Error-handling
|
240
|
+
|
241
|
+
</li>
|
242
|
+
</ul>
|
243
|
+
</li>
|
244
|
+
</ul>
|
245
|
+
<h1>Basic Principles</h1>
|
246
|
+
<p>
|
247
|
+
There are some basic principles that Ramaze tries to follow:
|
248
|
+
</p>
|
249
|
+
<ul>
|
250
|
+
<li>KISS (Keep It Super Simple)
|
251
|
+
|
252
|
+
<p>
|
253
|
+
Ramaze doesn‘t introduce any major change of paradigm for everyone
|
254
|
+
familiar with Ruby and the basics of Web-development.
|
255
|
+
</p>
|
256
|
+
</li>
|
257
|
+
<li>POLS (Principle Of Least Surprise)
|
258
|
+
|
259
|
+
<p>
|
260
|
+
Ramaze tries to be intuitive and easy to learn. Most functionality is built
|
261
|
+
in a way to help, not to obfuscate or confuse.
|
262
|
+
</p>
|
263
|
+
</li>
|
264
|
+
<li>Modular design
|
265
|
+
|
266
|
+
<p>
|
267
|
+
Use what you want and how you want it.
|
268
|
+
</p>
|
269
|
+
<p>
|
270
|
+
Through Ruby Ramaze provides one of the most powerful programming-languages
|
271
|
+
available, giving you full control over your system.
|
272
|
+
</p>
|
273
|
+
<p>
|
274
|
+
Even the most essential parts of Ramaze can easily be replaced and/or
|
275
|
+
modified without losing the advantage of the whole framework.
|
276
|
+
</p>
|
277
|
+
</li>
|
278
|
+
<li>Minimal dependencies
|
279
|
+
|
280
|
+
<p>
|
281
|
+
Nothing besides Ruby is required for the basic features.
|
282
|
+
</p>
|
283
|
+
<p>
|
284
|
+
Of course you can take advantage of several wonderful libraries, but Ramaze
|
285
|
+
is built in a way to be run on any basic setup.
|
286
|
+
</p>
|
287
|
+
</li>
|
288
|
+
<li>Documentation
|
289
|
+
|
290
|
+
<p>
|
291
|
+
Document everything, classes, modules, methods, configuration…
|
292
|
+
</p>
|
293
|
+
<p>
|
294
|
+
Through 100% documentation Ramaze gives the developer easy and solid
|
295
|
+
understanding of the underlying concepts and functionality.
|
296
|
+
</p>
|
297
|
+
</li>
|
298
|
+
<li>Open development
|
299
|
+
|
300
|
+
<p>
|
301
|
+
Everyone is welcome to contribute to Ramaze in the easiest way possible.
|
302
|
+
The repository is open for patches passing the Test-suite.
|
303
|
+
</p>
|
304
|
+
</li>
|
305
|
+
<li>Examples
|
306
|
+
|
307
|
+
<p>
|
308
|
+
Everyone learns different, some only read the source, others browse
|
309
|
+
documentation, but everyone loves examples for a quick and painless start.
|
310
|
+
</p>
|
311
|
+
<p>
|
312
|
+
Ramaze addresses this need and offers a wide variety of examples of usage,
|
313
|
+
basic functionality, project-layout and more advanced applications.
|
314
|
+
</p>
|
315
|
+
</li>
|
316
|
+
<li>Fully BDD (Behaviour Driven Design)
|
317
|
+
|
318
|
+
<p>
|
319
|
+
Ramaze has a very complete set of so-called specifications built by RSpec.
|
320
|
+
These specs define the way Ramaze has to behave.
|
321
|
+
</p>
|
322
|
+
<p>
|
323
|
+
The specs are checked every time a new patch is pushed into the repository,
|
324
|
+
deciding whether the changes the patch applies are valid and don‘t
|
325
|
+
break the framework.
|
326
|
+
</p>
|
327
|
+
</li>
|
328
|
+
</ul>
|
329
|
+
<h1>Installation</h1>
|
330
|
+
<ul>
|
331
|
+
<li>via RubyGems
|
332
|
+
|
333
|
+
<p>
|
334
|
+
The simplest way of installing Ramaze is via
|
335
|
+
</p>
|
336
|
+
<pre>
|
337
|
+
$ gem install ramaze
|
338
|
+
</pre>
|
339
|
+
<p>
|
340
|
+
in case you have RubyGems installed. (this will work as soon as I have
|
341
|
+
registered on RubyForge ;)
|
342
|
+
</p>
|
343
|
+
</li>
|
344
|
+
<li>via darcs
|
345
|
+
|
346
|
+
<p>
|
347
|
+
To get the latest and sweetest, you can just pull from the repository and
|
348
|
+
run Ramaze that way.
|
349
|
+
</p>
|
350
|
+
<pre>
|
351
|
+
$ darcs get --partial http://manveru.mine.nu/ramaze
|
352
|
+
</pre>
|
353
|
+
<p>
|
354
|
+
Please read the man page or `darcs help` for more information about
|
355
|
+
updating and creating your own patches. This is at the moment the premier
|
356
|
+
way to use Ramaze, since it is the way I use it.
|
357
|
+
</p>
|
358
|
+
<p>
|
359
|
+
Some hints for the usage of Darcs.
|
360
|
+
</p>
|
361
|
+
<ul>
|
362
|
+
<li>use require ‘ramaze’ from everywhere
|
363
|
+
|
364
|
+
<p>
|
365
|
+
add a file to your site_ruby named ‘ramaze.rb’ the content
|
366
|
+
should be: "require
|
367
|
+
’/path/to/darcs/repo/ramaze/lib/ramaze’"
|
368
|
+
</p>
|
369
|
+
</li>
|
370
|
+
<li>get the latest version (from inside the ramaze-directory)
|
371
|
+
|
372
|
+
<p>
|
373
|
+
$ darcs pull
|
374
|
+
</p>
|
375
|
+
</li>
|
376
|
+
<li>record a patch
|
377
|
+
|
378
|
+
<p>
|
379
|
+
$ darcs record
|
380
|
+
</p>
|
381
|
+
</li>
|
382
|
+
<li>output your patches into a bundle ready to be mailed (compress it before
|
383
|
+
sending to make sure it arrives in the way you sent it)
|
384
|
+
|
385
|
+
<p>
|
386
|
+
$ darcs send -o ramaze_bundle $ gzip -c ramaze_bundle > ramaze_bundle.gz
|
387
|
+
</p>
|
388
|
+
</li>
|
389
|
+
</ul>
|
390
|
+
</li>
|
391
|
+
<li>via install.rb
|
392
|
+
|
393
|
+
<p>
|
394
|
+
Support for install.rb has been canceled and the file removed.
|
395
|
+
</p>
|
396
|
+
</li>
|
397
|
+
</ul>
|
398
|
+
<h1>Getting Started</h1>
|
399
|
+
<p>
|
400
|
+
Now that you have a vague idea of what you‘re about to get into you
|
401
|
+
might just want to get a way to get up and running ASAP. Please read below
|
402
|
+
for more information about installation.
|
403
|
+
</p>
|
404
|
+
<p>
|
405
|
+
Depending on what you are planning to do you can either just go and start
|
406
|
+
reading the source or directly get some hands-on experience by trying some
|
407
|
+
of the examples. Most things will require dependencies though. The basic
|
408
|
+
functionality is provided by the WEBrick adapter and the Template::Ramaze,
|
409
|
+
which just run out of the box. For more features you will have to install
|
410
|
+
some templating-engines and mongrel (<em>very</em> recommended). Ramaze
|
411
|
+
will inform you when it needs further dependencies, so just go and try some
|
412
|
+
things.
|
413
|
+
</p>
|
414
|
+
<p>
|
415
|
+
Some places to get started are:
|
416
|
+
</p>
|
417
|
+
<ul>
|
418
|
+
<li>Read the documentation.
|
419
|
+
|
420
|
+
</li>
|
421
|
+
<li>Run and read the test cases.
|
422
|
+
|
423
|
+
</li>
|
424
|
+
<li>Look at the examples and run/modify them.
|
425
|
+
|
426
|
+
</li>
|
427
|
+
</ul>
|
428
|
+
<h1>A couple of Examples</h1>
|
429
|
+
<p>
|
430
|
+
There are some examples for your instant pleasure inside the
|
431
|
+
examples-directory in the Ramaze-distribution. To start up an example, you
|
432
|
+
can use the Ramaze binary located in bin/ramaze for example:
|
433
|
+
</p>
|
434
|
+
<pre>
|
435
|
+
$ ramaze examples/hello.rb
|
436
|
+
</pre>
|
437
|
+
<p>
|
438
|
+
Or:
|
439
|
+
</p>
|
440
|
+
<pre>
|
441
|
+
$ cd examples/blog
|
442
|
+
$ ramaze
|
443
|
+
</pre>
|
444
|
+
<p>
|
445
|
+
Since ramaze uses the main.rb by default if you don‘t pass anything
|
446
|
+
else.
|
447
|
+
</p>
|
448
|
+
<p>
|
449
|
+
For more information about the usage of ramaze try:
|
450
|
+
</p>
|
451
|
+
<pre>
|
452
|
+
$ ramaze --help
|
453
|
+
</pre>
|
454
|
+
<p>
|
455
|
+
Examples include:
|
456
|
+
</p>
|
457
|
+
<ul>
|
458
|
+
<li>examples/hello.rb Hello, World!
|
459
|
+
|
460
|
+
</li>
|
461
|
+
<li>examples/simple.rb A bit more advanced than the hello-example, but still
|
462
|
+
very basic.
|
463
|
+
|
464
|
+
</li>
|
465
|
+
<li>examples/blog Not yet fully functional, but coming along.
|
466
|
+
|
467
|
+
</li>
|
468
|
+
<li>examples/whywiki A basic examples of a minimalistic application, based on
|
469
|
+
the Wiki of _why in his camping-framework.
|
470
|
+
|
471
|
+
</li>
|
472
|
+
<li>examples/templates examples of real usage of the templating-engines. Tries
|
473
|
+
to implement the same functionality in each template_*.rb file using a
|
474
|
+
different engine.
|
475
|
+
|
476
|
+
</li>
|
477
|
+
</ul>
|
478
|
+
<h1>How to find Help</h1>
|
479
|
+
<p>
|
480
|
+
For help you can:
|
481
|
+
</p>
|
482
|
+
<ul>
|
483
|
+
<li>Visit us in the channel ramaze on irc.freenode.net
|
484
|
+
|
485
|
+
</li>
|
486
|
+
<li>Join the Mailinglist at <a
|
487
|
+
href="http://ramaze.rubyforge.org">ramaze.rubyforge.org</a>
|
488
|
+
|
489
|
+
</li>
|
490
|
+
</ul>
|
491
|
+
<h1>Appendix</h1>
|
492
|
+
<ul>
|
493
|
+
<li>Nicer Error-pages
|
494
|
+
|
495
|
+
<ul>
|
496
|
+
<li>Install coderay (it‘s a gem)
|
497
|
+
|
498
|
+
</li>
|
499
|
+
</ul>
|
500
|
+
</li>
|
501
|
+
<li>Performance
|
502
|
+
|
503
|
+
<ul>
|
504
|
+
<li>Serving
|
505
|
+
|
506
|
+
<p>
|
507
|
+
For best performance you should consider using Mongrel to host your
|
508
|
+
application.
|
509
|
+
</p>
|
510
|
+
</li>
|
511
|
+
<li>Caching
|
512
|
+
|
513
|
+
<p>
|
514
|
+
You can easily cache your pages using the CacheHelper. Also, using MemCache
|
515
|
+
gives you high-end performance and security.
|
516
|
+
</p>
|
517
|
+
</li>
|
518
|
+
</ul>
|
519
|
+
</li>
|
520
|
+
</ul>
|
521
|
+
<h1>And thanks to…</h1>
|
522
|
+
<p>
|
523
|
+
There is a large number of people who made Ramaze possibe by their ongoing
|
524
|
+
efforts in the world of open source and by encouraging and helping me.
|
525
|
+
</p>
|
526
|
+
<p>
|
527
|
+
This list is by no means a full listing of all these people, but I try to
|
528
|
+
get a good coverage despite that.
|
529
|
+
</p>
|
530
|
+
<p>
|
531
|
+
I would like to thank:
|
532
|
+
</p>
|
533
|
+
<ul>
|
534
|
+
<li>Yukihiro Matsumoto a.k.a matz
|
535
|
+
|
536
|
+
<pre>
|
537
|
+
For giving the world Ruby and bringing fun back into programming.
|
538
|
+
</pre>
|
539
|
+
</li>
|
540
|
+
<li>Zed Shawn a.k.a. zedas
|
541
|
+
|
542
|
+
<pre>
|
543
|
+
For developing Mongrel, Ramaze started out as a simple Hello World based
|
544
|
+
on that awesome server.
|
545
|
+
</pre>
|
546
|
+
</li>
|
547
|
+
<li>Christian Neukirchen a.k.a chris2
|
548
|
+
|
549
|
+
<pre>
|
550
|
+
For building rack, which is just what the numerous web-developers had
|
551
|
+
anticipated and which will, with no doubt, change the world.
|
552
|
+
</pre>
|
553
|
+
</li>
|
554
|
+
<li>Pistos
|
555
|
+
|
556
|
+
<pre>
|
557
|
+
For continious encouragment and building the first real webpage on Ramaze.
|
558
|
+
His bugreports were invaluable.
|
559
|
+
</pre>
|
560
|
+
</li>
|
561
|
+
<li>Jim Weirich
|
562
|
+
|
563
|
+
<pre>
|
564
|
+
For Rake, which lifts off a lot of tasks from the shoulders of every
|
565
|
+
developer who uses it.
|
566
|
+
</pre>
|
567
|
+
</li>
|
568
|
+
<li>Thomas Sawyer a.k.a Trans
|
569
|
+
|
570
|
+
<pre>
|
571
|
+
Dragging me deep into the rabbit-hole and showing me how awesome Ruby
|
572
|
+
truely is through his work on facets, ratchets and tons of other projects.
|
573
|
+
</pre>
|
574
|
+
</li>
|
575
|
+
<li>George Moschovitis a.k.a gmosx
|
576
|
+
|
577
|
+
<pre>
|
578
|
+
For his tremendous efforts in the Nitro/Og framework, which is a source of
|
579
|
+
steady inspiration for Ramaze and brought me to Ruby in the first place.
|
580
|
+
</pre>
|
581
|
+
</li>
|
582
|
+
<li>Rob Levin a.k.a. lilo
|
583
|
+
|
584
|
+
<pre>
|
585
|
+
He founded the most excellent Freenode IRC-network, where the most important
|
586
|
+
channels for rubyists are located (as is #ramaze).
|
587
|
+
May he rest in peace.
|
588
|
+
</pre>
|
589
|
+
</li>
|
590
|
+
<li>The guys (and gals) in the various channels on Freenode
|
591
|
+
|
592
|
+
<pre>
|
593
|
+
As the people are way too many to be listed, here the channels that i call
|
594
|
+
my online home.
|
595
|
+
All the people in there deserve special thanks for getting me hooked to Ruby
|
596
|
+
and providing their help in a friendly and patient manner.
|
597
|
+
|
598
|
+
* #nitro
|
599
|
+
* #ruby-de
|
600
|
+
* #ruby-lang
|
601
|
+
* #rubyforce
|
602
|
+
</pre>
|
603
|
+
</li>
|
604
|
+
</ul>
|
605
|
+
|
606
|
+
</div>
|
607
|
+
|
608
|
+
|
609
|
+
</div>
|
610
|
+
|
611
|
+
|
612
|
+
</div>
|
613
|
+
|
614
|
+
|
615
|
+
<!-- if includes -->
|
616
|
+
|
617
|
+
<div id="section">
|
618
|
+
|
619
|
+
|
620
|
+
|
621
|
+
|
622
|
+
|
623
|
+
|
624
|
+
|
625
|
+
|
626
|
+
<!-- if method_list -->
|
627
|
+
|
628
|
+
|
629
|
+
</div>
|
630
|
+
|
631
|
+
|
632
|
+
<div id="validator-badges">
|
633
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
634
|
+
</div>
|
635
|
+
|
636
|
+
</body>
|
637
|
+
</html>
|