merb 0.3.7 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. data/README +25 -26
  2. data/Rakefile +48 -36
  3. data/app_generators/merb/USAGE +5 -0
  4. data/app_generators/merb/merb_generator.rb +107 -0
  5. data/app_generators/merb/templates/Rakefile +99 -0
  6. data/{examples/skeleton/dist → app_generators/merb/templates}/app/controllers/application.rb +1 -1
  7. data/app_generators/merb/templates/app/controllers/exceptions.rb +13 -0
  8. data/{examples/skeleton/dist → app_generators/merb/templates}/app/helpers/global_helper.rb +0 -0
  9. data/{examples/skeleton/dist/app/mailers → app_generators/merb/templates/app/mailers/views}/layout/application.erb +0 -0
  10. data/app_generators/merb/templates/app/views/exceptions/internal_server_error.html.erb +207 -0
  11. data/app_generators/merb/templates/app/views/exceptions/not_acceptable.html.erb +38 -0
  12. data/app_generators/merb/templates/app/views/exceptions/not_found.html.erb +40 -0
  13. data/app_generators/merb/templates/app/views/layout/application.html.erb +11 -0
  14. data/app_generators/merb/templates/config/boot.rb +11 -0
  15. data/app_generators/merb/templates/config/dependencies.rb +41 -0
  16. data/{examples/skeleton/dist/conf → app_generators/merb/templates/config}/environments/development.rb +0 -0
  17. data/{examples/skeleton/dist/conf → app_generators/merb/templates/config}/environments/production.rb +0 -0
  18. data/{examples/skeleton/dist/conf → app_generators/merb/templates/config}/environments/test.rb +0 -0
  19. data/app_generators/merb/templates/config/merb.yml +64 -0
  20. data/app_generators/merb/templates/config/merb_init.rb +16 -0
  21. data/app_generators/merb/templates/config/plugins.yml +1 -0
  22. data/app_generators/merb/templates/config/router.rb +32 -0
  23. data/{lib/merb/core_ext/merb_array.rb → app_generators/merb/templates/config/upload.conf} +0 -0
  24. data/app_generators/merb/templates/public/images/merb.jpg +0 -0
  25. data/app_generators/merb/templates/public/merb.fcgi +6 -0
  26. data/app_generators/merb/templates/public/stylesheets/master.css +119 -0
  27. data/app_generators/merb/templates/script/destroy +28 -0
  28. data/app_generators/merb/templates/script/generate +28 -0
  29. data/{examples/skeleton → app_generators/merb/templates}/script/stop_merb +0 -0
  30. data/app_generators/merb/templates/script/win_script.cmd +1 -0
  31. data/app_generators/merb/templates/spec/spec.opts +6 -0
  32. data/app_generators/merb/templates/spec/spec_helper.rb +10 -0
  33. data/app_generators/merb/templates/test/test_helper.rb +13 -0
  34. data/app_generators/merb_plugin/USAGE +5 -0
  35. data/app_generators/merb_plugin/merb_plugin_generator.rb +64 -0
  36. data/app_generators/merb_plugin/templates/LICENSE +20 -0
  37. data/app_generators/merb_plugin/templates/README +4 -0
  38. data/app_generators/merb_plugin/templates/Rakefile +35 -0
  39. data/app_generators/merb_plugin/templates/TODO +5 -0
  40. data/app_generators/merb_plugin/templates/merbtasks.rb +6 -0
  41. data/app_generators/merb_plugin/templates/sampleplugin.rb +10 -0
  42. data/app_generators/merb_plugin/templates/sampleplugin_spec.rb +7 -0
  43. data/app_generators/merb_plugin/templates/spec_helper.rb +2 -0
  44. data/bin/merb +1 -1
  45. data/lib/autotest/discover.rb +3 -0
  46. data/lib/autotest/merb_rspec.rb +79 -0
  47. data/lib/merb.rb +72 -93
  48. data/lib/merb/{merb_abstract_controller.rb → abstract_controller.rb} +28 -5
  49. data/lib/merb/caching/action_cache.rb +65 -29
  50. data/lib/merb/caching/fragment_cache.rb +9 -4
  51. data/lib/merb/caching/store/file_cache.rb +22 -14
  52. data/lib/merb/caching/store/memory_cache.rb +26 -8
  53. data/lib/merb/{merb_constants.rb → constants.rb} +9 -7
  54. data/lib/merb/controller.rb +178 -0
  55. data/lib/merb/core_ext.rb +13 -11
  56. data/lib/merb/core_ext/array.rb +0 -0
  57. data/lib/merb/core_ext/{merb_class.rb → class.rb} +0 -0
  58. data/lib/merb/core_ext/{merb_enumerable.rb → enumerable.rb} +0 -0
  59. data/lib/merb/core_ext/get_args.rb +52 -0
  60. data/lib/merb/core_ext/{merb_hash.rb → hash.rb} +40 -11
  61. data/lib/merb/core_ext/{merb_inflections.rb → inflections.rb} +0 -0
  62. data/lib/merb/core_ext/{merb_inflector.rb → inflector.rb} +1 -1
  63. data/lib/merb/core_ext/{merb_kernel.rb → kernel.rb} +56 -3
  64. data/lib/merb/core_ext/mash.rb +88 -0
  65. data/lib/merb/core_ext/{merb_module.rb → module.rb} +0 -0
  66. data/lib/merb/core_ext/{merb_numeric.rb → numeric.rb} +0 -0
  67. data/lib/merb/core_ext/{merb_object.rb → object.rb} +10 -47
  68. data/lib/merb/core_ext/string.rb +56 -0
  69. data/lib/merb/core_ext/{merb_symbol.rb → symbol.rb} +0 -0
  70. data/lib/merb/dispatcher.rb +109 -0
  71. data/lib/merb/{merb_drb_server.rb → drb_server.rb} +0 -0
  72. data/lib/merb/erubis_ext.rb +10 -0
  73. data/lib/merb/exceptions.rb +173 -0
  74. data/lib/merb/generators/merb_app/merb_app.rb +5 -25
  75. data/lib/merb/generators/merb_generator_helpers.rb +317 -0
  76. data/lib/merb/generators/merb_plugin.rb +19 -0
  77. data/lib/merb/logger.rb +65 -0
  78. data/lib/merb/{merb_mail_controller.rb → mail_controller.rb} +102 -49
  79. data/lib/merb/{merb_mailer.rb → mailer.rb} +31 -27
  80. data/lib/merb/mixins/{basic_authentication_mixin.rb → basic_authentication.rb} +3 -3
  81. data/lib/merb/mixins/{controller_mixin.rb → controller.rb} +131 -112
  82. data/lib/merb/mixins/{erubis_capture_mixin.rb → erubis_capture.rb} +12 -21
  83. data/lib/merb/mixins/{form_control_mixin.rb → form_control.rb} +6 -12
  84. data/lib/merb/mixins/render.rb +401 -0
  85. data/lib/merb/mixins/responder.rb +378 -0
  86. data/lib/merb/mixins/{view_context_mixin.rb → view_context.rb} +65 -10
  87. data/lib/merb/mixins/web_controller.rb +29 -0
  88. data/lib/merb/{merb_handler.rb → mongrel_handler.rb} +59 -38
  89. data/lib/merb/part_controller.rb +19 -0
  90. data/lib/merb/plugins.rb +16 -0
  91. data/lib/merb/rack_adapter.rb +37 -0
  92. data/lib/merb/request.rb +421 -0
  93. data/lib/merb/router.rb +576 -0
  94. data/lib/merb/{merb_server.rb → server.rb} +275 -71
  95. data/lib/merb/session.rb +10 -10
  96. data/lib/merb/session/cookie_store.rb +125 -0
  97. data/lib/merb/session/{merb_mem_cache_session.rb → mem_cache_session.rb} +22 -9
  98. data/lib/merb/session/{merb_memory_session.rb → memory_session.rb} +15 -11
  99. data/lib/merb/template.rb +35 -8
  100. data/lib/merb/template/erubis.rb +16 -10
  101. data/lib/merb/template/haml.rb +33 -20
  102. data/lib/merb/template/markaby.rb +16 -14
  103. data/lib/merb/template/xml_builder.rb +8 -4
  104. data/lib/merb/test/{merb_fake_request.rb → fake_request.rb} +11 -5
  105. data/lib/merb/test/helper.rb +31 -0
  106. data/lib/merb/test/hpricot.rb +136 -0
  107. data/lib/merb/test/{merb_multipart.rb → multipart.rb} +1 -1
  108. data/lib/merb/test/rspec.rb +93 -0
  109. data/lib/merb/{merb_upload_handler.rb → upload_handler.rb} +5 -6
  110. data/lib/merb/{merb_upload_progress.rb → upload_progress.rb} +1 -1
  111. data/lib/merb/{merb_view_context.rb → view_context.rb} +27 -42
  112. data/lib/{merb_tasks.rb → tasks.rb} +0 -0
  113. data/lib/tasks/merb.rake +21 -11
  114. data/merb_default_generators/model/USAGE +0 -0
  115. data/merb_default_generators/model/model_generator.rb +16 -0
  116. data/merb_default_generators/model/templates/new_model_template.erb +5 -0
  117. data/merb_default_generators/resource_controller/USAGE +0 -0
  118. data/merb_default_generators/resource_controller/resource_controller_generator.rb +26 -0
  119. data/merb_default_generators/resource_controller/templates/controller.rb +30 -0
  120. data/merb_default_generators/resource_controller/templates/edit.html.erb +1 -0
  121. data/merb_default_generators/resource_controller/templates/helper.rb +5 -0
  122. data/merb_default_generators/resource_controller/templates/index.html.erb +1 -0
  123. data/merb_default_generators/resource_controller/templates/new.html.erb +1 -0
  124. data/merb_default_generators/resource_controller/templates/show.html.erb +1 -0
  125. data/merb_generators/controller/USAGE +5 -0
  126. data/merb_generators/controller/controller_generator.rb +16 -0
  127. data/merb_generators/controller/templates/controller.rb +8 -0
  128. data/merb_generators/controller/templates/helper.rb +5 -0
  129. data/merb_generators/controller/templates/index.html.erb +3 -0
  130. data/merb_generators/resource/USAGE +0 -0
  131. data/merb_generators/resource/resource_generator.rb +60 -0
  132. data/rspec_generators/merb_controller_test/merb_controller_test_generator.rb +67 -0
  133. data/rspec_generators/merb_controller_test/templates/controller_spec.rb +8 -0
  134. data/rspec_generators/merb_controller_test/templates/edit_spec.rb +12 -0
  135. data/rspec_generators/merb_controller_test/templates/helper_spec.rb +5 -0
  136. data/rspec_generators/merb_controller_test/templates/index_spec.rb +12 -0
  137. data/rspec_generators/merb_controller_test/templates/new_spec.rb +12 -0
  138. data/rspec_generators/merb_controller_test/templates/show_spec.rb +5 -0
  139. data/rspec_generators/merb_model_test/merb_model_test_generator.rb +26 -0
  140. data/rspec_generators/merb_model_test/templates/model_spec_template.erb +7 -0
  141. data/script/destroy +14 -0
  142. data/script/generate +14 -0
  143. data/test_unit_generators/merb_controller_test/merb_controller_test_generator.rb +53 -0
  144. data/test_unit_generators/merb_controller_test/templates/functional_test.rb +17 -0
  145. data/test_unit_generators/merb_controller_test/templates/helper_test.rb +9 -0
  146. data/test_unit_generators/merb_model_test/merb_model_test_generator.rb +29 -0
  147. data/test_unit_generators/merb_model_test/templates/model_test_unit_template.erb +9 -0
  148. metadata +172 -94
  149. data/examples/README_EXAMPLES +0 -10
  150. data/examples/skeleton/Rakefile +0 -68
  151. data/examples/skeleton/dist/app/views/layout/application.herb +0 -12
  152. data/examples/skeleton/dist/conf/database.yml +0 -23
  153. data/examples/skeleton/dist/conf/merb.yml +0 -57
  154. data/examples/skeleton/dist/conf/merb_init.rb +0 -24
  155. data/examples/skeleton/dist/conf/router.rb +0 -22
  156. data/examples/skeleton/dist/conf/upload.conf +0 -5
  157. data/examples/skeleton/dist/schema/migrations/001_add_sessions_table.rb +0 -14
  158. data/examples/skeleton/script/new_migration +0 -21
  159. data/lib/merb/core_ext/merb_string.rb +0 -18
  160. data/lib/merb/merb_controller.rb +0 -206
  161. data/lib/merb/merb_dispatcher.rb +0 -87
  162. data/lib/merb/merb_exceptions.rb +0 -319
  163. data/lib/merb/merb_part_controller.rb +0 -42
  164. data/lib/merb/merb_plugins.rb +0 -293
  165. data/lib/merb/merb_request.rb +0 -165
  166. data/lib/merb/merb_router.rb +0 -309
  167. data/lib/merb/merb_yaml_store.rb +0 -31
  168. data/lib/merb/mixins/render_mixin.rb +0 -283
  169. data/lib/merb/mixins/responder_mixin.rb +0 -159
  170. data/lib/merb/session/merb_ar_session.rb +0 -131
  171. data/lib/merb/vendor/paginator/README.txt +0 -84
  172. data/lib/merb/vendor/paginator/paginator.rb +0 -124
  173. data/lib/tasks/db.rake +0 -55
@@ -1,3 +1,3 @@
1
- # all your other controllers should inherit from this one to share code
1
+ # all your other controllers should inherit from this one to share code.
2
2
  class Application < Merb::Controller
3
3
  end
@@ -0,0 +1,13 @@
1
+ class Exceptions < Application
2
+
3
+ # handle NotFound exceptions (404)
4
+ def not_found
5
+ render :format => :html
6
+ end
7
+
8
+ # handle NotAcceptable exceptions (406)
9
+ def not_acceptable
10
+ render :format => :html
11
+ end
12
+
13
+ end
@@ -0,0 +1,207 @@
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+ <title><%= @exception.name.humanize %></title>
5
+ <style type="text/css" media="screen">
6
+ body {
7
+ font-family:arial;
8
+ font-size:11px;
9
+ }
10
+ h1 {
11
+ font-size:48px;
12
+ letter-spacing:-4px;
13
+ margin:0;
14
+ line-height:36px;
15
+ color:#333;
16
+ }
17
+ h1 sup {
18
+ font-size: 0.5em;
19
+ }
20
+ h1 sup.error_500, h1 sup.error_400 {
21
+ color:#990E05;
22
+ }
23
+ h1 sup.error_100, h1 sup.error_200 {
24
+ color:#00BF10;
25
+ }
26
+ h1 sup.error_300 {
27
+ /* pretty sure you cant 'see' status 300
28
+ errors but if you could I think they
29
+ would be blue */
30
+ color:#1B2099;
31
+ }
32
+ h2 {
33
+ font-size:36px;
34
+ letter-spacing:-3px;
35
+ margin:0;
36
+ line-height:28px;
37
+ color:#444;
38
+ }
39
+ a, a:visited {
40
+ color:#00BF10;
41
+ }
42
+ .internalError {
43
+ width:800px;
44
+ margin:50px auto;
45
+ }
46
+ .header {
47
+ border-bottom:10px solid #333;
48
+ margin-bottom:1px;
49
+ background-image: url("data:image/gif;base64,R0lGODlhAwADAIAAAP///8zMzCH5BAAAAAAALAAAAAADAAMAAAIEBHIJBQA7");
50
+ padding:20px;
51
+ }
52
+ table.trace {
53
+ width:100%;
54
+ font-family:courier, monospace;
55
+ letter-spacing:-1px;
56
+ border-collapse: collapse;
57
+ border-spacing:0;
58
+ }
59
+ table.trace tr td{
60
+ padding:0;
61
+ height:26px;
62
+ font-size:13px;
63
+ vertical-align:middle;
64
+ }
65
+ table.trace tr.file{
66
+ border-top:2px solid #fff;
67
+ background-color:#F3F3F3;
68
+ }
69
+ table.trace tr.source {
70
+ background-color:#F8F8F8;
71
+ display:none;
72
+ }
73
+ table.trace .open tr.source {
74
+ display:table-row;
75
+ }
76
+ table.trace tr.file td.expand {
77
+ width:23px;
78
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAIAAABvSEP3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqMVL+TwUAYxaRIOlEhlZHGDAUzzOQ61+AqXMV1lJSU7q/QRqm8KFUcJTNn5qJkaPyoKKVz7y4mF8na5Kt29tt9+/Z97/u81+vVQ4r9frdarS6Xi7ETDIZisRjxMGPfmk4niNPpZE+xLAugbPaZ53nzvtfMBe/3+/3dbuehBrAKhZdUKkVAWa9Xsiybv0CPZDJZLr/qa5/BwgwRjYqOKIvFYjQa/aNommZh0Ww2K5UqzwfoQOPxaLPZ3FAmk0+7lplMpt1u53J5OpBOR0eZEE9wHJfP5zud93g88QhluwWbjW+5VOmKBgKBer3eaDTDYeGBQF8+x7rqIYoiPgixWJazpA6HA+MSxRArkUgMh0M409g8Ho8+9wYxxCqVSq1W26EDHGM2m4HOHQrEc38f/Yn7cLmlIRhBENzcx8cVRZnPZ/YUep2BWkjTIfA+PKVpZAXR5QxsjiqCKvGEqqp443w+0dvy17swqD0HB3S73V5PpkNg1qBqt8kwGCjmPkinM0QJbIoEa7U6UG6ToVgs4V9G2g0ESoP5Aoi7KYX5oCgf8IKbkvn9/mr1LRQKESamzgJy0g0tSZIuB3nuGqRU9Vv9C4sKkUhEkp4soxvxI8AAhWrrtXa3X8EAAAAASUVORK5CYII=);
79
+ background-position:top left;
80
+ background-repeat:no-repeat;
81
+ }
82
+ table.trace .open tr.file td.expand {
83
+ width:19px;
84
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXZJREFUeNrslK1ywkAUhcMOBomEOiSdqLxEBJX0NaijOsjyHGGmCGyQQYaiiiw4gktkcOmZbpsuuzQ/M5XnqJ2d3S/n3nM3rTzPLUP7/Tt0+pLcGQwG3W53OLyHzPMtjYL7q9UqSRLrD4E1Gj1orCvKYuFHUWTVkOM44/HjDcp8/lL4r6NerzeZPMm1KFw0QkDn83m5fP2lHA4fNQvRtNvtjsfDd0WzmSfb2e/fdTqdOvdh/HLJZLOn0+d2HJ+KRGzbdl23EpFlmed5cp2maRzHQq1lvQ5KMi6EUZBGfup6E1pTfd+vrGW7jbQ2C9hTt9BpqNyIWaAwAy6xg2eBz5iRC/NomiZhGN5sqmnkauo0BUGgVQoBjQ80oCACgNQdZHfTYBkF2mxCtWWAqunWpahxIDUt3QYUxIFQpJHyIWpXjinabKbbwItMHT+NyjchrP8QKaSQQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIKKaSo+hRgAEFD17X08O2NAAAAAElFTkSuQmCC);
85
+ background-position:top left;
86
+ background-repeat:no-repeat;
87
+ }
88
+ table.trace tr.source td.collapse {
89
+ width:19px;
90
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVxJREFUeNrs0zFygkAUBmBlUkgJHdABlQwVkVJKKUxBYWbkALTxMJwhltyDFkss03IF8pudIcwaDaDl/6pd2P327b7d+eHwMXs4lNkzggoVKlSoUKFChQoVKlSoUKFChQoVKlSoUKFChQqVEYqm6ft9+qiSJEkYho7jTlcw2fd9NOI4nq4gEdFwXXe1Cqco63VkWVbXRTqLhTpOwQRpF7quR1E0TgGhqvLKUFCyoQqG/rks3O6kZKW/eRFpevOCoGTXVTcMQ5EyxyDEkML1c5RzuZOICIyXqn7JBVez6282MWrx731HOv2qB8Hri2lamNk0DfpVVdV1Peodappmmua8bdvzuc7zfNprzrLMth1FnGh/X8MjCAIQv/cFz/+65PcDh7rbvYv2ZUfdj+PxsyzLgVl0hKwgTqeqKApx2LeOc7t98zyv/1FWOgvx9RPii23bmL9cetJ8Ed8CDAC6aFW8bCzFhwAAAABJRU5ErkJggg==);
91
+ background-position:bottom left;
92
+ background-repeat:no-repeat;
93
+ background-color:#6F706F;
94
+ }
95
+ table.trace tr td.path {
96
+ padding-left:10px;
97
+ }
98
+ table.trace tr td.code {
99
+ padding-left:35px;
100
+ white-space: pre;
101
+ line-height:9px;
102
+ padding-bottom:10px;
103
+ }
104
+ table.trace tr td.code em {
105
+ font-weight:bold;
106
+ color:#00BF10;
107
+ }
108
+ table.trace tr td.code .more {
109
+ color:#666;
110
+ }
111
+ table.trace tr td.line {
112
+ width:30px;
113
+ text-align:right;
114
+ padding-right:4px;
115
+ }
116
+ .footer {
117
+ margin-top:5px;
118
+ font-size:11px;
119
+ color:#444;
120
+ text-align:right;
121
+ }
122
+ </style>
123
+ </head>
124
+ <body>
125
+ <div class="internalError">
126
+
127
+ <div class="header">
128
+ <h1><%= @exception.name.humanize %> <sup class="error_<%= @exception.class::STATUS %>"><%= @exception.class::STATUS %></sup></h1>
129
+ <% if show_details = ::Merb::Server.config[:exception_details] -%>
130
+ <h2><%= @exception.message %></h2>
131
+ <% else -%>
132
+ <h2>Sorry about that...</h2>
133
+ <% end -%>
134
+ <h3>Parameters</h3>
135
+ <ul>
136
+ <% controller.params[:original_params].each do |param, value| %>
137
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
138
+ <% end %>
139
+ <%= "<li>None</li>" if controller.params[:original_params].empty? %>
140
+ </ul>
141
+
142
+ <h3>Session</h3>
143
+ <ul>
144
+ <% controller.params[:original_session].each do |param, value| %>
145
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
146
+ <% end %>
147
+ <%= "<li>None</li>" if controller.params[:original_session].empty? %>
148
+ </ul>
149
+
150
+ <h3>Cookies</h3>
151
+ <ul>
152
+ <% controller.params[:original_cookies].each do |param, value| %>
153
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
154
+ <% end %>
155
+ <%= "<li>None</li>" if controller.params[:original_cookies].empty? %>
156
+ </ul>
157
+ </div>
158
+
159
+ <% if show_details %>
160
+ <table class="trace">
161
+ <% @exception.backtrace.each_with_index do |line, index| %>
162
+ <tbody class="close">
163
+ <tr class="file">
164
+ <td class="expand">
165
+ </td>
166
+ <td class="path">
167
+ <%= (line.match(/^([^:]+)/)[1] rescue 'unknown').sub(/\/((opt|usr)\/local\/lib\/(ruby\/)?(gems\/)?(1.8\/)?(gems\/)?|.+\/app\/)/, '') %> in "<strong><%= line.match(/:in `(.+)'$/)[1] rescue '?' %></strong>"
168
+ </td>
169
+ <td class="line">
170
+ <a href="txmt://open?url=file://<%=file = (line.match(/^([^:]+)/)[1] rescue 'unknown')%>&amp;line=<%= lineno = line.match(/:([0-9]+):/)[1] rescue '?' %>"><%=lineno%></a>
171
+ </td>
172
+ </tr>
173
+ <tr class="source">
174
+ <td class="collapse">
175
+ </td>
176
+ <td class="code" colspan="2"><% (__caller_lines__(file, lineno, 5) rescue []).each do |llineno, lcode, lcurrent| %>
177
+ <a href="txmt://open?url=file://<%=file%>&amp;line=<%=llineno%>"><%= llineno %></a><%='<em>' if llineno==lineno.to_i %><%= lcode.size > 90 ? lcode[0..90]+'<span class="more">......</span>' : lcode %><%='</em>' if llineno==lineno.to_i %>
178
+ <% end %>
179
+
180
+ </td>
181
+ </tr>
182
+ </tbody>
183
+ <% end %>
184
+ </table>
185
+ <script type="text/javascript" charset="utf-8">
186
+ // swop the open & closed classes
187
+ els = document.getElementsByTagName('td');
188
+ for(i=0; i<els.length; i++){
189
+ if(els[i].className=='expand' || els[i].className=='collapse'){
190
+ els[i].onclick = function(e){
191
+ tbody = this.parentNode.parentNode;
192
+ if(tbody.className=='open'){
193
+ tbody.className='closed';
194
+ }else{
195
+ tbody.className='open';
196
+ }
197
+ }
198
+ }
199
+ }
200
+ </script>
201
+ <% end %>
202
+ <div class="footer">
203
+ lots of love, from <a href="#">merb</a>
204
+ </div>
205
+ </div>
206
+ </body>
207
+ </html>
@@ -0,0 +1,38 @@
1
+ <div id="container">
2
+ <div id="header-container">
3
+ <img src="/images/merb.jpg">
4
+ <!-- <h1>Mongrel + Erb</h1> -->
5
+ <h2>pocket rocket web framework</h2>
6
+ <hr />
7
+ </div>
8
+
9
+ <div id="left-container">
10
+ <h3>Exception:</h3>
11
+ <p><%= params[:exception] %></p>
12
+ </div>
13
+
14
+ <div id="main-container">
15
+ <h3>Why am I seeing this page?</h3>
16
+ <p>Merb couldn't find an appropriate content_type to return,
17
+ based on what you said was available via provides() and
18
+ what the client requested. For more information, visit
19
+ http://merbivore.com/fixing_406_issues
20
+ </p>
21
+
22
+ <h3>Where can I find help?</h3>
23
+ <p>If you have any questions or if you can't figure something out, please take a
24
+ look at our <a href="http://merb.devjavu.com/"> project development page</a> or,
25
+ feel free to come chat at irc.freenode.net, channel #merb.</p>
26
+
27
+ <h3>How do I edit this page?</h3>
28
+ <p>You can change what people see when this happens byy editing <tt>app/views/exceptions/not_found.html.erb</tt>.</p>
29
+
30
+ </div>
31
+
32
+ <div id="footer-container">
33
+ <hr />
34
+ <div class="left"></div>
35
+ <div class="right">&copy; 2007 the merb dev team</div>
36
+ <p>&nbsp;</p>
37
+ </div>
38
+ </div>
@@ -0,0 +1,40 @@
1
+ <div id="container">
2
+ <div id="header-container">
3
+ <img src="/images/merb.jpg">
4
+ <!-- <h1>Mongrel + Erb</h1> -->
5
+ <h2>pocket rocket web framework</h2>
6
+ <hr />
7
+ </div>
8
+
9
+ <div id="left-container">
10
+ <h3>Exception:</h3>
11
+ <p><%= params[:exception] %></p>
12
+ </div>
13
+
14
+ <div id="main-container">
15
+ <h3>Welcome to Merb!</h3>
16
+ <p>Merb is a light-weight MVC framework written in Ruby. We hope you enjoy it.</p>
17
+
18
+ <h3>Where can I find help?</h3>
19
+ <p>If you have any questions or if you can't figure something out, please take a
20
+ look at our <a href="http://merb.devjavu.com/"> project development page</a> or,
21
+ feel free to come chat at irc.freenode.net, channel #merb.</p>
22
+
23
+ <h3>How do I edit this page?</h3>
24
+ <p>You're seeing this page because you need to edit the following files:
25
+ <ul>
26
+ <li>config/merb.yml <strong><em>(optional)</em></strong></li>
27
+ <li>config/router.rb <strong><em>(recommended)</em></strong></li>
28
+ <li>app/views/exceptions/not_found.html.erb <strong><em>(recommended)</em></strong></li>
29
+ <li>app/views/layout/application.html.erb <strong><em>(change this layout)</em></strong></li>
30
+ </ul>
31
+ </p>
32
+ </div>
33
+
34
+ <div id="footer-container">
35
+ <hr />
36
+ <div class="left"></div>
37
+ <div class="right">&copy; 2007 the merb dev team</div>
38
+ <p>&nbsp;</p>
39
+ </div>
40
+ </div>
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <title>Fresh Merb App</title>
5
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
6
+ <link rel="stylesheet" href="/stylesheets/master.css" type="text/css" media="screen" charset="utf-8">
7
+ </head>
8
+ <body>
9
+ <%= catch_content :layout %>
10
+ </body>
11
+ </html>
@@ -0,0 +1,11 @@
1
+ frozen_framework_path = File.join(File.dirname(__FILE__), "..", "framework")
2
+
3
+ unless defined?(MERB_FRAMEWORK_ROOT)
4
+ if File.directory?(frozen_framework_path)
5
+ $:.unshift frozen_framework_path
6
+ require File.join(frozen_framework_path, "merb")
7
+ else
8
+ require 'rubygems' # required for test_unit loading
9
+ require 'merb'
10
+ end
11
+ end
@@ -0,0 +1,41 @@
1
+ # Make the app's "gems" directory a place where gems are loaded from
2
+ Gem.clear_paths
3
+ Gem.path.unshift(MERB_ROOT / "gems")
4
+
5
+ # Make the app's "lib" directory a place where ruby files get "require"d from
6
+ $LOAD_PATH.unshift(MERB_ROOT / "lib")
7
+
8
+ ### Merb doesn't come with database support by default. You need
9
+ ### an ORM plugin. Install one, and uncomment one of the following lines,
10
+ ### if you need a database.
11
+
12
+ ### Uncomment for DataMapper ORM
13
+ # use_orm :datamapper
14
+
15
+ ### Uncomment for ActiveRecord ORM
16
+ # use_orm :activerecord
17
+
18
+ ### Uncomment for Sequel ORM
19
+ # use_orm :sequel
20
+
21
+
22
+ ### This defines which test framework the generators will use
23
+ ### rspec is turned on by default
24
+ # use_test :test_unit
25
+ use_test :rspec
26
+
27
+ ### Add your other dependencies here
28
+
29
+ # These are some examples of how you might specify dependencies.
30
+ #
31
+ # dependencies "RedCloth", "merb-form-helpers"
32
+ # OR
33
+ # dependency "RedCloth", "> 3.0"
34
+ # OR
35
+ # dependencies "RedCloth" => "> 3.0", "ruby-aes-cext" => "= 1.0"
36
+
37
+ Merb::Server.after_app_loads do
38
+ ### Add dependencies here that must load after the application loads:
39
+
40
+ # dependency "magic_admin" # this gem uses the app's model classes
41
+ end
@@ -0,0 +1,64 @@
1
+ ---
2
+ # Hostname or IP address to bind to.
3
+ :host: 0.0.0.0
4
+
5
+ # Port merb runs on or starting port for merb cluster.
6
+ :port: "4000"
7
+
8
+ # Set if your app will be hosted in some dir other than the root
9
+ #:path_prefix: "/my_app"
10
+
11
+ # In development mode your app's files are reloaded whenever Merb detects a
12
+ # change. Templates are parsed each time and not cached. In production mode
13
+ # templates are cached, as well as all your classes
14
+ :environment: development
15
+
16
+ # Uncomment if you have more than one ORM or if you need to be specific about
17
+ # which memory store to use. Built-in options are: memory, cookie, or mem_cache
18
+ #:session_store: sequel
19
+
20
+ #:memory_session_ttl: 3600 # one hour
21
+
22
+ # A secret key is required when using the 'cookie' session store (default),
23
+ # change this value to something unique to your application and keep it private
24
+ :session_secret_key: <%= key %>
25
+
26
+ # Uncomment to use the merb upload progress. The 'path match' will be treated as
27
+ # a regex for any URLs that should be considered for upload monitoring.
28
+ #:upload_path_match: /files/\d
29
+ #:upload_frequency: 3
30
+
31
+ # Uncomment to cache templates in dev mode. Templates are cached
32
+ # automatically in production mode.
33
+ #:cache_templates: true
34
+
35
+ # Uncomment and set this if you want to run a drb server for upload progress
36
+ # or other drb services.
37
+ #:drb_server_port: 32323
38
+
39
+ # If you want to protect some or all of your app with HTTP basic auth then
40
+ # uncomment the following and fill in your credentials you want it to use.
41
+ # You will then need to set a 'before' filter in a controller. For example:
42
+ # before :basic_authentication
43
+ #:basic_auth:
44
+ # :username: ezra
45
+ # :password: test
46
+ # :domain: localhost
47
+
48
+ # Uncomment this if you want merb to daemonize when you start it. You can also
49
+ # just use merb -d for the same effect. Don't uncomment this if you use the
50
+ # cluster option.
51
+ #:daemonize: true
52
+
53
+ # Uncomment this to set the number of members in your merb cluster. Don't set
54
+ # this and :daemonize: at the same time.
55
+ #:cluster: 3
56
+
57
+ # Uncomment this if you want to force merb to show full InternalServerError
58
+ # details, even when in production mode
59
+ #:exception_details: true
60
+
61
+ # It is often useful to use a differant layout from 'application' for errors
62
+ # set this to the layout template (or :none) that you want to use by default
63
+ #:exception_layout: :none
64
+