ramaze 2011.07.25 → 2011.10.23

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/.gitignore +3 -0
  2. data/.mailmap +3 -2
  3. data/.travis.yml +17 -0
  4. data/.yardopts +13 -0
  5. data/README.md +95 -352
  6. data/examples/app/blog/app.rb +25 -64
  7. data/examples/app/blog/config.ru +11 -9
  8. data/examples/app/blog/controller/init.rb +29 -86
  9. data/examples/app/blog/controller/posts.rb +232 -0
  10. data/examples/app/blog/controller/users.rb +160 -0
  11. data/examples/app/blog/layout/default.xhtml +61 -0
  12. data/examples/app/blog/migrations/01_create_schema.rb +50 -0
  13. data/examples/app/blog/model/comment.rb +41 -54
  14. data/examples/app/blog/model/init.rb +41 -13
  15. data/examples/app/blog/model/post.rb +35 -0
  16. data/examples/app/blog/model/user.rb +105 -0
  17. data/examples/app/blog/public/.htaccess +24 -0
  18. data/examples/app/blog/public/css/grid.css +107 -0
  19. data/examples/app/blog/public/css/layout.css +203 -0
  20. data/examples/app/blog/public/css/reset.css +123 -0
  21. data/examples/app/blog/public/css/text.css +109 -0
  22. data/examples/app/blog/public/dispatch.fcgi +11 -0
  23. data/examples/app/blog/public/favicon.ico +0 -0
  24. data/examples/app/blog/public/images/bg.png +0 -0
  25. data/examples/app/blog/start.rb +18 -3
  26. data/examples/app/blog/view/feed.xhtml +23 -0
  27. data/examples/app/blog/view/form.xhtml +11 -0
  28. data/examples/app/blog/view/index.xhtml +44 -0
  29. data/examples/app/blog/view/users/form.xhtml +12 -0
  30. data/examples/app/blog/view/users/index.xhtml +30 -0
  31. data/examples/app/blog/view/users/login.xhtml +8 -0
  32. data/examples/app/blog/view/view.xhtml +68 -0
  33. data/{doc → guide}/AUTHORS +5 -3
  34. data/{doc → guide}/CHANGELOG +428 -0
  35. data/{doc/GPL → guide/GPL_LICENSE} +0 -0
  36. data/{doc/COPYING → guide/RUBY_LICENSE} +3 -6
  37. data/guide/_static/logo.png +0 -0
  38. data/guide/_static/logo.svg +49 -0
  39. data/guide/_static/ramaze_console.png +0 -0
  40. data/guide/css/common.css +20 -0
  41. data/guide/general/cache.md +167 -0
  42. data/guide/general/configuration.md +168 -0
  43. data/guide/general/contributing.md +108 -0
  44. data/guide/general/controllers.md +115 -0
  45. data/guide/general/helpers.md +76 -0
  46. data/guide/general/installation.md +58 -0
  47. data/guide/general/logging.md +99 -0
  48. data/guide/general/middlewares.md +100 -0
  49. data/guide/general/models.md +78 -0
  50. data/guide/general/principles.md +53 -0
  51. data/guide/general/ramaze_command.md +155 -0
  52. data/guide/general/routes.md +81 -0
  53. data/guide/general/sessions.md +140 -0
  54. data/guide/general/special_thanks.md +67 -0
  55. data/guide/general/testing.md +61 -0
  56. data/guide/general/views.md +322 -0
  57. data/guide/tutorials/introduction.md +259 -0
  58. data/lib/proto/config.ru +1 -1
  59. data/lib/proto/public/favicon.ico +0 -0
  60. data/lib/proto/view/index.xhtml +7 -7
  61. data/lib/ramaze.rb +4 -4
  62. data/lib/ramaze/app.rb +11 -11
  63. data/lib/ramaze/app_graph.rb +2 -4
  64. data/lib/ramaze/bin/console.rb +3 -3
  65. data/lib/ramaze/bin/create.rb +2 -2
  66. data/lib/ramaze/bin/restart.rb +4 -4
  67. data/lib/ramaze/bin/runner.rb +5 -5
  68. data/lib/ramaze/bin/start.rb +19 -4
  69. data/lib/ramaze/bin/status.rb +3 -3
  70. data/lib/ramaze/bin/stop.rb +3 -3
  71. data/lib/ramaze/cache.rb +1 -0
  72. data/lib/ramaze/cache/lru.rb +8 -4
  73. data/lib/ramaze/cache/memcache.rb +32 -13
  74. data/lib/ramaze/cache/redis.rb +164 -0
  75. data/lib/ramaze/cache/sequel.rb +43 -28
  76. data/lib/ramaze/controller.rb +1 -2
  77. data/lib/ramaze/dependencies.rb +40 -3
  78. data/lib/ramaze/helper/bench.rb +26 -16
  79. data/lib/ramaze/helper/blue_form.rb +46 -73
  80. data/lib/ramaze/helper/cache.rb +10 -6
  81. data/lib/ramaze/helper/csrf.rb +35 -39
  82. data/lib/ramaze/helper/disqus.rb +5 -4
  83. data/lib/ramaze/helper/email.rb +35 -24
  84. data/lib/ramaze/helper/erector.rb +9 -13
  85. data/lib/ramaze/helper/flash.rb +7 -9
  86. data/lib/ramaze/helper/formatting.rb +194 -179
  87. data/lib/ramaze/helper/gravatar.rb +4 -8
  88. data/lib/ramaze/helper/identity.rb +3 -3
  89. data/lib/ramaze/helper/layout.rb +23 -8
  90. data/lib/ramaze/helper/markaby.rb +1 -1
  91. data/lib/ramaze/helper/paginate.rb +46 -39
  92. data/lib/ramaze/helper/request_accessor.rb +3 -1
  93. data/lib/ramaze/helper/simple_captcha.rb +18 -17
  94. data/lib/ramaze/helper/stack.rb +1 -1
  95. data/lib/ramaze/helper/tagz.rb +4 -2
  96. data/lib/ramaze/helper/upload.rb +523 -0
  97. data/lib/ramaze/helper/user.rb +4 -8
  98. data/lib/ramaze/helper/xhtml.rb +11 -15
  99. data/lib/ramaze/log.rb +9 -6
  100. data/lib/ramaze/log/rotatinginformer.rb +62 -27
  101. data/lib/ramaze/log/syslog.rb +20 -15
  102. data/lib/ramaze/log/xosd.rb +2 -1
  103. data/lib/ramaze/reloader.rb +2 -0
  104. data/lib/ramaze/request.rb +11 -10
  105. data/lib/ramaze/setup.rb +23 -6
  106. data/lib/ramaze/snippets/array/put_within.rb +3 -9
  107. data/lib/ramaze/snippets/binding/locals.rb +5 -10
  108. data/lib/ramaze/snippets/fiber.rb +1 -23
  109. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +3 -6
  110. data/lib/ramaze/snippets/numeric/filesize_format.rb +3 -5
  111. data/lib/ramaze/snippets/numeric/time.rb +3 -7
  112. data/lib/ramaze/snippets/object/__dir__.rb +3 -7
  113. data/lib/ramaze/snippets/object/instance_variable_defined.rb +3 -6
  114. data/lib/ramaze/snippets/object/pretty.rb +3 -7
  115. data/lib/ramaze/snippets/object/scope.rb +7 -9
  116. data/lib/ramaze/snippets/proc/locals.rb +12 -12
  117. data/lib/ramaze/snippets/ramaze/acquire.rb +15 -14
  118. data/lib/ramaze/snippets/ramaze/deprecated.rb +1 -1
  119. data/lib/ramaze/snippets/ramaze/fiber.rb +1 -1
  120. data/lib/ramaze/snippets/ramaze/lru_hash.rb +2 -3
  121. data/lib/ramaze/snippets/ramaze/struct.rb +2 -4
  122. data/lib/ramaze/snippets/string/camel_case.rb +8 -10
  123. data/lib/ramaze/snippets/string/color.rb +3 -4
  124. data/lib/ramaze/snippets/string/end_with.rb +3 -6
  125. data/lib/ramaze/snippets/string/esc.rb +3 -8
  126. data/lib/ramaze/snippets/string/ord.rb +3 -8
  127. data/lib/ramaze/snippets/string/snake_case.rb +6 -9
  128. data/lib/ramaze/snippets/string/start_with.rb +3 -8
  129. data/lib/ramaze/snippets/string/unindent.rb +3 -6
  130. data/lib/ramaze/snippets/thread/into.rb +1 -3
  131. data/lib/ramaze/spec.rb +2 -31
  132. data/lib/ramaze/spec/bacon.rb +18 -2
  133. data/lib/ramaze/version.rb +1 -1
  134. data/lib/ramaze/view.rb +1 -1
  135. data/ramaze.gemspec +1 -1
  136. data/spec/helper.rb +2 -1
  137. data/spec/ramaze/bin/start.rb +16 -20
  138. data/spec/ramaze/cache/localmemcache.rb +4 -7
  139. data/spec/ramaze/cache/memcache.rb +3 -1
  140. data/spec/ramaze/cache/redis.rb +62 -0
  141. data/spec/ramaze/helper/blue_form.rb +33 -4
  142. data/spec/ramaze/helper/layout.rb +40 -7
  143. data/spec/ramaze/helper/upload.rb +149 -0
  144. data/spec/ramaze/helper/uploads/text_1.txt +1 -0
  145. data/spec/ramaze/helper/uploads/text_2.txt +1 -0
  146. data/spec/ramaze/log/growl.rb +4 -6
  147. data/spec/ramaze/log/syslog.rb +6 -0
  148. data/spec/ramaze/view/lokar.rb +5 -0
  149. data/spec/ramaze/view/nagoro.rb +5 -0
  150. data/tasks/authors.rake +1 -1
  151. data/tasks/bacon.rake +14 -5
  152. data/tasks/changelog.rake +1 -1
  153. data/tasks/yard.rake +12 -4
  154. metadata +277 -239
  155. data/doc/LEGAL +0 -26
  156. data/examples/app/blog/README +0 -3
  157. data/examples/app/blog/controller/comment.rb +0 -45
  158. data/examples/app/blog/controller/entry.rb +0 -85
  159. data/examples/app/blog/controller/main.rb +0 -20
  160. data/examples/app/blog/controller/tag.rb +0 -9
  161. data/examples/app/blog/layout/default.nag +0 -31
  162. data/examples/app/blog/model/entry.rb +0 -89
  163. data/examples/app/blog/model/tag.rb +0 -36
  164. data/examples/app/blog/public/css/screen.css +0 -273
  165. data/examples/app/blog/spec/blog.rb +0 -87
  166. data/examples/app/blog/view/comment/form.nag +0 -10
  167. data/examples/app/blog/view/comment/show.nag +0 -16
  168. data/examples/app/blog/view/entry/edit.nag +0 -14
  169. data/examples/app/blog/view/entry/feed.atom.nag +0 -8
  170. data/examples/app/blog/view/entry/feed.rss.nag +0 -7
  171. data/examples/app/blog/view/entry/index.nag +0 -7
  172. data/examples/app/blog/view/entry/new.nag +0 -13
  173. data/examples/app/blog/view/entry/show.nag +0 -36
  174. data/examples/app/blog/view/feed.atom.nag +0 -18
  175. data/examples/app/blog/view/feed.rss.nag +0 -25
  176. data/examples/app/blog/view/index.nag +0 -6
  177. data/examples/app/blog/view/tag/index.nag +0 -5
  178. data/lib/proto/public/ramaze.png +0 -0
  179. data/lib/ramaze/rest.rb +0 -36
  180. data/spec/ramaze/rest.rb +0 -28
  181. data/tasks/rcov.rake +0 -22
data/.gitignore CHANGED
@@ -1,7 +1,10 @@
1
1
  pkg
2
2
  .yardoc
3
+ doc
3
4
  ydoc
4
5
  *~
5
6
  *.swp
6
7
  .redcar
7
8
  *.rbc
9
+ database.db
10
+ .rbx
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
- YorickPeterse <yorickpeterse@gmail.com> YorickPeterse <info@yorickpeterse.com>
32
- YorickPeterse <yorickpeterse@gmail.com> Yorick Peterse <info@yorickpeterse.com>
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>
@@ -0,0 +1,17 @@
1
+ script: 'rake bacon'
2
+ rvm:
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ - rbx
7
+ - rbx-2.0
8
+ - ree
9
+
10
+ notifications:
11
+ email:
12
+ - yorickpeterse@gmail.com
13
+ - mf@rubyists.com
14
+
15
+ branches:
16
+ only:
17
+ - master
@@ -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
- Copyright (c) 2009 - 2011 Michael Fellinger m.fellinger@gmail.com
2
- All files in this distribution are subject to the terms of the Ruby license.
1
+ # Ramaze
3
2
 
4
- # About Ramaze
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
- Ramaze is a very simple and straight-forward web-framework.
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 rack, which
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
- ## Quick Example
26
-
27
- While Ramaze applications are usually spread across multiple directories for controllers,
28
- models and views one can quite easily create a very basic application in just a single file:
29
-
30
- require 'ramaze'
31
-
32
- class MyController < Ramaze::Controller
33
- map '/'
34
-
35
- def index
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
- Ramaze doesn't introduce any major change of paradigm for everyone familiar
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
- Versions are made as we see fit and get an announcement out (usually that's
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
- Of course you should put the real path instead, you can also add multiple
202
- paths, or create your personal `site_ruby`:
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
- $ export RUBYLIB="$HOME/ruby/ramaze/lib:$HOME/.site_ruby:$HOME/ruby/bacon/lib"
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
- * Use `require 'ramaze'` system wide from everywhere
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
- * Thomas Sawyer a.k.a Trans
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
- Dragging me deep into the rabbit-hole and showing me how awesome Ruby
360
- truely is through his work on facets, ratchets and tons of other projects.
61
+ require 'ramaze'
361
62
 
362
- * George Moschovitis a.k.a gmosx
63
+ class MyController < Ramaze::Controller
64
+ map '/'
363
65
 
364
- For his tremendous efforts in the Nitro/Og framework, which is a source of
365
- steady inspiration for Ramaze and brought me to Ruby in the first place.
66
+ def index
67
+ return "Hello, Ramaze!"
68
+ end
69
+ end
366
70
 
367
- * Rob Levin a.k.a. lilo
71
+ Ramaze.start
368
72
 
369
- He founded the most excellent Freenode IRC-network, where the most important
370
- channels for rubyists are located (as is #ramaze).
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
- * The guys (and gals) in the various channels on Freenode
76
+ $ ruby hello_ramaze.rb
374
77
 
375
- As the people are way too many to be listed, here the channels that i call
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
- * \#nitro
381
- * \#ruby-de
382
- * \#ruby-lang
383
- * \#rubyforce
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/