ramaze 2011.07.25 → 2011.10.23
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.mailmap +3 -2
- data/.travis.yml +17 -0
- data/.yardopts +13 -0
- data/README.md +95 -352
- data/examples/app/blog/app.rb +25 -64
- data/examples/app/blog/config.ru +11 -9
- data/examples/app/blog/controller/init.rb +29 -86
- data/examples/app/blog/controller/posts.rb +232 -0
- data/examples/app/blog/controller/users.rb +160 -0
- data/examples/app/blog/layout/default.xhtml +61 -0
- data/examples/app/blog/migrations/01_create_schema.rb +50 -0
- data/examples/app/blog/model/comment.rb +41 -54
- data/examples/app/blog/model/init.rb +41 -13
- data/examples/app/blog/model/post.rb +35 -0
- data/examples/app/blog/model/user.rb +105 -0
- data/examples/app/blog/public/.htaccess +24 -0
- data/examples/app/blog/public/css/grid.css +107 -0
- data/examples/app/blog/public/css/layout.css +203 -0
- data/examples/app/blog/public/css/reset.css +123 -0
- data/examples/app/blog/public/css/text.css +109 -0
- data/examples/app/blog/public/dispatch.fcgi +11 -0
- data/examples/app/blog/public/favicon.ico +0 -0
- data/examples/app/blog/public/images/bg.png +0 -0
- data/examples/app/blog/start.rb +18 -3
- data/examples/app/blog/view/feed.xhtml +23 -0
- data/examples/app/blog/view/form.xhtml +11 -0
- data/examples/app/blog/view/index.xhtml +44 -0
- data/examples/app/blog/view/users/form.xhtml +12 -0
- data/examples/app/blog/view/users/index.xhtml +30 -0
- data/examples/app/blog/view/users/login.xhtml +8 -0
- data/examples/app/blog/view/view.xhtml +68 -0
- data/{doc → guide}/AUTHORS +5 -3
- data/{doc → guide}/CHANGELOG +428 -0
- data/{doc/GPL → guide/GPL_LICENSE} +0 -0
- data/{doc/COPYING → guide/RUBY_LICENSE} +3 -6
- data/guide/_static/logo.png +0 -0
- data/guide/_static/logo.svg +49 -0
- data/guide/_static/ramaze_console.png +0 -0
- data/guide/css/common.css +20 -0
- data/guide/general/cache.md +167 -0
- data/guide/general/configuration.md +168 -0
- data/guide/general/contributing.md +108 -0
- data/guide/general/controllers.md +115 -0
- data/guide/general/helpers.md +76 -0
- data/guide/general/installation.md +58 -0
- data/guide/general/logging.md +99 -0
- data/guide/general/middlewares.md +100 -0
- data/guide/general/models.md +78 -0
- data/guide/general/principles.md +53 -0
- data/guide/general/ramaze_command.md +155 -0
- data/guide/general/routes.md +81 -0
- data/guide/general/sessions.md +140 -0
- data/guide/general/special_thanks.md +67 -0
- data/guide/general/testing.md +61 -0
- data/guide/general/views.md +322 -0
- data/guide/tutorials/introduction.md +259 -0
- data/lib/proto/config.ru +1 -1
- data/lib/proto/public/favicon.ico +0 -0
- data/lib/proto/view/index.xhtml +7 -7
- data/lib/ramaze.rb +4 -4
- data/lib/ramaze/app.rb +11 -11
- data/lib/ramaze/app_graph.rb +2 -4
- data/lib/ramaze/bin/console.rb +3 -3
- data/lib/ramaze/bin/create.rb +2 -2
- data/lib/ramaze/bin/restart.rb +4 -4
- data/lib/ramaze/bin/runner.rb +5 -5
- data/lib/ramaze/bin/start.rb +19 -4
- data/lib/ramaze/bin/status.rb +3 -3
- data/lib/ramaze/bin/stop.rb +3 -3
- data/lib/ramaze/cache.rb +1 -0
- data/lib/ramaze/cache/lru.rb +8 -4
- data/lib/ramaze/cache/memcache.rb +32 -13
- data/lib/ramaze/cache/redis.rb +164 -0
- data/lib/ramaze/cache/sequel.rb +43 -28
- data/lib/ramaze/controller.rb +1 -2
- data/lib/ramaze/dependencies.rb +40 -3
- data/lib/ramaze/helper/bench.rb +26 -16
- data/lib/ramaze/helper/blue_form.rb +46 -73
- data/lib/ramaze/helper/cache.rb +10 -6
- data/lib/ramaze/helper/csrf.rb +35 -39
- data/lib/ramaze/helper/disqus.rb +5 -4
- data/lib/ramaze/helper/email.rb +35 -24
- data/lib/ramaze/helper/erector.rb +9 -13
- data/lib/ramaze/helper/flash.rb +7 -9
- data/lib/ramaze/helper/formatting.rb +194 -179
- data/lib/ramaze/helper/gravatar.rb +4 -8
- data/lib/ramaze/helper/identity.rb +3 -3
- data/lib/ramaze/helper/layout.rb +23 -8
- data/lib/ramaze/helper/markaby.rb +1 -1
- data/lib/ramaze/helper/paginate.rb +46 -39
- data/lib/ramaze/helper/request_accessor.rb +3 -1
- data/lib/ramaze/helper/simple_captcha.rb +18 -17
- data/lib/ramaze/helper/stack.rb +1 -1
- data/lib/ramaze/helper/tagz.rb +4 -2
- data/lib/ramaze/helper/upload.rb +523 -0
- data/lib/ramaze/helper/user.rb +4 -8
- data/lib/ramaze/helper/xhtml.rb +11 -15
- data/lib/ramaze/log.rb +9 -6
- data/lib/ramaze/log/rotatinginformer.rb +62 -27
- data/lib/ramaze/log/syslog.rb +20 -15
- data/lib/ramaze/log/xosd.rb +2 -1
- data/lib/ramaze/reloader.rb +2 -0
- data/lib/ramaze/request.rb +11 -10
- data/lib/ramaze/setup.rb +23 -6
- data/lib/ramaze/snippets/array/put_within.rb +3 -9
- data/lib/ramaze/snippets/binding/locals.rb +5 -10
- data/lib/ramaze/snippets/fiber.rb +1 -23
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +3 -6
- data/lib/ramaze/snippets/numeric/filesize_format.rb +3 -5
- data/lib/ramaze/snippets/numeric/time.rb +3 -7
- data/lib/ramaze/snippets/object/__dir__.rb +3 -7
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +3 -6
- data/lib/ramaze/snippets/object/pretty.rb +3 -7
- data/lib/ramaze/snippets/object/scope.rb +7 -9
- data/lib/ramaze/snippets/proc/locals.rb +12 -12
- data/lib/ramaze/snippets/ramaze/acquire.rb +15 -14
- data/lib/ramaze/snippets/ramaze/deprecated.rb +1 -1
- data/lib/ramaze/snippets/ramaze/fiber.rb +1 -1
- data/lib/ramaze/snippets/ramaze/lru_hash.rb +2 -3
- data/lib/ramaze/snippets/ramaze/struct.rb +2 -4
- data/lib/ramaze/snippets/string/camel_case.rb +8 -10
- data/lib/ramaze/snippets/string/color.rb +3 -4
- data/lib/ramaze/snippets/string/end_with.rb +3 -6
- data/lib/ramaze/snippets/string/esc.rb +3 -8
- data/lib/ramaze/snippets/string/ord.rb +3 -8
- data/lib/ramaze/snippets/string/snake_case.rb +6 -9
- data/lib/ramaze/snippets/string/start_with.rb +3 -8
- data/lib/ramaze/snippets/string/unindent.rb +3 -6
- data/lib/ramaze/snippets/thread/into.rb +1 -3
- data/lib/ramaze/spec.rb +2 -31
- data/lib/ramaze/spec/bacon.rb +18 -2
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view.rb +1 -1
- data/ramaze.gemspec +1 -1
- data/spec/helper.rb +2 -1
- data/spec/ramaze/bin/start.rb +16 -20
- data/spec/ramaze/cache/localmemcache.rb +4 -7
- data/spec/ramaze/cache/memcache.rb +3 -1
- data/spec/ramaze/cache/redis.rb +62 -0
- data/spec/ramaze/helper/blue_form.rb +33 -4
- data/spec/ramaze/helper/layout.rb +40 -7
- data/spec/ramaze/helper/upload.rb +149 -0
- data/spec/ramaze/helper/uploads/text_1.txt +1 -0
- data/spec/ramaze/helper/uploads/text_2.txt +1 -0
- data/spec/ramaze/log/growl.rb +4 -6
- data/spec/ramaze/log/syslog.rb +6 -0
- data/spec/ramaze/view/lokar.rb +5 -0
- data/spec/ramaze/view/nagoro.rb +5 -0
- data/tasks/authors.rake +1 -1
- data/tasks/bacon.rake +14 -5
- data/tasks/changelog.rake +1 -1
- data/tasks/yard.rake +12 -4
- metadata +277 -239
- data/doc/LEGAL +0 -26
- data/examples/app/blog/README +0 -3
- data/examples/app/blog/controller/comment.rb +0 -45
- data/examples/app/blog/controller/entry.rb +0 -85
- data/examples/app/blog/controller/main.rb +0 -20
- data/examples/app/blog/controller/tag.rb +0 -9
- data/examples/app/blog/layout/default.nag +0 -31
- data/examples/app/blog/model/entry.rb +0 -89
- data/examples/app/blog/model/tag.rb +0 -36
- data/examples/app/blog/public/css/screen.css +0 -273
- data/examples/app/blog/spec/blog.rb +0 -87
- data/examples/app/blog/view/comment/form.nag +0 -10
- data/examples/app/blog/view/comment/show.nag +0 -16
- data/examples/app/blog/view/entry/edit.nag +0 -14
- data/examples/app/blog/view/entry/feed.atom.nag +0 -8
- data/examples/app/blog/view/entry/feed.rss.nag +0 -7
- data/examples/app/blog/view/entry/index.nag +0 -7
- data/examples/app/blog/view/entry/new.nag +0 -13
- data/examples/app/blog/view/entry/show.nag +0 -36
- data/examples/app/blog/view/feed.atom.nag +0 -18
- data/examples/app/blog/view/feed.rss.nag +0 -25
- data/examples/app/blog/view/index.nag +0 -6
- data/examples/app/blog/view/tag/index.nag +0 -5
- data/lib/proto/public/ramaze.png +0 -0
- data/lib/ramaze/rest.rb +0 -36
- data/spec/ramaze/rest.rb +0 -28
- data/tasks/rcov.rake +0 -22
data/.gitignore
CHANGED
data/.mailmap
CHANGED
@@ -28,5 +28,6 @@ Michael Fellinger <m.fellinger@gmail.com> <m.fellinger@gmail.com>
|
|
28
28
|
Michael Fellinger <m.fellinger@gmail.com> <manveru@sigma.localdomain>
|
29
29
|
Michael Fellinger <m.fellinger@gmail.com> <manveru@weez-int.com>
|
30
30
|
Michael Fellinger <m.fellinger@gmail.com> Michael Fellinger m.fellinger@gmail.com <>
|
31
|
-
|
32
|
-
|
31
|
+
Yorick Peterse <yorickpeterse@gmail.com> YorickPeterse <yorickpeterse@gmail.com>
|
32
|
+
Yorick Peterse <yorickpeterse@gmail.com> YorickPeterse <info@yorickpeterse.com>
|
33
|
+
Yorick Peterse <yorickpeterse@gmail.com> Yorick Peterse <info@yorickpeterse.com>
|
data/.travis.yml
ADDED
data/.yardopts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
./lib/ramaze/**/*.rb ./lib/ramaze.rb
|
2
|
+
-m markdown
|
3
|
+
-M rdiscount
|
4
|
+
-o ./doc
|
5
|
+
-r ./README.md
|
6
|
+
--private
|
7
|
+
--protected
|
8
|
+
--asset ./guide/_static:_static
|
9
|
+
--asset ./guide/css/common.css:css/common.css
|
10
|
+
-
|
11
|
+
./guide/**/*.md
|
12
|
+
./guide/GPL_LICENSE
|
13
|
+
./guide/RUBY_LICENSE
|
data/README.md
CHANGED
@@ -1,13 +1,10 @@
|
|
1
|
-
|
2
|
-
All files in this distribution are subject to the terms of the Ruby license.
|
1
|
+
# Ramaze
|
3
2
|
|
4
|
-
|
3
|
+
Ramaze is a very simple and straight-forward web-framework. The philosophy of
|
4
|
+
it could be expressed in a mix of KISS and POLS, trying to make simple things
|
5
|
+
simple and complex things possible.
|
5
6
|
|
6
|
-
|
7
|
-
The philosophy of it could be expressed in a mix of KISS and POLS, trying to
|
8
|
-
make simple things simple and complex things possible.
|
9
|
-
|
10
|
-
This of course is nothing new to anyone who knows some ruby, but is often
|
7
|
+
This of course is nothing new to anyone who knows some Ruby, but is often
|
11
8
|
forgotten in a chase for new functionality and features. Ramaze only tries to
|
12
9
|
give you the ultimate tools, but you have to use them yourself to achieve
|
13
10
|
perfect custom-tailored results.
|
@@ -18,366 +15,112 @@ understanding after the first glance, but also to make it as simple as possible
|
|
18
15
|
to reuse parts of the code.
|
19
16
|
|
20
17
|
The original purpose of Ramaze was to act as a kind of framework to build
|
21
|
-
web-frameworks, this was made obsolete by the introduction of
|
18
|
+
web-frameworks, this was made obsolete by the introduction of Rack, which
|
22
19
|
provides this feature at a better level without trying to enforce any structural
|
23
20
|
layout of the resulting framework.
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"Hello, Ramaze!"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
Ramaze.start
|
41
|
-
|
42
|
-
Once this is saved in a file (you can also run this from IRB) simply execute it using the
|
43
|
-
Ruby binary:
|
44
|
-
|
45
|
-
$ ruby hello_ramaze.rb
|
46
|
-
|
47
|
-
This starts a WEBRick server listening on localhost:7000.
|
48
|
-
|
49
|
-
## Features Overview
|
50
|
-
|
51
|
-
Ramaze offers following features at the moment:
|
52
|
-
|
53
|
-
### Adapters
|
54
|
-
|
55
|
-
Ramaze takes advantage of the Rack library to provide a common way of
|
56
|
-
handling different ways to serve its content. A few of the supported Rack adapters are:
|
57
|
-
|
58
|
-
* Mongrel
|
59
|
-
* WEBrick
|
60
|
-
* FCGI
|
61
|
-
* LiteSpeed
|
62
|
-
* Thin
|
63
|
-
|
64
|
-
### Templates
|
65
|
-
|
66
|
-
Ramaze can in theory support any template engine as long as there's an adapter for it. To
|
67
|
-
make your life easier Ramaze ships with adapters for the following template engines:
|
68
|
-
|
69
|
-
* [Erubis](http://rubyforge.org/projects/erubis)
|
70
|
-
* Etanni (small engine created for Ramaze)
|
71
|
-
* [Erector](http://erector.rubyforge.org/)
|
72
|
-
* [Haml](http://haml.hamptoncatlin.com/)
|
73
|
-
* [Liquid](http://home.leetsoft.com/liquid)
|
74
|
-
* [Markaby](http://code.whytheluckystiff.net/markaby/)
|
75
|
-
* [Remarkably](http://rubyforge.org/projects/remarkably)
|
76
|
-
* [Sass](http://haml.hamptoncatlin.com/docs/sass)
|
77
|
-
|
78
|
-
### Cache
|
79
|
-
|
80
|
-
* Hash
|
81
|
-
* YAML::Store
|
82
|
-
* LocalMemCache
|
83
|
-
* MemCache
|
84
|
-
* Sequel
|
85
|
-
|
86
|
-
### Helpers
|
87
|
-
|
88
|
-
Helpers are modules that can be included in your controllers or other classes to make it easier
|
89
|
-
to work with certain classes or systems without having to write the same boilerplate code over
|
90
|
-
and over again. Ramaze has a lot of helpers, the following helpers are loaded by default:
|
91
|
-
|
92
|
-
* CGI: Shortcuts for escape/unescape of the CGI module.
|
93
|
-
* File: Helps you serving files from your Controller.
|
94
|
-
* Flash: Store a couple of values for one request associated with a session.
|
95
|
-
* Link: Easier linking to the various parts of your applications Controllers and Actions.
|
96
|
-
* Redirect: Easy redirection.
|
97
|
-
|
98
|
-
Other helpers worth mentioning are:
|
99
|
-
|
100
|
-
* CSRF helper: protect your forms from CSRF attacks using a single method.
|
101
|
-
* BlueForm: makes working with forms fun again.
|
102
|
-
* User: easy authentication using a database model.
|
103
|
-
* Identity: makes it easy to work with OpenID systems.
|
104
|
-
|
105
|
-
In total Ramaze itself has 29 helpers!
|
106
|
-
|
107
|
-
## Basic Principles
|
108
|
-
|
109
|
-
There are some basic principles that Ramaze tries to follow:
|
110
|
-
|
111
|
-
* KISS (Keep It Super Simple)
|
22
|
+
Today Ramaze serves as a framework for those who want to develop their projects
|
23
|
+
in their own way rather than being forced to work in a way that the framework
|
24
|
+
(and it's creators) define. It tries not to make any assumptions and more
|
25
|
+
importantly: it puts you back in control of your code. An example of this is the
|
26
|
+
default file structure of new Ramaze projects. Out of the box a new project
|
27
|
+
uses the MVC pattern. The cool thing about Ramaze however is that you're not
|
28
|
+
forced to use this pattern. If you prever HMVC, PAC or something else you can
|
29
|
+
simply apply it. Another example is the use of a database toolkit. Ramaze does
|
30
|
+
not ship with one for a very simple reason: nobody likes the same toolkit. Some
|
31
|
+
people prefer Sequel, others use Datamapper. With Ramaze you can use any tool
|
32
|
+
you like.
|
112
33
|
|
113
|
-
|
114
|
-
with Ruby and the basics of Web-development.
|
115
|
-
|
116
|
-
* POLS (Principle Of Least Surprise)
|
117
|
-
|
118
|
-
Ramaze tries to be intuitive and easy to learn. Most functionality is built in
|
119
|
-
a way to help, not to obfuscate or confuse.
|
120
|
-
|
121
|
-
* Modular design
|
122
|
-
|
123
|
-
Use what you want and how you want it.
|
124
|
-
|
125
|
-
Through Ruby Ramaze provides one of the most powerful programming-languages
|
126
|
-
available, giving you full control over your system.
|
127
|
-
|
128
|
-
Even the most essential parts of Ramaze can easily be replaced and/or modified
|
129
|
-
without losing the advantage of the whole framework.
|
130
|
-
|
131
|
-
* Minimal dependencies
|
132
|
-
|
133
|
-
Nothing besides Ruby is required for the basic features.
|
134
|
-
|
135
|
-
Of course you can take advantage of several wonderful libraries, but Ramaze is
|
136
|
-
built in a way to be run on any basic setup.
|
137
|
-
|
138
|
-
* Documentation
|
139
|
-
|
140
|
-
Document everything, classes, modules, methods, configuration...
|
141
|
-
|
142
|
-
Through 100% documentation Ramaze gives the developer easy and solid
|
143
|
-
understanding of the underlying concepts and functionality.
|
144
|
-
|
145
|
-
* Open development
|
146
|
-
|
147
|
-
Everyone is welcome to contribute to Ramaze in the easiest way possible. The
|
148
|
-
repository is open for patches passing the Test-suite.
|
149
|
-
|
150
|
-
* Examples
|
151
|
-
|
152
|
-
Everyone learns different, some only read the source, others browse
|
153
|
-
documentation, but everyone loves examples for a quick and painless start.
|
154
|
-
|
155
|
-
Ramaze addresses this need and offers a wide variety of examples of usage,
|
156
|
-
basic functionality, project-layout and more advanced applications.
|
157
|
-
|
158
|
-
* Fully BDD (Behaviour Driven Design)
|
159
|
-
|
160
|
-
Ramaze has a very complete set of so-called specifications built by RSpec.
|
161
|
-
These specs define the way Ramaze has to behave.
|
162
|
-
|
163
|
-
The specs are checked every time a new patch is pushed into the repository,
|
164
|
-
deciding whether the changes the patch applies are valid and don't break the framework.
|
165
|
-
|
166
|
-
## Installation
|
167
|
-
|
168
|
-
### RubyGems
|
169
|
-
|
170
|
-
The simplest way of installing Ramaze is via the gem.
|
171
|
-
|
172
|
-
[Rubygems](http://rubygems.org) is the package manager for ruby apps and
|
173
|
-
libraries and provides you with the last tagged version of Ramaze.
|
34
|
+
Installing Ramaze is as easy as the following command:
|
174
35
|
|
175
36
|
$ gem install ramaze
|
176
37
|
|
177
|
-
|
178
|
-
the major obstacle as there is a lot to announce).
|
179
|
-
|
180
|
-
### Git
|
181
|
-
|
182
|
-
To get the latest and sweetest, you can just pull from the repository and run
|
183
|
-
Ramaze that way.
|
184
|
-
|
185
|
-
$ git clone git://github.com/ramaze/ramaze.git
|
186
|
-
|
187
|
-
Please read the `man git` or `git help` for more information about updating
|
188
|
-
and creating your own patches.
|
189
|
-
This is at the moment the premier way to use Ramaze, since it is the way I
|
190
|
-
use it.
|
191
|
-
|
192
|
-
Some hints for the usage of Git.
|
193
|
-
|
194
|
-
* Use `require 'ramaze'` from everywhere
|
195
|
-
|
196
|
-
Simply add the path to your repository to the RUBYLIB environment variable.
|
197
|
-
If you are using bash you can simply put following line into your .bashrc:
|
198
|
-
|
199
|
-
$ export RUBYLIB="$HOME/path/to/repo/lib/"
|
38
|
+
For more information see the chapter {file:installation Installation}.
|
200
39
|
|
201
|
-
|
202
|
-
|
40
|
+
Ramaze is dual licensed under the GPL/Ruby license and is copyrighted 2009 -
|
41
|
+
2011 by Michael Fellinger (m.fellinger@gmail.com). A copy of the Ruby license
|
42
|
+
can be found in the file "guide/RUBY_LICENSE", a copy of the GPL license can be
|
43
|
+
found in the file "guide/GPL_LICENSE". Both these files can be displayed by
|
44
|
+
clicking the "Files" button at the top right.
|
203
45
|
|
204
|
-
|
46
|
+
<div class="note todo">
|
47
|
+
<p>
|
48
|
+
<strong>Note:</strong> if you spot any mistakes made such as spelling
|
49
|
+
errors or links not working feel free to report them on the mailing
|
50
|
+
list, in the IRC channel or by submitting a bug at the
|
51
|
+
<a href="https://github.com/ramaze/ramaze/issues">bugtracker</a>.
|
52
|
+
</p>
|
53
|
+
</div>
|
205
54
|
|
206
|
-
|
207
|
-
|
208
|
-
add a file to your `site_ruby` directory named 'ramaze.rb'
|
209
|
-
the content should be: `require '/path/to/git/repo/ramaze/lib/ramaze'`
|
210
|
-
|
211
|
-
* Pull the latest version
|
212
|
-
|
213
|
-
$ git pull
|
214
|
-
|
215
|
-
* Reset the repo to original state (if you screw up something)
|
216
|
-
|
217
|
-
$ git reset --hard # resets the whole repo
|
218
|
-
|
219
|
-
* Revert changes to (for example) lib/ramaze.rb only
|
220
|
-
|
221
|
-
$ git checkout master lib/ramaze.rb
|
222
|
-
|
223
|
-
* Add and commit all changes.
|
224
|
-
|
225
|
-
$ git commit -a
|
226
|
-
|
227
|
-
* Adding only specific changes.
|
228
|
-
|
229
|
-
# Add hunks you want to commit to the staging area (index)
|
230
|
-
$ git add -p
|
231
|
-
|
232
|
-
* Commit the changes into the history of your repository
|
233
|
-
|
234
|
-
# Create a commit from the hunks added
|
235
|
-
$ git commit
|
236
|
-
|
237
|
-
* output your patches into a bundle ready to be mailed (compress it before
|
238
|
-
sending to make sure it arrives in the way you sent it)
|
239
|
-
|
240
|
-
At the end of this process you will have a tar.bz2 for all your changes
|
241
|
-
that you can mail to ramaze@googlegroups.com
|
242
|
-
|
243
|
-
# make sure you are on latest revision to avoid conflicts
|
244
|
-
$ git pull
|
245
|
-
|
246
|
-
# create 00xx-blah.patch files against the remote repo
|
247
|
-
$ git format-patch origin/HEAD
|
248
|
-
|
249
|
-
# From here on you can use either git-send-email or go the manual route
|
250
|
-
$ tar -cjf ramaze_bundle.tar.bz2 *.patch
|
251
|
-
|
252
|
-
### Direct Download
|
253
|
-
|
254
|
-
You can alternatively download the latest source code in a tarball from
|
255
|
-
[here](https://github.com/ramaze/ramaze/tarball/master).
|
256
|
-
|
257
|
-
## Getting Started
|
258
|
-
|
259
|
-
Now that you have a vague idea of what you're about to get into you might just
|
260
|
-
want to get a way to get up and running ASAP.
|
261
|
-
Please read below for more information about installation.
|
262
|
-
|
263
|
-
Depending on what you are planning to do you can either just go and start
|
264
|
-
reading the source or directly get some hands-on experience by trying some of
|
265
|
-
the examples.
|
266
|
-
Most things will require dependencies though. The basic functionality is
|
267
|
-
provided by the WEBrick adapter and the Template::Ramaze, which just run out
|
268
|
-
of the box. For more features you will have to install some templating-engines
|
269
|
-
and mongrel (_very_ recommended). Ramaze will inform you when it needs further
|
270
|
-
dependencies, so just go and try some things.
|
271
|
-
|
272
|
-
Some places to get started are:
|
273
|
-
- Read the documentation.
|
274
|
-
- Run and read the test cases.
|
275
|
-
- Look at the examples and run/modify them.
|
276
|
-
|
277
|
-
## A couple of Examples
|
278
|
-
|
279
|
-
There are some examples for your instant pleasure inside the examples-directory
|
280
|
-
in the Ramaze-distribution.
|
281
|
-
You can start up an example just as you usually would any other ruby program:
|
282
|
-
|
283
|
-
$ ruby examples/basic/hello.rb
|
284
|
-
|
285
|
-
Or:
|
286
|
-
|
287
|
-
$ cd examples/app/blog
|
288
|
-
$ ruby start.rb
|
289
|
-
|
290
|
-
For more information about the usage of ramaze try:
|
291
|
-
|
292
|
-
$ ramaze --help
|
293
|
-
|
294
|
-
Examples include:
|
295
|
-
|
296
|
-
* examples/basic/hello.rb
|
297
|
-
Hello, World!
|
298
|
-
|
299
|
-
* examples/basic/simple.rb
|
300
|
-
A bit more advanced than the hello-example, but still very basic.
|
301
|
-
|
302
|
-
* examples/app/blog
|
303
|
-
Not yet fully functional, but coming along.
|
304
|
-
|
305
|
-
* examples/app/whywiki
|
306
|
-
A basic examples of a minimalistic application, based on the Wiki of \_why in
|
307
|
-
his camping-framework.
|
308
|
-
|
309
|
-
* examples/templates
|
310
|
-
examples of real usage of the templating-engines. Tries to implement the same
|
311
|
-
functionality in each `template_*.rb` file using a different engine.
|
312
|
-
|
313
|
-
* Many more fully functional examples can be found in the examples folder.
|
314
|
-
|
315
|
-
## How to find Help
|
316
|
-
|
317
|
-
For help you can:
|
318
|
-
|
319
|
-
- Visit us in the channel #ramaze on irc.freenode.net
|
320
|
-
|
321
|
-
- Join the Mailinglist at http://groups.google.com/group/ramaze
|
322
|
-
|
323
|
-
## And thanks to...
|
324
|
-
|
325
|
-
There are a large number of people who made Ramaze possible by their ongoing
|
326
|
-
efforts in the world of open source and by encouraging and helping me.
|
327
|
-
|
328
|
-
This list is by no means a full listing of all these people, but I try to
|
329
|
-
get a good coverage despite that.
|
330
|
-
|
331
|
-
I would like to thank:
|
332
|
-
|
333
|
-
* Yukihiro Matsumoto a.k.a matz
|
334
|
-
|
335
|
-
For giving the world Ruby and bringing fun back into programming.
|
336
|
-
|
337
|
-
* Zed Shaw a.k.a. zedas
|
338
|
-
|
339
|
-
For developing Mongrel, Ramaze started out as a simple Hello World based
|
340
|
-
on that awesome server.
|
341
|
-
|
342
|
-
* Christian Neukirchen a.k.a chris2
|
343
|
-
|
344
|
-
For building rack, which is just what the numerous web-developers had
|
345
|
-
anticipated and which will, with no doubt, change the world.
|
346
|
-
|
347
|
-
* Pistos
|
348
|
-
|
349
|
-
For continious encouragment and building the first real webpage on Ramaze.
|
350
|
-
His bugreports were invaluable.
|
351
|
-
|
352
|
-
* Jim Weirich
|
353
|
-
|
354
|
-
For Rake, which lifts off a lot of tasks from the shoulders of every
|
355
|
-
developer who uses it.
|
55
|
+
## Quick Example
|
356
56
|
|
357
|
-
|
57
|
+
While Ramaze applications are usually spread across multiple directories for
|
58
|
+
controllers, models and views one can quite easily create a very basic
|
59
|
+
application in just a single file:
|
358
60
|
|
359
|
-
|
360
|
-
truely is through his work on facets, ratchets and tons of other projects.
|
61
|
+
require 'ramaze'
|
361
62
|
|
362
|
-
|
63
|
+
class MyController < Ramaze::Controller
|
64
|
+
map '/'
|
363
65
|
|
364
|
-
|
365
|
-
|
66
|
+
def index
|
67
|
+
return "Hello, Ramaze!"
|
68
|
+
end
|
69
|
+
end
|
366
70
|
|
367
|
-
|
71
|
+
Ramaze.start
|
368
72
|
|
369
|
-
|
370
|
-
|
371
|
-
May he rest in peace.
|
73
|
+
Once this is saved in a file (you can also run this from IRB) simply execute it
|
74
|
+
using the Ruby binary:
|
372
75
|
|
373
|
-
|
76
|
+
$ ruby hello_ramaze.rb
|
374
77
|
|
375
|
-
|
376
|
-
my online home.
|
377
|
-
All the people in there deserve special thanks for getting me hooked to Ruby
|
378
|
-
and providing their help in a friendly and patient manner.
|
78
|
+
This starts a WEBRick server listening on localhost:7000.
|
379
79
|
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
80
|
+
## Requirements
|
81
|
+
|
82
|
+
* Innate (which in turn requires Rack).
|
83
|
+
* A Ruby implementation based on Ruby 1.8 or newer (1.9.2, Rubinius, etc).
|
84
|
+
* A Rack server such as Thin or Unicorn.
|
85
|
+
* Basic knowledge of Ruby.
|
86
|
+
|
87
|
+
## Community
|
88
|
+
|
89
|
+
* \#ramaze on the Freenode IRC network
|
90
|
+
* [Mailing list][mailing list]
|
91
|
+
* [Website][website]
|
92
|
+
|
93
|
+
When joining the IRC channel you don't have to be afraid to ask a question, just
|
94
|
+
ask it and (hopefully) you'll get the answer you're looking for. However, keep
|
95
|
+
in mind that most of us are located in different timezones so it may sometimes
|
96
|
+
take a while before you get a reply.
|
97
|
+
|
98
|
+
## Chapters
|
99
|
+
|
100
|
+
If you're viewing this file in your editor or from Github it's likely that the
|
101
|
+
table of contents isn't rendered. You can find all these files in the ``guide/``
|
102
|
+
directory.
|
103
|
+
|
104
|
+
* {file:general/installation Installation}
|
105
|
+
* {file:general/principles Principles}
|
106
|
+
* {file:general/special_thanks Special Thanks}
|
107
|
+
* {file:general/contributing Contributing To Ramaze}
|
108
|
+
* {file:general/configuration Configuration}
|
109
|
+
* {file:general/ramaze_command Ramaze Command}
|
110
|
+
* {file:general/controllers Controllers}
|
111
|
+
* {file:general/models Models}
|
112
|
+
* {file:general/views Views}
|
113
|
+
* {file:general/helpers Helpers}
|
114
|
+
* {file:general/middlewares Rack Middlewares}
|
115
|
+
* {file:general/routes Routes}
|
116
|
+
* {file:general/sessions Sessions}
|
117
|
+
* {file:general/cache Caching Data}
|
118
|
+
* {file:general/logging Logging Information}
|
119
|
+
* {file:general/testing Testing with Ramaze}
|
120
|
+
|
121
|
+
## Tutorials
|
122
|
+
|
123
|
+
* {file:tutorials/introduction Introduction Tutorial}
|
124
|
+
|
125
|
+
[mailing list]: https://groups.google.com/forum/#!forum/ramaze
|
126
|
+
[website]: http://ramaze.net/
|