ramaze 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. data/Rakefile +52 -19
  2. data/bin/ramaze +19 -6
  3. data/doc/CHANGELOG +33 -0
  4. data/doc/COPYING +1 -1
  5. data/doc/FAQ +92 -0
  6. data/doc/GPL +340 -0
  7. data/doc/INSTALL +34 -0
  8. data/doc/ProjectInfo +53 -0
  9. data/doc/README +187 -110
  10. data/doc/readme_chunks/appendix.txt +13 -0
  11. data/doc/readme_chunks/examples.txt +38 -0
  12. data/doc/readme_chunks/features.txt +82 -0
  13. data/doc/readme_chunks/getting_help.txt +5 -0
  14. data/doc/readme_chunks/getting_started.txt +18 -0
  15. data/doc/readme_chunks/installing.txt +41 -0
  16. data/doc/readme_chunks/introduction.txt +18 -0
  17. data/doc/readme_chunks/principles.txt +41 -0
  18. data/doc/readme_chunks/thanks.txt +59 -0
  19. data/doc/tutorial/todolist.txt +546 -0
  20. data/examples/blog/main.rb +1 -1
  21. data/examples/blog/src/controller.rb +13 -11
  22. data/examples/blog/src/element.rb +11 -6
  23. data/examples/blog/src/model.rb +8 -23
  24. data/examples/blog/template/edit.xhtml +3 -1
  25. data/examples/blog/template/index.xhtml +4 -4
  26. data/examples/caching.rb +4 -4
  27. data/examples/element.rb +10 -7
  28. data/examples/hello.rb +3 -4
  29. data/examples/simple.rb +5 -3
  30. data/examples/templates/template/external.amrita +19 -0
  31. data/examples/templates/template/{external.rmze → external.zmr} +2 -2
  32. data/examples/templates/template_amrita2.rb +48 -0
  33. data/examples/templates/template_erubis.rb +5 -2
  34. data/examples/templates/{template_ramaze.rb → template_ezamar.rb} +13 -7
  35. data/examples/templates/template_haml.rb +4 -1
  36. data/examples/templates/template_liquid.rb +2 -1
  37. data/examples/templates/template_markaby.rb +2 -1
  38. data/examples/todolist/conf/benchmark.yaml +35 -0
  39. data/examples/todolist/conf/debug.yaml +34 -0
  40. data/examples/todolist/conf/live.yaml +33 -0
  41. data/examples/todolist/conf/silent.yaml +31 -0
  42. data/examples/todolist/conf/stage.yaml +33 -0
  43. data/examples/todolist/main.rb +18 -0
  44. data/examples/todolist/public/404.jpg +0 -0
  45. data/examples/todolist/public/css/coderay.css +105 -0
  46. data/examples/todolist/public/css/ramaze_error.css +42 -0
  47. data/{lib/proto → examples/todolist}/public/error.xhtml +0 -0
  48. data/examples/todolist/public/favicon.ico +0 -0
  49. data/examples/todolist/public/js/jquery.js +1923 -0
  50. data/examples/todolist/public/ramaze.png +0 -0
  51. data/examples/todolist/src/controller/main.rb +56 -0
  52. data/examples/todolist/src/element/page.rb +26 -0
  53. data/examples/todolist/src/model.rb +14 -0
  54. data/examples/todolist/template/index.xhtml +17 -0
  55. data/examples/todolist/template/new.xhtml +7 -0
  56. data/examples/todolist/todolist.db +9 -0
  57. data/examples/whywiki/main.rb +3 -8
  58. data/examples/whywiki/template/show.xhtml +4 -0
  59. data/lib/proto/public/error.zmr +77 -0
  60. data/lib/proto/src/controller/main.rb +2 -1
  61. data/lib/proto/src/element/page.rb +2 -1
  62. data/lib/proto/src/model.rb +3 -2
  63. data/lib/ramaze.rb +7 -9
  64. data/lib/ramaze/adapter.rb +51 -0
  65. data/lib/ramaze/adapter/cgi.rb +23 -0
  66. data/lib/ramaze/adapter/fcgi.rb +22 -0
  67. data/lib/ramaze/adapter/mongrel.rb +7 -86
  68. data/lib/ramaze/adapter/webrick.rb +14 -133
  69. data/lib/ramaze/cache/memcached.rb +6 -0
  70. data/lib/ramaze/cache/yaml_store.rb +3 -1
  71. data/lib/ramaze/controller.rb +292 -2
  72. data/lib/ramaze/dispatcher.rb +85 -213
  73. data/lib/ramaze/error.rb +10 -0
  74. data/lib/ramaze/global.rb +8 -0
  75. data/lib/ramaze/helper/aspect.rb +30 -7
  76. data/lib/ramaze/helper/auth.rb +16 -9
  77. data/lib/ramaze/helper/cache.rb +40 -35
  78. data/lib/ramaze/helper/feed.rb +1 -1
  79. data/lib/ramaze/helper/flash.rb +34 -0
  80. data/lib/ramaze/helper/link.rb +8 -2
  81. data/lib/ramaze/helper/openid.rb +63 -0
  82. data/lib/ramaze/helper/redirect.rb +12 -11
  83. data/lib/ramaze/helper/stack.rb +5 -7
  84. data/lib/ramaze/inform.rb +12 -1
  85. data/lib/ramaze/snippets/kernel/aquire.rb +1 -1
  86. data/lib/ramaze/snippets/kernel/{self_method.rb → method.rb} +3 -18
  87. data/lib/ramaze/snippets/kernel/{rescue_require.rb → pretty_inspect.rb} +7 -6
  88. data/lib/ramaze/snippets/method/name.rb +22 -0
  89. data/lib/ramaze/snippets/{kernel → ramaze}/autoreload.rb +0 -0
  90. data/lib/ramaze/snippets/ramaze/caller_info.rb +14 -0
  91. data/lib/ramaze/snippets/{kernel → ramaze}/caller_lines.rb +3 -10
  92. data/lib/ramaze/snippets/rdoc/usage_no_exit.rb +49 -23
  93. data/lib/ramaze/snippets/string/DIVIDE.rb +0 -1
  94. data/lib/ramaze/store/default.rb +58 -2
  95. data/lib/ramaze/store/yaml.rb +161 -0
  96. data/lib/ramaze/template.rb +27 -86
  97. data/lib/ramaze/template/amrita2.rb +14 -19
  98. data/lib/ramaze/template/erubis.rb +15 -38
  99. data/lib/ramaze/template/ezamar.rb +100 -0
  100. data/lib/ramaze/template/ezamar/element.rb +166 -0
  101. data/lib/ramaze/template/ezamar/engine.rb +124 -0
  102. data/lib/ramaze/template/ezamar/morpher.rb +155 -0
  103. data/lib/ramaze/template/haml.rb +16 -43
  104. data/lib/ramaze/template/liquid.rb +11 -51
  105. data/lib/ramaze/template/markaby.rb +44 -42
  106. data/lib/ramaze/tool/mime.rb +18 -0
  107. data/lib/ramaze/tool/mime_types.yaml +615 -0
  108. data/lib/ramaze/trinity/request.rb +20 -196
  109. data/lib/ramaze/trinity/response.rb +4 -33
  110. data/lib/ramaze/trinity/session.rb +150 -72
  111. data/lib/ramaze/version.rb +1 -1
  112. data/spec/adapter_spec.rb +20 -0
  113. data/spec/public/favicon.ico +0 -0
  114. data/spec/public/ramaze.png +0 -0
  115. data/spec/public/test_download.css +141 -0
  116. data/spec/{tc_request.rb → request_tc_helper.rb} +45 -21
  117. data/spec/spec_all.rb +77 -34
  118. data/spec/spec_helper.rb +8 -157
  119. data/spec/spec_helper_context.rb +72 -0
  120. data/spec/spec_helper_requester.rb +52 -0
  121. data/spec/spec_helper_simple_http.rb +433 -0
  122. data/spec/tc_adapter_mongrel.rb +3 -15
  123. data/spec/tc_adapter_webrick.rb +4 -14
  124. data/spec/tc_cache.rb +3 -5
  125. data/spec/tc_controller.rb +22 -12
  126. data/spec/tc_dependencies.rb +13 -0
  127. data/spec/tc_element.rb +8 -7
  128. data/spec/tc_error.rb +13 -7
  129. data/spec/tc_global.rb +16 -18
  130. data/spec/tc_helper_aspect.rb +2 -4
  131. data/spec/tc_helper_auth.rb +15 -14
  132. data/spec/tc_helper_cache.rb +5 -7
  133. data/spec/tc_helper_feed.rb +0 -2
  134. data/spec/tc_helper_flash.rb +103 -0
  135. data/spec/tc_helper_form.rb +4 -6
  136. data/spec/tc_helper_link.rb +1 -3
  137. data/spec/tc_helper_redirect.rb +23 -8
  138. data/spec/tc_helper_stack.rb +31 -15
  139. data/spec/tc_morpher.rb +1 -3
  140. data/spec/tc_params.rb +48 -7
  141. data/spec/tc_request_mongrel.rb +9 -0
  142. data/spec/tc_request_webrick.rb +5 -0
  143. data/spec/tc_session.rb +41 -25
  144. data/spec/tc_store.rb +55 -6
  145. data/spec/tc_store_yaml.rb +71 -0
  146. data/spec/tc_template_amrita2.rb +3 -3
  147. data/spec/tc_template_erubis.rb +2 -3
  148. data/spec/{tc_template_ramaze.rb → tc_template_ezamar.rb} +15 -5
  149. data/spec/tc_template_haml.rb +4 -3
  150. data/spec/tc_template_liquid.rb +3 -4
  151. data/spec/tc_template_markaby.rb +4 -6
  152. data/spec/tc_tidy.rb +1 -3
  153. data/spec/template/amrita2/{data.html → data.amrita} +0 -0
  154. data/spec/template/amrita2/{index.html → index.amrita} +0 -0
  155. data/spec/template/amrita2/{sum.html → sum.amrita} +0 -0
  156. data/spec/template/ezamar/another/long/action.zmr +1 -0
  157. data/spec/template/ezamar/combined.zmr +1 -0
  158. data/spec/template/{ramaze/file_only.rmze → ezamar/file_only.zmr} +0 -0
  159. data/spec/template/{ramaze/index.rmze → ezamar/index.zmr} +0 -0
  160. data/spec/template/{ramaze/nested.rmze → ezamar/nested.zmr} +0 -0
  161. data/spec/template/ezamar/some__long__action.zmr +1 -0
  162. data/spec/template/{ramaze/sum.rmze → ezamar/sum.zmr} +0 -0
  163. metadata +181 -123
  164. data/doc/allison/LICENSE +0 -184
  165. data/doc/allison/README +0 -37
  166. data/doc/allison/allison.css +0 -300
  167. data/doc/allison/allison.gif +0 -0
  168. data/doc/allison/allison.js +0 -307
  169. data/doc/allison/allison.rb +0 -287
  170. data/doc/allison/cache/BODY +0 -588
  171. data/doc/allison/cache/CLASS_INDEX +0 -4
  172. data/doc/allison/cache/CLASS_PAGE +0 -1
  173. data/doc/allison/cache/FILE_INDEX +0 -4
  174. data/doc/allison/cache/FILE_PAGE +0 -1
  175. data/doc/allison/cache/FONTS +0 -1
  176. data/doc/allison/cache/FR_INDEX_BODY +0 -1
  177. data/doc/allison/cache/IMGPATH +0 -1
  178. data/doc/allison/cache/INDEX +0 -1
  179. data/doc/allison/cache/JAVASCRIPT +0 -307
  180. data/doc/allison/cache/METHOD_INDEX +0 -4
  181. data/doc/allison/cache/METHOD_LIST +0 -1
  182. data/doc/allison/cache/SRC_PAGE +0 -1
  183. data/doc/allison/cache/STYLE +0 -322
  184. data/doc/allison/cache/URL +0 -1
  185. data/doc/changes.txt +0 -2021
  186. data/doc/changes.xml +0 -2024
  187. data/lib/ramaze/snippets/kernel/silently.rb +0 -13
  188. data/lib/ramaze/snippets/thread/deadQUESTIONMARK.rb +0 -11
  189. data/lib/ramaze/template/haml/actionview_stub.rb +0 -20
  190. data/lib/ramaze/template/ramaze.rb +0 -177
  191. data/lib/ramaze/template/ramaze/element.rb +0 -166
  192. data/lib/ramaze/template/ramaze/morpher.rb +0 -156
  193. data/spec/tc_test.rb +0 -17
data/Rakefile CHANGED
@@ -23,12 +23,17 @@ BASEDIR = File.dirname(__FILE__)
23
23
  NAME = "ramaze"
24
24
  REV = File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
25
25
  VERS = ENV['VERSION'] || (Ramaze::VERSION + (REV ? ".#{REV}" : ""))
26
+ COPYRIGHT = [
27
+ "# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com",
28
+ "# All files in this distribution are subject to the terms of the Ruby license."
29
+ ]
26
30
  CLEAN.include %w[
27
31
  **/.*.sw?
28
32
  *.gem
29
33
  .config
30
34
  **/*~
31
35
  **/{data.db,cache.yaml}
36
+ *.yaml
32
37
  pkg
33
38
  ]
34
39
  RDOC_OPTS = %w[
@@ -37,15 +42,17 @@ RDOC_OPTS = %w[
37
42
  --op rdoc
38
43
  --line-numbers
39
44
  --inline-source
40
- --main "doc/README"
45
+ --main doc/README
41
46
  --opname index.html
42
- --title "Ramaze documentation"
47
+ --title "Ramaze\ documentation"
43
48
  --exclude "^(_darcs|spec|examples|bin|pkg)/"
44
49
  --exclude "lib/proto"
45
50
  --include "doc"
46
51
  --accessor "trait"
47
52
  ]
48
-
53
+ RDOC_FILES = %w[
54
+ lib doc doc/README doc/FAQ doc/CHANGELOG
55
+ ]
49
56
  POST_INSTALL_MESSAGE = %{
50
57
  #{'=' * 60}
51
58
 
@@ -73,7 +80,7 @@ spec =
73
80
  s.version = VERS
74
81
  s.platform = Gem::Platform::RUBY
75
82
  s.has_rdoc = true
76
- s.extra_rdoc_files = ["doc/TODO", "doc/README", "doc/CHANGELOG"]
83
+ s.extra_rdoc_files = RDOC_FILES
77
84
  s.rdoc_options += RDOC_OPTS
78
85
  s.summary = DESCRIPTION
79
86
  s.description = DESCRIPTION
@@ -87,10 +94,10 @@ spec =
87
94
 
88
95
  s.add_dependency('rake', '>=0.7.1')
89
96
  s.add_dependency('rspec', '>=0.7.5.1')
90
- #s.required_ruby_version = '>= 1.8.2'
97
+ s.add_dependency('rack', '>=0.1.0')
98
+ # s.required_ruby_version = '>= 1.8.5'
91
99
 
92
- s.files = %w(doc/COPYING doc/TODO doc/README doc/CHANGELOG Rakefile) +
93
- Dir["{examples,bin,doc,spec,lib}/**/*"]
100
+ s.files = (RDOC_FILES + %w[Rakefile] + Dir["{examples,bin,doc,spec,lib}/**/*"]).uniq
94
101
 
95
102
  # s.extensions = FileList["ext/**/extconf.rb"].to_a
96
103
  end
@@ -145,15 +152,12 @@ desc "add copyright to all .rb files in the distribution"
145
152
  task 'add-copyright' do
146
153
  puts "adding copyright to files that don't have it currently"
147
154
  Dir['{lib,test}/**/*{.rb}'].each do |file|
155
+ next if file =~ /_darcs/
148
156
  lines = File.readlines(file).map{|l| l.chomp}
149
- copyright = [
150
- "# Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com",
151
- "# All files in this distribution are subject to the terms of the Ruby license."
152
- ]
153
- unless lines.first(2) == copyright
157
+ unless lines.first(2) == COPYRIGHT
154
158
  puts "fixing #{file}"
155
159
  File.open(file, 'w+') do |f|
156
- (copyright + lines).each do |line|
160
+ (COPYRIGHT + lines).each do |line|
157
161
  f.puts(line)
158
162
  end
159
163
  end
@@ -176,20 +180,20 @@ end
176
180
 
177
181
  desc "run the specs and clean up afterwards"
178
182
  task :test do
179
- sh "ruby #{File.dirname(__FILE__)}/spec/spec_all.rb"
183
+ ruby "#{File.dirname(__FILE__)}/spec/spec_all.rb"
180
184
  sh "rake clean"
181
185
  end
182
186
 
183
187
  desc "generate rdoc"
184
188
  task :rdoc => :clean do
185
- sh "rdoc #{RDOC_OPTS.join(' ')} lib doc doc/README doc/CHANGELOG"
189
+ sh "rdoc #{(RDOC_OPTS + RDOC_FILES).join(' ')}"
186
190
  end
187
191
 
188
192
  desc "generate improved allison-rdoc"
189
193
  task :allison => :clean do
190
194
  opts = RDOC_OPTS
191
195
  opts << %w[--template 'doc/allison/allison.rb']
192
- sh "rdoc #{opts.join(' ')} lib doc/TODO doc/README doc/CHANGELOG"
196
+ sh "rdoc #{(RDOC_OPTS + RDOC_FILES).join(' ')}"
193
197
  end
194
198
 
195
199
  desc "create bzip2 and tarball"
@@ -221,8 +225,8 @@ end
221
225
 
222
226
  desc "doc/README to doc/README.html"
223
227
  task 'readme2html' => 'gen-readme2html' do
224
- FileUtils.cp('readme/files/doc/README.html', 'doc/README.html')
225
- FileUtils.rm_rf('readme')
228
+ cp('readme/files/doc/README.html', 'doc/README.html')
229
+ rm_rf('readme')
226
230
  end
227
231
 
228
232
  desc "list all still undocumented methods"
@@ -285,7 +289,7 @@ end
285
289
 
286
290
  desc "generate doc/TODO from the TODO tags in the source"
287
291
  task 'todolist' do
288
- list = `rake todo`.split("\n")[2..-1]
292
+ list = invoke('todo').split("\n")[2..-1]
289
293
  tasks = {}
290
294
  current = nil
291
295
 
@@ -321,6 +325,7 @@ end
321
325
  desc "remove those annoying spaces at the end of lines"
322
326
  task 'fix-end-spaces' do
323
327
  Dir['{lib,test}/**/*.rb'].each do |file|
328
+ next if file =~ /_darcs/
324
329
  lines = File.readlines(file)
325
330
  new = lines.dup
326
331
  lines.each_with_index do |line, i|
@@ -357,3 +362,31 @@ task 'request' do
357
362
  end
358
363
  end
359
364
  end
365
+
366
+ desc "Compile the doc/README from the parts of doc/readme"
367
+ task 'build-readme' do
368
+ require 'enumerator'
369
+
370
+ chapters = [
371
+ 'About Ramaze', 'introduction',
372
+ 'Features Overview', 'features',
373
+ 'Basic Principles', 'principles',
374
+ 'Installation', 'installing',
375
+ 'Getting Started', 'getting_started',
376
+ 'A couple of Examples', 'examples',
377
+ 'How to find Help', 'getting_help',
378
+ 'Appendix', 'appendix',
379
+ 'And thanks to...', 'thanks',
380
+ ]
381
+
382
+ File.open('doc/README', 'w+') do |readme|
383
+ readme.puts COPYRIGHT.map{|l| l[1..-1]}, ''
384
+
385
+ chapters.each_slice(2) do |title, file|
386
+ file = File.join('doc', 'readme_chunks', "#{file}.txt")
387
+ chapter = File.read(file)
388
+ readme.puts "= #{title}", '', chapter
389
+ readme.puts '', '' unless title == chapters[-2]
390
+ end
391
+ end
392
+ end
data/bin/ramaze CHANGED
@@ -11,6 +11,8 @@
11
11
  #
12
12
  # -m, --mongrel:: use mongrel to process requests
13
13
  # -w, --webrick:: the default
14
+ # -g, --cgi:: CGI
15
+ # -f, --fcgi:: FastCGI
14
16
  #
15
17
  # -b, --benchmark:: inform about :error, :info, :debug, :benchmark
16
18
  # -d, --debug:: inform about :error, info, :debug
@@ -66,6 +68,8 @@ begin
66
68
  [ '--create', GetoptLong::REQUIRED_ARGUMENT ],
67
69
  [ '--mongrel', '-m', GetoptLong::NO_ARGUMENT ],
68
70
  [ '--webrick', '-w', GetoptLong::NO_ARGUMENT ],
71
+ [ '--cgi', '-g', GetoptLong::NO_ARGUMENT ],
72
+ [ '--fcgi', '-f', GetoptLong::NO_ARGUMENT ],
69
73
 
70
74
  [ '--debug', '-d', GetoptLong::NO_ARGUMENT ],
71
75
  [ '--stage', '-t', GetoptLong::NO_ARGUMENT ],
@@ -95,6 +99,9 @@ begin
95
99
  exit
96
100
  end
97
101
 
102
+ adapter = Dir[Ramaze::BASEDIR/'ramaze'/'adapter'/'*.rb']
103
+ adapter.map!{|f| File.basename(f, File.extname(f)).to_sym}
104
+
98
105
  opts.each do |opt, arg|
99
106
  sopt = opt[2..-1].gsub('-', '_').intern
100
107
 
@@ -102,10 +109,10 @@ begin
102
109
 
103
110
  case sopt
104
111
  when :create : create[arg]
105
- when :help : RDoc::usage('Usage')
106
- when :version : puts("ramaze #{Ramaze::Version}")
107
- when :copyright : RDoc::usage('Copyright')
108
- when :mongrel, :webrick : options[:adapter] = sopt
112
+ when :help : RDoc::ramazes_usage('Usage')
113
+ when :version : puts("ramaze #{Ramaze::VERSION}") or exit
114
+ when :copyright : RDoc::ramazes_usage('Copyright')
115
+ when *adapter : options[:adapter] = sopt
109
116
 
110
117
  when :benchmark : options[:inform_tags] << :benchmark
111
118
  when :debug : options
@@ -123,8 +130,14 @@ begin
123
130
  end
124
131
  end
125
132
 
126
- puts "running #{File.expand_path(runner)}"
127
- require runner
133
+ begin
134
+ puts "running #{File.expand_path(runner)}"
135
+ require runner
136
+ rescue LoadError
137
+ puts "Cannot find #{runner}, please provide a file to execute"
138
+ puts "Example: $ ramaze myapp.rb"
139
+ exit
140
+ end
128
141
 
129
142
  if options.delete(:console)
130
143
  options.merge!(:run_loose => true)
@@ -1,3 +1,36 @@
1
+ Thu Feb 8 11:18:46 JST 2007 m.fellinger@gmail.com
2
+ * this fixes some issues with rubygems/rdoc
3
+
4
+ Thu Feb 8 10:28:49 JST 2007 m.fellinger@gmail.com
5
+ * little hack for RDoc::usage so it will work with a gem too.
6
+
7
+ Thu Feb 8 01:31:46 JST 2007 m.fellinger@gmail.com
8
+ * add rspec as dependency
9
+
10
+ Thu Feb 8 01:21:13 JST 2007 m.fellinger@gmail.com
11
+ * nicer exit
12
+
13
+ Wed Feb 7 19:37:10 JST 2007 m.fellinger@gmail.com
14
+ * remove foul language ;)
15
+
16
+ Wed Feb 7 19:36:04 JST 2007 m.fellinger@gmail.com
17
+ * added :distribute task and fixed a small typo
18
+
19
+ Tue Feb 6 23:44:03 JST 2007 m.fellinger@gmail.com
20
+ * fixing typo in Rakefile
21
+
22
+ Wed Feb 7 19:07:25 JST 2007 m.fellinger@gmail.com
23
+ tagged 0.0.6
24
+
25
+ Wed Feb 7 19:06:54 JST 2007 m.fellinger@gmail.com
26
+ * 0.0.6
27
+
28
+ Wed Feb 7 19:06:38 JST 2007 m.fellinger@gmail.com
29
+ * working around a bug in Hpricot 0.5
30
+
31
+ Wed Feb 7 19:06:24 JST 2007 m.fellinger@gmail.com
32
+ * update changelog
33
+
1
34
  Wed Feb 7 19:02:15 JST 2007 m.fellinger@gmail.com
2
35
  * this introduces a new startup/shutdown hook system
3
36
 
@@ -1,4 +1,4 @@
1
- Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
1
+ Ramaze is copyrighted free software by Michael Fellinger <m.fellinger@gamil.com>.
2
2
  You can redistribute it and/or modify it under either the terms of the GPL
3
3
  version 2 (see the file GPL), or the conditions below:
4
4
 
data/doc/FAQ ADDED
@@ -0,0 +1,92 @@
1
+ == FAQ, Frequently asked Questions
2
+
3
+ = How do you pronounce Ramaze?
4
+
5
+ There are two ways Ramaze is usually pronounced, the one that is most common
6
+ the moment is like the English `amaze` with a prefixed `r`.
7
+
8
+ The other way is using Japanese pronunciation `ra ma ze`:
9
+
10
+ `ra` in `rasta`
11
+
12
+ `ma` in `mark`
13
+
14
+ `ze`, just make it sound German ;)
15
+
16
+ = What is MVC?
17
+
18
+ MVC stands for Model, View and Controller and is a concept that comes from
19
+ Smalltalk.
20
+
21
+ It is a way to decouple the way Data is stored, accessed, processed and
22
+ displayed.
23
+
24
+ - Model
25
+
26
+ Here your Data is structured and accessible, for example an interface to
27
+ PostgreSQL or Oracle. It contains all the queries and data-layout of your
28
+ application.
29
+
30
+ - View
31
+
32
+ This is called Template in Ramaze, it's the way your Data is displayed to
33
+ the consumer of your information.
34
+
35
+ That can be anything like pure HTML, XML, JSON, YAML, RSS or ATOM.
36
+
37
+ - Controller
38
+
39
+ Controller are the way you process the Information between the Model and
40
+ View. It is where all (or almost all) your applications programming-logic
41
+ has its home.
42
+
43
+ Common tasks in a Controller are: fetching data from the Model,
44
+ authentication, processing of POST-requests or GET-parameters,
45
+ redirection, caching, feed-generation...
46
+
47
+
48
+ = How does Ramaze enforce MVC?
49
+
50
+ Now, that one is simple: it doesn't tell you in which way you have to layout
51
+ your application at all.
52
+
53
+ Of course there are many defaults and possible best practices, but you can
54
+ always change the whole framework to fit your needs.
55
+
56
+
57
+ = Still, What do those 'best practices' say about MVC
58
+
59
+ - Model
60
+
61
+ First of all, Ramaze doesn't provide a best practice for the Model, it
62
+ simply assumes that you will have your ORM/database-interface of choice.
63
+
64
+ However, it features a simplistic interface to YAML::Store and work on a
65
+ small wrapper around KirbyBase is in progress.
66
+
67
+ For the time being you can use anything you like, currently tested ORMs are
68
+ ActiveRecord and Og.
69
+
70
+ - View
71
+
72
+ Ramaze offers a plethora of Templating-engines that you can use in your
73
+ View, including Amrita2, Erubis (ERB), HAML, Liquid, Markaby and the
74
+ default, called Ezamar.
75
+
76
+ The View in Ramaze is tightly coupled with the Controller, that means that
77
+ your Controller is a subclass of the Templating you will use for the
78
+ controller.
79
+
80
+ - Controller
81
+
82
+ That's the smallest but most central part of every Ramaze-application.
83
+
84
+ The Controllers act as small dispatcher for your View, by looking up which
85
+ templating-engine to use and by providing methods that in compound with
86
+ the templates are called actions.
87
+
88
+ the naming and mapping of the controller and its methods will define the
89
+ layout of your URLs.
90
+
91
+ Many helpers provide you pragmatic ways of adding
92
+ things like aspects, feeds, redirects and the like.
data/doc/GPL ADDED
@@ -0,0 +1,340 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Library General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License
307
+ along with this program; if not, write to the Free Software
308
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
309
+
310
+
311
+ Also add information on how to contact you by electronic and paper mail.
312
+
313
+ If the program is interactive, make it output a short notice like this
314
+ when it starts in an interactive mode:
315
+
316
+ Gnomovision version 69, Copyright (C) year name of author
317
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
318
+ This is free software, and you are welcome to redistribute it
319
+ under certain conditions; type `show c' for details.
320
+
321
+ The hypothetical commands `show w' and `show c' should show the appropriate
322
+ parts of the General Public License. Of course, the commands you use may
323
+ be called something other than `show w' and `show c'; they could even be
324
+ mouse-clicks or menu items--whatever suits your program.
325
+
326
+ You should also get your employer (if you work as a programmer) or your
327
+ school, if any, to sign a "copyright disclaimer" for the program, if
328
+ necessary. Here is a sample; alter the names:
329
+
330
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
331
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
332
+
333
+ <signature of Ty Coon>, 1 April 1989
334
+ Ty Coon, President of Vice
335
+
336
+ This General Public License does not permit incorporating your program into
337
+ proprietary programs. If your program is a subroutine library, you may
338
+ consider it more useful to permit linking proprietary applications with the
339
+ library. If this is what you want to do, use the GNU Library General
340
+ Public License instead of this License.