ramaze 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. data/Rakefile +20 -3
  2. data/bin/ramaze +1 -4
  3. data/doc/AUTHORS +2 -1
  4. data/doc/CHANGELOG +539 -32
  5. data/doc/LEGAL +4 -0
  6. data/doc/meta/announcement.txt +79 -47
  7. data/examples/blog/README +2 -2
  8. data/examples/blog/spec/blog.rb +33 -48
  9. data/examples/blog/src/controller.rb +15 -13
  10. data/examples/blog/src/model.rb +28 -10
  11. data/examples/blog/start.rb +0 -10
  12. data/examples/blog/template/edit.xhtml +1 -1
  13. data/examples/blog/template/index.xhtml +2 -2
  14. data/examples/facebook.rb +152 -0
  15. data/examples/linking.rb +28 -0
  16. data/examples/ramaise.rb +4 -11
  17. data/examples/rammit/spec/rammit.rb +30 -0
  18. data/examples/rammit/src/controller/main.rb +3 -0
  19. data/examples/rammit/src/controller/page.rb +16 -0
  20. data/examples/rammit/src/model.rb +33 -0
  21. data/examples/rammit/start.rb +7 -0
  22. data/examples/rammit/template/index.xhtml +14 -0
  23. data/examples/rammit/template/page/view.xhtml +4 -0
  24. data/examples/rapaste/Rakefile +28 -0
  25. data/examples/rapaste/public/css/active4d.css +114 -0
  26. data/examples/rapaste/public/css/all_hallows_eve.css +72 -0
  27. data/examples/rapaste/public/css/amy.css +147 -0
  28. data/examples/rapaste/public/css/blackboard.css +88 -0
  29. data/examples/rapaste/public/css/brilliance_black.css +605 -0
  30. data/examples/rapaste/public/css/brilliance_dull.css +599 -0
  31. data/examples/rapaste/public/css/cobalt.css +149 -0
  32. data/examples/rapaste/public/css/dawn.css +121 -0
  33. data/examples/rapaste/public/css/display.css +179 -0
  34. data/examples/rapaste/public/css/eiffel.css +121 -0
  35. data/examples/rapaste/public/css/espresso_libre.css +109 -0
  36. data/examples/rapaste/public/css/idle.css +62 -0
  37. data/examples/rapaste/public/css/iplastic.css +80 -0
  38. data/examples/rapaste/public/css/lazy.css +73 -0
  39. data/examples/rapaste/public/css/mac_classic.css +123 -0
  40. data/examples/rapaste/public/css/magicwb_amiga.css +104 -0
  41. data/examples/rapaste/public/css/pastels_on_dark.css +188 -0
  42. data/examples/rapaste/public/css/slush_poppies.css +85 -0
  43. data/examples/rapaste/public/css/spacecadet.css +51 -0
  44. data/examples/rapaste/public/css/sunburst.css +180 -0
  45. data/examples/rapaste/public/css/twilight.css +137 -0
  46. data/examples/rapaste/public/css/zenburnesque.css +91 -0
  47. data/examples/rapaste/public/js/jquery.js +11 -0
  48. data/examples/rapaste/rapaste.sqlite +0 -0
  49. data/examples/rapaste/spec/rapaste.rb +49 -0
  50. data/examples/rapaste/src/controller.rb +69 -0
  51. data/examples/rapaste/src/model.rb +61 -0
  52. data/examples/rapaste/start.rb +20 -0
  53. data/examples/rapaste/template/copy.xhtml +10 -0
  54. data/examples/rapaste/template/index.xhtml +9 -0
  55. data/examples/rapaste/template/layout.xhtml +22 -0
  56. data/examples/rapaste/template/list.xhtml +28 -0
  57. data/examples/rapaste/template/view.xhtml +37 -0
  58. data/examples/sourceview/sourceview.rb +3 -3
  59. data/examples/templates/template_amrita2.rb +1 -3
  60. data/examples/todolist/spec/todolist.rb +15 -18
  61. data/examples/whywiki/spec/whywiki.rb +15 -20
  62. data/examples/whywiki/start.rb +0 -1
  63. data/examples/wikore/spec/wikore.rb +14 -19
  64. data/examples/wiktacular/spec/wiktacular.rb +8 -15
  65. data/lib/proto/{src/controller → controller}/main.rb +4 -4
  66. data/lib/proto/public/css/ramaze_error.css +39 -3
  67. data/lib/proto/public/js/jquery.js +2039 -1020
  68. data/lib/proto/spec/main.rb +27 -0
  69. data/lib/proto/start.rb +5 -5
  70. data/lib/proto/view/error.xhtml +62 -0
  71. data/lib/proto/view/index.xhtml +34 -0
  72. data/lib/proto/view/page.xhtml +15 -0
  73. data/lib/ramaze.rb +9 -7
  74. data/lib/ramaze/action.rb +7 -3
  75. data/lib/ramaze/action/render.rb +15 -5
  76. data/lib/ramaze/adapter.rb +5 -5
  77. data/lib/ramaze/adapter/base.rb +2 -2
  78. data/lib/ramaze/adapter/cgi.rb +1 -1
  79. data/lib/ramaze/adapter/evented_mongrel.rb +1 -1
  80. data/lib/ramaze/adapter/fcgi.rb +2 -2
  81. data/lib/ramaze/adapter/mongrel.rb +1 -1
  82. data/lib/ramaze/adapter/swiftiplied_mongrel.rb +1 -1
  83. data/lib/ramaze/adapter/thin.rb +25 -0
  84. data/lib/ramaze/adapter/webrick.rb +1 -1
  85. data/lib/ramaze/cache.rb +3 -2
  86. data/lib/ramaze/cache/memcached.rb +1 -1
  87. data/lib/ramaze/cache/memory.rb +1 -1
  88. data/lib/ramaze/cache/yaml_store.rb +1 -1
  89. data/lib/ramaze/contrib.rb +1 -1
  90. data/lib/ramaze/contrib/auto_params.rb +12 -5
  91. data/lib/ramaze/contrib/auto_params/get_args.rb +1 -0
  92. data/lib/ramaze/contrib/facebook.rb +23 -0
  93. data/lib/ramaze/contrib/facebook/facebook.rb +168 -0
  94. data/lib/ramaze/contrib/gettext.rb +111 -0
  95. data/lib/ramaze/contrib/gettext/mo.rb +155 -0
  96. data/lib/ramaze/contrib/gettext/po.rb +109 -0
  97. data/lib/ramaze/contrib/gzip_filter.rb +1 -1
  98. data/lib/ramaze/contrib/route.rb +15 -5
  99. data/lib/ramaze/contrib/sequel/fill.rb +1 -1
  100. data/lib/ramaze/controller.rb +10 -4
  101. data/lib/ramaze/controller/error.rb +5 -13
  102. data/lib/ramaze/controller/main.rb +2 -0
  103. data/lib/ramaze/controller/resolve.rb +18 -10
  104. data/lib/ramaze/dispatcher.rb +1 -1
  105. data/lib/ramaze/dispatcher/action.rb +1 -1
  106. data/lib/ramaze/dispatcher/directory.rb +3 -2
  107. data/lib/ramaze/dispatcher/error.rb +5 -5
  108. data/lib/ramaze/dispatcher/file.rb +13 -2
  109. data/lib/ramaze/error.rb +1 -1
  110. data/lib/ramaze/gestalt.rb +2 -2
  111. data/lib/ramaze/global.rb +5 -5
  112. data/lib/ramaze/global/dsl.rb +1 -1
  113. data/lib/ramaze/global/globalstruct.rb +11 -5
  114. data/lib/ramaze/helper.rb +1 -1
  115. data/lib/ramaze/helper/aspect.rb +1 -1
  116. data/lib/ramaze/helper/auth.rb +2 -2
  117. data/lib/ramaze/helper/cache.rb +1 -1
  118. data/lib/ramaze/helper/cgi.rb +1 -1
  119. data/lib/ramaze/helper/file.rb +1 -1
  120. data/lib/ramaze/helper/flash.rb +1 -1
  121. data/lib/ramaze/helper/formatting.rb +1 -1
  122. data/lib/ramaze/helper/identity.rb +1 -1
  123. data/lib/ramaze/helper/inform.rb +1 -1
  124. data/lib/ramaze/helper/link.rb +4 -4
  125. data/lib/ramaze/helper/markaby.rb +1 -1
  126. data/lib/ramaze/helper/nitroform.rb +1 -1
  127. data/lib/ramaze/helper/pager.rb +2 -1
  128. data/lib/ramaze/helper/partial.rb +1 -1
  129. data/lib/ramaze/helper/redirect.rb +6 -1
  130. data/lib/ramaze/helper/sequel.rb +54 -0
  131. data/lib/ramaze/helper/stack.rb +1 -1
  132. data/lib/ramaze/inform.rb +1 -1
  133. data/lib/ramaze/inform/analogger.rb +1 -1
  134. data/lib/ramaze/inform/growl.rb +1 -1
  135. data/lib/ramaze/inform/hub.rb +1 -1
  136. data/lib/ramaze/inform/informer.rb +1 -1
  137. data/lib/ramaze/inform/informing.rb +2 -2
  138. data/lib/ramaze/inform/knotify.rb +1 -1
  139. data/lib/ramaze/inform/syslog.rb +1 -1
  140. data/lib/ramaze/inform/xosd.rb +1 -1
  141. data/lib/ramaze/snippets.rb +1 -1
  142. data/lib/ramaze/snippets/array/put_within.rb +1 -1
  143. data/lib/ramaze/snippets/blankslate.rb +7 -0
  144. data/lib/ramaze/snippets/dictionary.rb +6 -1
  145. data/lib/ramaze/snippets/divide.rb +1 -1
  146. data/lib/ramaze/snippets/kernel/__dir__.rb +1 -1
  147. data/lib/ramaze/snippets/kernel/acquire.rb +39 -0
  148. data/lib/ramaze/snippets/kernel/aquire.rb +1 -34
  149. data/lib/ramaze/snippets/kernel/constant.rb +1 -1
  150. data/lib/ramaze/snippets/kernel/pretty_inspect.rb +1 -1
  151. data/lib/ramaze/snippets/numeric/filesize_format.rb +1 -1
  152. data/lib/ramaze/snippets/object/traits.rb +1 -1
  153. data/lib/ramaze/snippets/ordered_set.rb +12 -7
  154. data/lib/ramaze/snippets/ramaze/caller_info.rb +1 -1
  155. data/lib/ramaze/snippets/ramaze/caller_lines.rb +1 -1
  156. data/lib/ramaze/snippets/string/camel_case.rb +1 -1
  157. data/lib/ramaze/snippets/string/color.rb +2 -4
  158. data/lib/ramaze/snippets/string/each.rb +1 -1
  159. data/lib/ramaze/snippets/string/ord.rb +15 -0
  160. data/lib/ramaze/snippets/string/snake_case.rb +1 -1
  161. data/lib/ramaze/snippets/struct/fill.rb +4 -2
  162. data/lib/ramaze/snippets/struct/values_at.rb +2 -2
  163. data/lib/ramaze/snippets/symbol/to_proc.rb +15 -8
  164. data/lib/ramaze/snippets/thread/into.rb +1 -1
  165. data/lib/ramaze/sourcereload.rb +4 -3
  166. data/lib/ramaze/spec/helper.rb +85 -32
  167. data/lib/ramaze/spec/helper/bacon.rb +7 -0
  168. data/lib/ramaze/spec/helper/browser.rb +1 -2
  169. data/lib/ramaze/spec/helper/mock_http.rb +1 -1
  170. data/lib/ramaze/spec/helper/pretty_output.rb +70 -0
  171. data/lib/ramaze/spec/helper/requester.rb +1 -1
  172. data/lib/ramaze/spec/helper/simple_http.rb +5 -4
  173. data/lib/ramaze/spec/helper/snippets.rb +6 -0
  174. data/lib/ramaze/store/default.rb +1 -1
  175. data/lib/ramaze/template.rb +1 -1
  176. data/lib/ramaze/template/amrita2.rb +6 -5
  177. data/lib/ramaze/template/erubis.rb +1 -1
  178. data/lib/ramaze/template/ezamar.rb +1 -1
  179. data/lib/ramaze/template/ezamar/element.rb +1 -1
  180. data/lib/ramaze/template/ezamar/engine.rb +1 -1
  181. data/lib/ramaze/template/ezamar/morpher.rb +1 -1
  182. data/lib/ramaze/template/ezamar/render_partial.rb +1 -1
  183. data/lib/ramaze/template/haml.rb +1 -1
  184. data/lib/ramaze/template/liquid.rb +1 -1
  185. data/lib/ramaze/template/markaby.rb +1 -1
  186. data/lib/ramaze/template/nagoro.rb +4 -6
  187. data/lib/ramaze/template/none.rb +1 -1
  188. data/lib/ramaze/template/remarkably.rb +1 -1
  189. data/lib/ramaze/template/sass.rb +1 -1
  190. data/lib/ramaze/tool.rb +1 -1
  191. data/lib/ramaze/tool/create.rb +7 -1
  192. data/lib/ramaze/tool/localize.rb +7 -14
  193. data/lib/ramaze/tool/mime.rb +1 -1
  194. data/lib/ramaze/tool/record.rb +1 -1
  195. data/lib/ramaze/trinity.rb +1 -1
  196. data/lib/ramaze/trinity/request.rb +4 -2
  197. data/lib/ramaze/trinity/response.rb +1 -1
  198. data/lib/ramaze/trinity/session.rb +7 -1
  199. data/lib/ramaze/version.rb +3 -3
  200. data/lib/vendor/bacon.rb +317 -0
  201. data/rake_tasks/conf.rake +1 -1
  202. data/rake_tasks/maintenance.rake +7 -5
  203. data/rake_tasks/spec.rake +54 -40
  204. data/spec/contrib/auto_params.rb +21 -4
  205. data/spec/contrib/route.rb +31 -4
  206. data/spec/contrib/sequel/fill.rb +3 -4
  207. data/spec/examples/caching.rb +5 -2
  208. data/spec/examples/css.rb +5 -2
  209. data/spec/examples/element.rb +5 -4
  210. data/spec/examples/hello.rb +1 -0
  211. data/spec/examples/linking.rb +18 -0
  212. data/spec/examples/simple.rb +13 -18
  213. data/spec/examples/templates/template_amrita2.rb +3 -2
  214. data/spec/examples/templates/template_erubis.rb +3 -2
  215. data/spec/examples/templates/template_ezamar.rb +2 -1
  216. data/spec/examples/templates/template_haml.rb +3 -2
  217. data/spec/examples/templates/template_liquid.rb +3 -2
  218. data/spec/examples/templates/template_markaby.rb +3 -2
  219. data/spec/examples/templates/template_remarkably.rb +3 -2
  220. data/spec/ramaze/action/basics.rb +4 -4
  221. data/spec/ramaze/action/cache.rb +11 -13
  222. data/spec/ramaze/action/layout.rb +47 -3
  223. data/spec/ramaze/action/render.rb +3 -3
  224. data/spec/ramaze/action/template/instancevars/layout.xhtml +1 -0
  225. data/spec/ramaze/adapter.rb +7 -7
  226. data/spec/ramaze/adapter/mongrel.rb +1 -1
  227. data/spec/ramaze/adapter/record.rb +7 -7
  228. data/spec/ramaze/adapter/webrick.rb +1 -1
  229. data/spec/ramaze/cache.rb +6 -8
  230. data/spec/ramaze/controller.rb +77 -65
  231. data/spec/ramaze/controller/resolve.rb +2 -1
  232. data/spec/ramaze/controller/template_resolving.rb +3 -4
  233. data/spec/ramaze/dispatcher.rb +3 -4
  234. data/spec/ramaze/dispatcher/directory.rb +35 -35
  235. data/spec/ramaze/dispatcher/file.rb +8 -5
  236. data/spec/ramaze/element.rb +4 -4
  237. data/spec/ramaze/error.rb +13 -11
  238. data/spec/ramaze/gestalt.rb +1 -1
  239. data/spec/ramaze/helper/aspect.rb +2 -1
  240. data/spec/ramaze/helper/auth.rb +4 -2
  241. data/spec/ramaze/helper/cache.rb +10 -9
  242. data/spec/ramaze/helper/cgi.rb +2 -2
  243. data/spec/ramaze/helper/file.rb +1 -0
  244. data/spec/ramaze/helper/flash.rb +5 -4
  245. data/spec/ramaze/helper/formatting.rb +1 -1
  246. data/spec/ramaze/helper/link.rb +3 -3
  247. data/spec/ramaze/helper/pager.rb +44 -80
  248. data/spec/ramaze/helper/partial.rb +2 -3
  249. data/spec/ramaze/helper/redirect.rb +10 -1
  250. data/spec/ramaze/helper/stack.rb +4 -3
  251. data/spec/ramaze/helper/template/loop.xhtml +2 -1
  252. data/spec/ramaze/inform/informer.rb +2 -2
  253. data/spec/ramaze/inform/syslog.rb +1 -1
  254. data/spec/ramaze/localize.rb +26 -26
  255. data/spec/ramaze/morpher.rb +6 -7
  256. data/spec/ramaze/params.rb +7 -8
  257. data/spec/ramaze/request.rb +27 -6
  258. data/spec/ramaze/request/mongrel.rb +1 -1
  259. data/spec/ramaze/request/thin.rb +9 -0
  260. data/spec/ramaze/session.rb +2 -1
  261. data/spec/ramaze/store/default.rb +14 -17
  262. data/spec/ramaze/template.rb +5 -7
  263. data/spec/ramaze/template/amrita2.rb +4 -1
  264. data/spec/ramaze/template/erubis.rb +2 -1
  265. data/spec/ramaze/template/ezamar.rb +2 -3
  266. data/spec/ramaze/template/ezamar/other__index.xhtml +1 -0
  267. data/spec/ramaze/template/haml.rb +2 -1
  268. data/spec/ramaze/template/liquid.rb +4 -2
  269. data/spec/ramaze/template/markaby.rb +4 -2
  270. data/spec/ramaze/template/nagoro.rb +3 -4
  271. data/spec/ramaze/template/remarkably.rb +4 -2
  272. data/spec/ramaze/template/sass.rb +3 -2
  273. data/spec/ramaze/template/xslt.rb +4 -7
  274. data/spec/ramaze/trinity/request.rb +4 -3
  275. data/spec/ramaze/trinity/session.rb +6 -4
  276. data/spec/snippets/array/put_within.rb +3 -2
  277. data/spec/snippets/divide.rb +1 -4
  278. data/spec/snippets/kernel/__dir__.rb +1 -1
  279. data/spec/snippets/kernel/acquire.rb +71 -0
  280. data/spec/snippets/kernel/constant.rb +4 -8
  281. data/spec/snippets/numeric/filesize_format.rb +1 -1
  282. data/spec/snippets/ordered_set.rb +9 -2
  283. data/spec/snippets/ramaze/caller_info.rb +3 -3
  284. data/spec/snippets/ramaze/caller_lines.rb +3 -3
  285. data/spec/snippets/string/camel_case.rb +1 -1
  286. data/spec/snippets/string/color.rb +2 -2
  287. data/spec/snippets/string/snake_case.rb +5 -1
  288. data/spec/snippets/string/unindent.rb +1 -1
  289. data/spec/snippets/struct/fill.rb +14 -15
  290. data/spec/snippets/struct/values_at.rb +15 -10
  291. data/spec/snippets/symbol/to_proc.rb +13 -0
  292. data/spec/snippets/thread/into.rb +3 -4
  293. metadata +458 -386
  294. data/doc/README.html +0 -729
  295. data/doc/changes.txt +0 -5044
  296. data/doc/changes.xml +0 -5046
  297. data/lib/proto/public/error.zmr +0 -61
  298. data/lib/proto/src/element/page.rb +0 -17
  299. data/lib/proto/src/model.rb +0 -6
  300. data/lib/proto/template/index.xhtml +0 -15
  301. data/lib/ramaze/spec/helper/layout.rb +0 -58
  302. data/lib/ramaze/spec/helper/minimal.rb +0 -23
  303. data/lib/ramaze/spec/helper/wrap.rb +0 -198
  304. data/spec/snippets/kernel/aquire.rb +0 -71
@@ -0,0 +1,28 @@
1
+ require 'ramaze'
2
+
3
+ class LinkingController < Ramaze::Controller
4
+ map '/'
5
+
6
+ def index
7
+ %{simple link <br/> <a href="#{Rs(:help)}">Help?</a>}
8
+ end
9
+
10
+ def new
11
+ "something new!"
12
+ end
13
+
14
+ def help
15
+ %{you have help <br/> <a href="#{R(LinkToController, :another)}">A Different Controller</a>}
16
+ end
17
+
18
+ end
19
+
20
+ class LinkToController < Ramaze::Controller
21
+ map '/link_to'
22
+
23
+ def another
24
+ %{<a href="#{R(LinkingController, :index)}">Back to Original Controller</a>}
25
+ end
26
+ end
27
+
28
+ Ramaze.start :adapter => :mongrel
@@ -12,7 +12,7 @@
12
12
  # 4. vi entries/YYYY.MM.DD.Title.Goes.Here
13
13
  # 5. ruby ramaise.rb
14
14
 
15
- %w(rubygems ramaze bluecloth rubypants haml).each { |lib| require lib }
15
+ %w(rubygems ramaze bluecloth rubypants haml).each{|lib| require lib }
16
16
 
17
17
  class BlogPost
18
18
  DIR = __DIR__/:entries
@@ -47,13 +47,6 @@ class BlogPost
47
47
  end
48
48
  end
49
49
 
50
- class String
51
- def unindent
52
- strip.gsub(/^#{ self.split("\n")[1][/^(\s+)/,1] }/, '')
53
- end
54
- alias ui unindent
55
- end
56
-
57
50
  class MainController < Ramaze::Controller
58
51
 
59
52
  TITLE = 'Ramaise'
@@ -87,7 +80,7 @@ class MainController < Ramaze::Controller
87
80
  %abbr.updated{ :title => Time.parse(post.date).iso8601 }= post.date
88
81
  %a.entry-title{ :href => '/'+post.slug, :rel => 'bookmark' }= post.title
89
82
  .entry-content= post.body
90
- ).ui
83
+ ).unindent
91
84
  end
92
85
 
93
86
  def error
@@ -98,7 +91,7 @@ class MainController < Ramaze::Controller
98
91
  Go back to the
99
92
  %a{ :href => '/' } the front
100
93
  page.
101
- ).ui
94
+ ).unindent
102
95
  end
103
96
 
104
97
  def layout
@@ -130,7 +123,7 @@ class MainController < Ramaze::Controller
130
123
  = @content
131
124
  %address.author.vcard
132
125
  %a.url.fn{ :href => '#{AUTHOR[:url]}' } #{AUTHOR[:name]}
133
- ).ui
126
+ ).unindent
134
127
  end
135
128
  layout :layout
136
129
 
@@ -0,0 +1,30 @@
1
+ require 'ramaze'
2
+ require 'ramaze/spec/helper'
3
+
4
+ $LOAD_PATH.unshift base = __DIR__/'..'
5
+ spec_require 'hpricot', 'sequel'
6
+
7
+ require 'start'
8
+
9
+ describe 'Rammit' do
10
+ behaves_like 'http'
11
+ base = File.expand_path(__DIR__/'..')
12
+ ramaze :template_root => base/'template', :public_root => base/'public'
13
+
14
+ it 'should have intro page' do
15
+ got = get('/')
16
+ doc = Hpricot(got.body)
17
+ form = doc.at(:form)
18
+ form.at('textarea[@name=text]').should.not == nil
19
+ form.at('input[@type=submit @value="Create a site"]').should.not == nil
20
+ end
21
+
22
+ it 'should create page from intro page' do
23
+ got = post('/page/create', 'text' => 'Some text')
24
+ refer = got.headers['Location']
25
+ refer.should.not == nil
26
+ got = get(refer)
27
+ doc = Hpricot(got.body)
28
+ doc.at('div#text').inner_html.should =~ /Some text/
29
+ end
30
+ end
@@ -0,0 +1,3 @@
1
+ class MainController < Ramaze::Controller
2
+ map '/'
3
+ end
@@ -0,0 +1,16 @@
1
+ class PageController < Ramaze::Controller
2
+ map '/page'
3
+
4
+ def create
5
+ redirect_referrer unless request.post?
6
+ if text = request[:text]
7
+ page = Page.create :text => text
8
+ redirect page.url
9
+ end
10
+ end
11
+
12
+ def view(oid)
13
+ page = Page[oid]
14
+ @text = page.text
15
+ end
16
+ end
@@ -0,0 +1,33 @@
1
+ require 'sequel'
2
+
3
+ DB = Sequel.sqlite
4
+
5
+ class User < Sequel::Model(:user)
6
+ set_schema do
7
+ primary_key :id
8
+
9
+ text :nick
10
+ text :password
11
+ text :email
12
+ time :created
13
+ end
14
+ end
15
+
16
+ class Page < Sequel::Model(:page)
17
+ include Ramaze::LinkHelper
18
+
19
+ set_schema do
20
+ primary_key :id
21
+
22
+ text :text
23
+ end
24
+
25
+ def url
26
+ R(PageController, :view, id)
27
+ end
28
+
29
+ end
30
+
31
+ [ User, Page ].each do |model|
32
+ model.create_table! unless model.table_exists?
33
+ end
@@ -0,0 +1,7 @@
1
+ require 'ramaze'
2
+
3
+ require 'src/model'
4
+ require 'src/controller/main'
5
+ require 'src/controller/page'
6
+
7
+ Ramaze.start
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Rammit</title>
7
+ </head>
8
+ <body>
9
+ <form method="POST" action="#{R PageController, :create}">
10
+ <textarea name="text"></textarea>
11
+ <input type="submit" value="Create a site" />
12
+ </form>
13
+ </body>
14
+ </html>
@@ -0,0 +1,4 @@
1
+ <div id="text">
2
+ #@text
3
+ </div>
4
+
@@ -0,0 +1,28 @@
1
+ require 'rake'
2
+
3
+ require 'ramaze'
4
+ require 'ramaze/spec/helper/simple_http'
5
+
6
+ task :fill do
7
+ uri = URI('http://localhost:7000/save')
8
+ base = Ramaze::BASEDIR/'..'
9
+ ext_syntax = {
10
+ 'xhtml' => 'html',
11
+ 'rb' => 'ruby',
12
+ 'css' => 'css',
13
+ 'js' => 'javascript'
14
+ }.each do |ext, syntax|
15
+ Dir[base/"**/*.#{ext}"].each do |file|
16
+ next if file =~ /_darcs/
17
+ p syntax => file
18
+
19
+ begin
20
+ req = SimpleHttp.new(uri)
21
+ req.post('syntax' => syntax, 'text' => File.read(file))
22
+ rescue Net::HTTPInternalServerError => ex
23
+ puts ex
24
+ retry
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,114 @@
1
+ pre.active4d .DiffHeader {
2
+ background-color: #656565;
3
+ color: #FFFFFF;
4
+ }
5
+ pre.active4d .Operator {
6
+ }
7
+ pre.active4d .InheritedClass {
8
+ }
9
+ pre.active4d .TypeName {
10
+ color: #21439C;
11
+ }
12
+ pre.active4d .Number {
13
+ color: #A8017E;
14
+ }
15
+ pre.active4d .EmbeddedSource {
16
+ background-color: #ECF1FF;
17
+ }
18
+ pre.active4d {
19
+ background-color: #FFFFFF;
20
+ color: #000000;
21
+ }
22
+ pre.active4d .DiffInsertedLine {
23
+ background-color: #98FF9A;
24
+ color: #000000;
25
+ }
26
+ pre.active4d .LibraryVariable {
27
+ color: #A535AE;
28
+ }
29
+ pre.active4d .Storage {
30
+ color: #FF5600;
31
+ }
32
+ pre.active4d .InterpolatedEntity {
33
+ font-weight: bold;
34
+ color: #66CCFF;
35
+ }
36
+ pre.active4d .line-numbers {
37
+ background-color: #BAD6FD;
38
+ color: #000000;
39
+ }
40
+ pre.active4d .LocalVariable {
41
+ font-weight: bold;
42
+ color: #6392FF;
43
+ }
44
+ pre.active4d .DiffLineRange {
45
+ background-color: #1B63FF;
46
+ color: #FFFFFF;
47
+ }
48
+ pre.active4d .BlockComment {
49
+ color: #D33435;
50
+ }
51
+ pre.active4d .TagName {
52
+ color: #016CFF;
53
+ }
54
+ pre.active4d .FunctionArgument {
55
+ }
56
+ pre.active4d .BuiltInConstant {
57
+ color: #A535AE;
58
+ }
59
+ pre.active4d .LineComment {
60
+ color: #D33535;
61
+ }
62
+ pre.active4d .DiffDeletedLine {
63
+ background-color: #FF7880;
64
+ color: #000000;
65
+ }
66
+ pre.active4d .NamedConstant {
67
+ color: #B7734C;
68
+ }
69
+ pre.active4d .CommandMethod {
70
+ font-weight: bold;
71
+ color: #45AE34;
72
+ }
73
+ pre.active4d .TableField {
74
+ color: #0BB600;
75
+ }
76
+ pre.active4d .PlainXmlText {
77
+ color: #000000;
78
+ }
79
+ pre.active4d .Invalid {
80
+ background-color: #990000;
81
+ color: #FFFFFF;
82
+ }
83
+ pre.active4d .LibraryClassType {
84
+ color: #A535AE;
85
+ }
86
+ pre.active4d .TagAttribute {
87
+ color: #963DFF;
88
+ }
89
+ pre.active4d .Keyword {
90
+ font-weight: bold;
91
+ color: #006699;
92
+ }
93
+ pre.active4d .UserDefinedConstant {
94
+ }
95
+ pre.active4d .String {
96
+ color: #666666;
97
+ }
98
+ pre.active4d .DiffUnchangedLine {
99
+ color: #5E5E5E;
100
+ }
101
+ pre.active4d .TagContainer {
102
+ color: #7A7A7A;
103
+ }
104
+ pre.active4d .FunctionName {
105
+ color: #21439C;
106
+ }
107
+ pre.active4d .Variable {
108
+ font-weight: bold;
109
+ color: #0053FF;
110
+ }
111
+ pre.active4d .DateTimeLiteral {
112
+ font-weight: bold;
113
+ color: #66CCFF;
114
+ }
@@ -0,0 +1,72 @@
1
+ pre.all_hallows_eve .ClassInheritance {
2
+ font-style: italic;
3
+ }
4
+ pre.all_hallows_eve .Constant {
5
+ color: #3387CC;
6
+ }
7
+ pre.all_hallows_eve .TypeName {
8
+ text-decoration: underline;
9
+ }
10
+ pre.all_hallows_eve .TextBase {
11
+ background-color: #434242;
12
+ color: #FFFFFF;
13
+ }
14
+ pre.all_hallows_eve {
15
+ background-color: #000000;
16
+ color: #FFFFFF;
17
+ }
18
+ pre.all_hallows_eve .StringEscapesExecuted {
19
+ color: #555555;
20
+ }
21
+ pre.all_hallows_eve .line-numbers {
22
+ background-color: #73597E;
23
+ color: #FFFFFF;
24
+ }
25
+ pre.all_hallows_eve .StringExecuted {
26
+ background-color: #CCCC33;
27
+ color: #000000;
28
+ }
29
+ pre.all_hallows_eve .BlockComment {
30
+ background-color: #9B9B9B;
31
+ color: #FFFFFF;
32
+ }
33
+ pre.all_hallows_eve .TagName {
34
+ text-decoration: underline;
35
+ }
36
+ pre.all_hallows_eve .PreProcessorLine {
37
+ color: #D0D0FF;
38
+ }
39
+ pre.all_hallows_eve .SupportFunction {
40
+ color: #C83730;
41
+ }
42
+ pre.all_hallows_eve .FunctionArgument {
43
+ font-style: italic;
44
+ }
45
+ pre.all_hallows_eve .PreProcessorDirective {
46
+ }
47
+ pre.all_hallows_eve .StringEscapes {
48
+ color: #AAAAAA;
49
+ }
50
+ pre.all_hallows_eve .SourceBase {
51
+ background-color: #000000;
52
+ color: #FFFFFF;
53
+ }
54
+ pre.all_hallows_eve .TagAttribute {
55
+ }
56
+ pre.all_hallows_eve .StringLiteral {
57
+ color: #CCCC33;
58
+ }
59
+ pre.all_hallows_eve .String {
60
+ color: #66CC33;
61
+ }
62
+ pre.all_hallows_eve .Keyword {
63
+ color: #CC7833;
64
+ }
65
+ pre.all_hallows_eve .RegularExpression {
66
+ color: #CCCC33;
67
+ }
68
+ pre.all_hallows_eve .FunctionName {
69
+ }
70
+ pre.all_hallows_eve .Comment {
71
+ color: #9933CC;
72
+ }
@@ -0,0 +1,147 @@
1
+ pre.amy .PolymorphicVariants {
2
+ color: #60B0FF;
3
+ font-style: italic;
4
+ }
5
+ pre.amy .KeywordDecorator {
6
+ color: #D0D0FF;
7
+ }
8
+ pre.amy .Punctuation {
9
+ color: #805080;
10
+ }
11
+ pre.amy .InheritedClass {
12
+ }
13
+ pre.amy .InvalidDepricated {
14
+ background-color: #CC66FF;
15
+ color: #200020;
16
+ }
17
+ pre.amy .LibraryVariable {
18
+ }
19
+ pre.amy .TokenReferenceOcamlyacc {
20
+ color: #3CB0D0;
21
+ }
22
+ pre.amy .Storage {
23
+ color: #B0FFF0;
24
+ }
25
+ pre.amy .KeywordOperator {
26
+ color: #A0A0FF;
27
+ }
28
+ pre.amy .CharacterConstant {
29
+ color: #666666;
30
+ }
31
+ pre.amy .line-numbers {
32
+ background-color: #800000;
33
+ color: #000000;
34
+ }
35
+ pre.amy .ClassName {
36
+ color: #70E080;
37
+ }
38
+ pre.amy .Int64Constant {
39
+ font-style: italic;
40
+ }
41
+ pre.amy .NonTerminalReferenceOcamlyacc {
42
+ color: #C0F0F0;
43
+ }
44
+ pre.amy .TokenDefinitionOcamlyacc {
45
+ color: #3080A0;
46
+ }
47
+ pre.amy .ClassType {
48
+ color: #70E0A0;
49
+ }
50
+ pre.amy .ControlKeyword {
51
+ color: #80A0FF;
52
+ }
53
+ pre.amy .LineNumberDirectives {
54
+ text-decoration: underline;
55
+ color: #C080C0;
56
+ }
57
+ pre.amy .FloatingPointConstant {
58
+ text-decoration: underline;
59
+ }
60
+ pre.amy .Int32Constant {
61
+ font-weight: bold;
62
+ }
63
+ pre.amy .TagName {
64
+ color: #009090;
65
+ }
66
+ pre.amy .ModuleTypeDefinitions {
67
+ text-decoration: underline;
68
+ color: #B000B0;
69
+ }
70
+ pre.amy .Integer {
71
+ color: #7090B0;
72
+ }
73
+ pre.amy .Camlp4TempParser {
74
+ }
75
+ pre.amy .InvalidIllegal {
76
+ font-weight: bold;
77
+ background-color: #FFFF00;
78
+ color: #400080;
79
+ }
80
+ pre.amy .LibraryConstant {
81
+ background-color: #200020;
82
+ }
83
+ pre.amy .ModuleDefinitions {
84
+ color: #B000B0;
85
+ }
86
+ pre.amy .Variants {
87
+ color: #60B0FF;
88
+ }
89
+ pre.amy .CompilerDirectives {
90
+ color: #C080C0;
91
+ }
92
+ pre.amy .FloatingPointInfixOperator {
93
+ text-decoration: underline;
94
+ }
95
+ pre.amy .BuiltInConstant1 {
96
+ }
97
+ pre.amy {
98
+ background-color: #200020;
99
+ color: #D0D0FF;
100
+ }
101
+ pre.amy .FunctionArgument {
102
+ color: #80B0B0;
103
+ }
104
+ pre.amy .FloatingPointPrefixOperator {
105
+ text-decoration: underline;
106
+ }
107
+ pre.amy .NativeintConstant {
108
+ font-weight: bold;
109
+ }
110
+ pre.amy .BuiltInConstant {
111
+ color: #707090;
112
+ }
113
+ pre.amy .BooleanConstant {
114
+ color: #8080A0;
115
+ }
116
+ pre.amy .LibraryClassType {
117
+ }
118
+ pre.amy .TagAttribute {
119
+ }
120
+ pre.amy .Keyword {
121
+ color: #A080FF;
122
+ }
123
+ pre.amy .UserDefinedConstant {
124
+ }
125
+ pre.amy .String {
126
+ color: #999999;
127
+ }
128
+ pre.amy .Camlp4Code {
129
+ background-color: #350060;
130
+ }
131
+ pre.amy .NonTerminalDefinitionOcamlyacc {
132
+ color: #90E0E0;
133
+ }
134
+ pre.amy .FunctionName {
135
+ color: #50A0A0;
136
+ }
137
+ pre.amy .SupportModules {
138
+ color: #A00050;
139
+ }
140
+ pre.amy .Variable {
141
+ color: #008080;
142
+ }
143
+ pre.amy .Comment {
144
+ background-color: #200020;
145
+ color: #404080;
146
+ font-style: italic;
147
+ }