merb 0.5.3 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (294) hide show
  1. data/LICENSE +0 -20
  2. data/README +0 -277
  3. data/Rakefile +80 -199
  4. data/TODO +0 -3
  5. metadata +19 -438
  6. data/SVN_REVISION +0 -1
  7. data/app_generators/merb/USAGE +0 -5
  8. data/app_generators/merb/merb_generator.rb +0 -108
  9. data/app_generators/merb/templates/Rakefile +0 -124
  10. data/app_generators/merb/templates/app/controllers/application.rb +0 -3
  11. data/app_generators/merb/templates/app/controllers/exceptions.rb +0 -13
  12. data/app_generators/merb/templates/app/helpers/global_helper.rb +0 -5
  13. data/app_generators/merb/templates/app/mailers/views/layout/application.html.erb +0 -1
  14. data/app_generators/merb/templates/app/mailers/views/layout/application.text.erb +0 -1
  15. data/app_generators/merb/templates/app/parts/views/layout/application.html.erb +0 -1
  16. data/app_generators/merb/templates/app/views/exceptions/internal_server_error.html.erb +0 -216
  17. data/app_generators/merb/templates/app/views/exceptions/not_acceptable.html.erb +0 -38
  18. data/app_generators/merb/templates/app/views/exceptions/not_found.html.erb +0 -40
  19. data/app_generators/merb/templates/app/views/layout/application.html.erb +0 -11
  20. data/app_generators/merb/templates/config/boot.rb +0 -11
  21. data/app_generators/merb/templates/config/dependencies.rb +0 -41
  22. data/app_generators/merb/templates/config/environments/development.rb +0 -1
  23. data/app_generators/merb/templates/config/environments/production.rb +0 -1
  24. data/app_generators/merb/templates/config/environments/test.rb +0 -1
  25. data/app_generators/merb/templates/config/merb.yml +0 -82
  26. data/app_generators/merb/templates/config/merb_init.rb +0 -17
  27. data/app_generators/merb/templates/config/plugins.yml +0 -1
  28. data/app_generators/merb/templates/config/router.rb +0 -35
  29. data/app_generators/merb/templates/config/upload.conf +0 -0
  30. data/app_generators/merb/templates/public/images/merb.jpg +0 -0
  31. data/app_generators/merb/templates/public/merb.fcgi +0 -6
  32. data/app_generators/merb/templates/public/stylesheets/master.css +0 -119
  33. data/app_generators/merb/templates/script/destroy +0 -32
  34. data/app_generators/merb/templates/script/generate +0 -32
  35. data/app_generators/merb/templates/script/stop_merb +0 -13
  36. data/app_generators/merb/templates/script/win_script.cmd +0 -1
  37. data/app_generators/merb/templates/spec/spec.opts +0 -6
  38. data/app_generators/merb/templates/spec/spec_helper.rb +0 -15
  39. data/app_generators/merb/templates/test/test_helper.rb +0 -14
  40. data/app_generators/merb_plugin/USAGE +0 -5
  41. data/app_generators/merb_plugin/merb_plugin_generator.rb +0 -68
  42. data/app_generators/merb_plugin/templates/LICENSE +0 -20
  43. data/app_generators/merb_plugin/templates/README +0 -4
  44. data/app_generators/merb_plugin/templates/Rakefile +0 -35
  45. data/app_generators/merb_plugin/templates/TODO +0 -5
  46. data/app_generators/merb_plugin/templates/merbtasks.rb +0 -6
  47. data/app_generators/merb_plugin/templates/sampleplugin.rb +0 -10
  48. data/app_generators/merb_plugin/templates/sampleplugin_spec.rb +0 -7
  49. data/app_generators/merb_plugin/templates/spec_helper.rb +0 -2
  50. data/bin/merb +0 -4
  51. data/lib/autotest/discover.rb +0 -3
  52. data/lib/autotest/merb_rspec.rb +0 -80
  53. data/lib/merb.rb +0 -188
  54. data/lib/merb/abstract_controller.rb +0 -399
  55. data/lib/merb/assets.rb +0 -160
  56. data/lib/merb/assets.rb.orig +0 -119
  57. data/lib/merb/boot_loader.rb +0 -286
  58. data/lib/merb/boot_loader.rb.orig +0 -235
  59. data/lib/merb/caching.rb +0 -5
  60. data/lib/merb/caching/action_cache.rb +0 -92
  61. data/lib/merb/caching/fragment_cache.rb +0 -39
  62. data/lib/merb/caching/store/file_cache.rb +0 -90
  63. data/lib/merb/caching/store/memory_cache.rb +0 -85
  64. data/lib/merb/config.rb +0 -290
  65. data/lib/merb/constants.rb +0 -50
  66. data/lib/merb/controller.rb +0 -220
  67. data/lib/merb/cookies.rb +0 -95
  68. data/lib/merb/core_ext.rb +0 -15
  69. data/lib/merb/core_ext/array.rb +0 -0
  70. data/lib/merb/core_ext/class.rb +0 -180
  71. data/lib/merb/core_ext/enumerable.rb +0 -49
  72. data/lib/merb/core_ext/get_args.rb +0 -76
  73. data/lib/merb/core_ext/hash.rb +0 -306
  74. data/lib/merb/core_ext/inflections.rb +0 -112
  75. data/lib/merb/core_ext/inflector.rb +0 -275
  76. data/lib/merb/core_ext/kernel.rb +0 -242
  77. data/lib/merb/core_ext/mash.rb +0 -88
  78. data/lib/merb/core_ext/module.rb +0 -67
  79. data/lib/merb/core_ext/numeric.rb +0 -72
  80. data/lib/merb/core_ext/object.rb +0 -183
  81. data/lib/merb/core_ext/string.rb +0 -53
  82. data/lib/merb/core_ext/symbol.rb +0 -6
  83. data/lib/merb/dispatcher.rb +0 -109
  84. data/lib/merb/drb_server.rb +0 -19
  85. data/lib/merb/erubis_ext.rb +0 -10
  86. data/lib/merb/exceptions.rb +0 -192
  87. data/lib/merb/generators/merb_app/merb_app.rb +0 -22
  88. data/lib/merb/generators/merb_generator_helpers.rb +0 -318
  89. data/lib/merb/generators/merb_plugin.rb +0 -22
  90. data/lib/merb/logger.rb +0 -78
  91. data/lib/merb/mail_controller.rb +0 -268
  92. data/lib/merb/mailer.rb +0 -87
  93. data/lib/merb/mixins/basic_authentication.rb +0 -35
  94. data/lib/merb/mixins/controller.rb +0 -160
  95. data/lib/merb/mixins/erubis_capture.rb +0 -68
  96. data/lib/merb/mixins/general_controller.rb +0 -253
  97. data/lib/merb/mixins/inline_partial.rb +0 -32
  98. data/lib/merb/mixins/render.rb +0 -465
  99. data/lib/merb/mixins/responder.rb +0 -449
  100. data/lib/merb/mixins/view_context.rb +0 -558
  101. data/lib/merb/mixins/web_controller.rb +0 -36
  102. data/lib/merb/mongrel_handler.rb +0 -168
  103. data/lib/merb/part_controller.rb +0 -29
  104. data/lib/merb/plugins.rb +0 -16
  105. data/lib/merb/rack_adapter.rb +0 -37
  106. data/lib/merb/request.rb +0 -465
  107. data/lib/merb/router.rb +0 -646
  108. data/lib/merb/server.rb +0 -169
  109. data/lib/merb/session.rb +0 -23
  110. data/lib/merb/session/cookie_store.rb +0 -118
  111. data/lib/merb/session/mem_cache_session.rb +0 -131
  112. data/lib/merb/session/memory_session.rb +0 -176
  113. data/lib/merb/template.rb +0 -37
  114. data/lib/merb/template/erubis.rb +0 -68
  115. data/lib/merb/template/haml.rb +0 -87
  116. data/lib/merb/template/markaby.rb +0 -59
  117. data/lib/merb/template/xml_builder.rb +0 -50
  118. data/lib/merb/test/fake_request.rb +0 -74
  119. data/lib/merb/test/helper.rb +0 -260
  120. data/lib/merb/test/hpricot.rb +0 -136
  121. data/lib/merb/test/multipart.rb +0 -66
  122. data/lib/merb/test/rspec.rb +0 -18
  123. data/lib/merb/test/rspec_matchers/controller_matchers.rb +0 -117
  124. data/lib/merb/test/rspec_matchers/markup_matchers.rb +0 -98
  125. data/lib/merb/upload_handler.rb +0 -80
  126. data/lib/merb/upload_progress.rb +0 -48
  127. data/lib/merb/version.rb +0 -49
  128. data/lib/merb/view_context.rb +0 -79
  129. data/lib/tasks.rb +0 -7
  130. data/lib/tasks/merb.rake +0 -54
  131. data/merb_default_generators/model/USAGE +0 -0
  132. data/merb_default_generators/model/model_generator.rb +0 -16
  133. data/merb_default_generators/model/templates/new_model_template.erb +0 -5
  134. data/merb_default_generators/resource_controller/USAGE +0 -0
  135. data/merb_default_generators/resource_controller/resource_controller_generator.rb +0 -26
  136. data/merb_default_generators/resource_controller/templates/controller.rb +0 -30
  137. data/merb_default_generators/resource_controller/templates/edit.html.erb +0 -1
  138. data/merb_default_generators/resource_controller/templates/helper.rb +0 -5
  139. data/merb_default_generators/resource_controller/templates/index.html.erb +0 -1
  140. data/merb_default_generators/resource_controller/templates/new.html.erb +0 -1
  141. data/merb_default_generators/resource_controller/templates/show.html.erb +0 -1
  142. data/merb_generators/controller/USAGE +0 -5
  143. data/merb_generators/controller/controller_generator.rb +0 -16
  144. data/merb_generators/controller/templates/controller.rb +0 -8
  145. data/merb_generators/controller/templates/helper.rb +0 -5
  146. data/merb_generators/controller/templates/index.html.erb +0 -3
  147. data/merb_generators/part_controller/USAGE +0 -5
  148. data/merb_generators/part_controller/part_controller_generator.rb +0 -27
  149. data/merb_generators/part_controller/templates/controller.rb +0 -8
  150. data/merb_generators/part_controller/templates/helper.rb +0 -5
  151. data/merb_generators/part_controller/templates/index.html.erb +0 -3
  152. data/merb_generators/resource/USAGE +0 -0
  153. data/merb_generators/resource/resource_generator.rb +0 -67
  154. data/rspec_generators/merb_controller_test/merb_controller_test_generator.rb +0 -67
  155. data/rspec_generators/merb_controller_test/templates/controller_spec.rb +0 -8
  156. data/rspec_generators/merb_controller_test/templates/edit_spec.rb +0 -12
  157. data/rspec_generators/merb_controller_test/templates/helper_spec.rb +0 -5
  158. data/rspec_generators/merb_controller_test/templates/index_spec.rb +0 -12
  159. data/rspec_generators/merb_controller_test/templates/new_spec.rb +0 -12
  160. data/rspec_generators/merb_controller_test/templates/show_spec.rb +0 -5
  161. data/rspec_generators/merb_model_test/merb_model_test_generator.rb +0 -26
  162. data/rspec_generators/merb_model_test/templates/model_spec_template.erb +0 -7
  163. data/script/destroy +0 -14
  164. data/script/generate +0 -14
  165. data/spec/fixtures/config/environments/environment_config_test.yml +0 -1
  166. data/spec/fixtures/config/merb.yml +0 -18
  167. data/spec/fixtures/controllers/dispatch_spec_controllers.rb +0 -235
  168. data/spec/fixtures/controllers/render_spec_controllers.rb +0 -184
  169. data/spec/fixtures/foo.rb +0 -3
  170. data/spec/fixtures/mailers/views/layout/application.html.erb +0 -3
  171. data/spec/fixtures/mailers/views/layout/application.text.erb +0 -3
  172. data/spec/fixtures/mailers/views/test_mail_controller/eighth.html.erb +0 -1
  173. data/spec/fixtures/mailers/views/test_mail_controller/eighth.text.erb +0 -1
  174. data/spec/fixtures/mailers/views/test_mail_controller/first.html.erb +0 -1
  175. data/spec/fixtures/mailers/views/test_mail_controller/first.text.erb +0 -1
  176. data/spec/fixtures/mailers/views/test_mail_controller/ninth.html.erb +0 -1
  177. data/spec/fixtures/mailers/views/test_mail_controller/ninth.text.erb +0 -1
  178. data/spec/fixtures/mailers/views/test_mail_controller/second.text.erb +0 -1
  179. data/spec/fixtures/mailers/views/test_mail_controller/third.html.erb +0 -1
  180. data/spec/fixtures/models/router_spec_models.rb +0 -30
  181. data/spec/fixtures/parts/views/layout/todo_part.html.erb +0 -3
  182. data/spec/fixtures/parts/views/layout/todo_part.xml.erb +0 -3
  183. data/spec/fixtures/parts/views/todo_part/formatted_output.html.erb +0 -1
  184. data/spec/fixtures/parts/views/todo_part/formatted_output.js.erb +0 -1
  185. data/spec/fixtures/parts/views/todo_part/formatted_output.xml.erb +0 -1
  186. data/spec/fixtures/parts/views/todo_part/list.html.erb +0 -3
  187. data/spec/fixtures/sample.txt +0 -1
  188. data/spec/fixtures/views/erubis.html.erb +0 -1
  189. data/spec/fixtures/views/examples/_erubis.html.erb +0 -1
  190. data/spec/fixtures/views/examples/_haml.html.haml +0 -1
  191. data/spec/fixtures/views/examples/_markaby.html.mab +0 -1
  192. data/spec/fixtures/views/examples/_throw_content.html.erb +0 -6
  193. data/spec/fixtures/views/examples/hello.xml.builder +0 -1
  194. data/spec/fixtures/views/examples/js.js.erb +0 -1
  195. data/spec/fixtures/views/examples/template_catch_content.html.erb +0 -15
  196. data/spec/fixtures/views/examples/template_catch_content_from_partial.html.erb +0 -6
  197. data/spec/fixtures/views/examples/template_throw_content.html.erb +0 -10
  198. data/spec/fixtures/views/examples/template_throw_content_without_block.html.erb +0 -3
  199. data/spec/fixtures/views/exceptions/admin_access_required.html.erb +0 -1
  200. data/spec/fixtures/views/extension_template_controller/_nested_js.js.erb +0 -1
  201. data/spec/fixtures/views/extension_template_controller/_nested_xml.xml.erb +0 -1
  202. data/spec/fixtures/views/extension_template_controller/_render_partial_multiple_times.html.erb +0 -1
  203. data/spec/fixtures/views/extension_template_controller/erubis_templates.html.erb +0 -1
  204. data/spec/fixtures/views/extension_template_controller/erubis_templates.js.erb +0 -1
  205. data/spec/fixtures/views/extension_template_controller/erubis_templates.rhtml +0 -1
  206. data/spec/fixtures/views/extension_template_controller/erubis_templates.xml.erb +0 -1
  207. data/spec/fixtures/views/extension_template_controller/haml_index.html.haml +0 -0
  208. data/spec/fixtures/views/extension_template_controller/haml_templates.html.haml +0 -1
  209. data/spec/fixtures/views/extension_template_controller/haml_templates.js.haml +0 -1
  210. data/spec/fixtures/views/extension_template_controller/haml_templates.xml.haml +0 -1
  211. data/spec/fixtures/views/extension_template_controller/index.html.erb +0 -0
  212. data/spec/fixtures/views/extension_template_controller/markaby_index.html.mab +0 -0
  213. data/spec/fixtures/views/extension_template_controller/markaby_templates.html.mab +0 -1
  214. data/spec/fixtures/views/extension_template_controller/markaby_templates.js.mab +0 -1
  215. data/spec/fixtures/views/extension_template_controller/markaby_templates.xml.mab +0 -1
  216. data/spec/fixtures/views/extension_template_controller/render_multiple_partials.html.erb +0 -4
  217. data/spec/fixtures/views/extension_template_controller/render_nested_js.js.erb +0 -1
  218. data/spec/fixtures/views/extension_template_controller/render_nested_xml.xml.erb +0 -1
  219. data/spec/fixtures/views/haml.html.haml +0 -1
  220. data/spec/fixtures/views/haml.xml.haml +0 -2
  221. data/spec/fixtures/views/layout/application.html.erb +0 -1
  222. data/spec/fixtures/views/layout/application.xml.erb +0 -1
  223. data/spec/fixtures/views/layout/nested/example.html.erb +0 -1
  224. data/spec/fixtures/views/markaby.html.mab +0 -1
  225. data/spec/fixtures/views/nested/example/test.html.erb +0 -1
  226. data/spec/fixtures/views/partials/_erubis.html.erb +0 -1
  227. data/spec/fixtures/views/partials/_erubis_collection.html.erb +0 -1
  228. data/spec/fixtures/views/partials/_erubis_collection_with_locals.html.erb +0 -1
  229. data/spec/fixtures/views/partials/_erubis_new.html.erb +0 -1
  230. data/spec/fixtures/views/partials/_haml.html.haml +0 -1
  231. data/spec/fixtures/views/partials/_haml_collection.html.haml +0 -1
  232. data/spec/fixtures/views/partials/_haml_collection_with_locals.html.haml +0 -1
  233. data/spec/fixtures/views/partials/_haml_new.html.haml +0 -1
  234. data/spec/fixtures/views/partials/_markaby.html.mab +0 -1
  235. data/spec/fixtures/views/partials/_markaby_collection.html.mab +0 -1
  236. data/spec/fixtures/views/partials/_markaby_collection_with_locals.html.mab +0 -1
  237. data/spec/fixtures/views/partials/_markaby_new.html.mab +0 -1
  238. data/spec/fixtures/views/render_object_controller/render_object_with_template.html.erb +0 -1
  239. data/spec/fixtures/views/render_object_controller/render_object_with_template.js.erb +0 -1
  240. data/spec/fixtures/views/render_object_controller/render_object_with_template.xml.erb +0 -1
  241. data/spec/fixtures/views/template_views/interface__buffer_erubis.html.erb +0 -4
  242. data/spec/fixtures/views/template_views/interface__buffer_haml.html.haml +0 -7
  243. data/spec/fixtures/views/template_views/interface__buffer_markaby.html.mab +0 -7
  244. data/spec/fixtures/views/template_views/interface_capture_erubis.html.erb +0 -15
  245. data/spec/fixtures/views/template_views/interface_capture_haml.html.haml +0 -15
  246. data/spec/fixtures/views/template_views/interface_capture_markaby.html.mab +0 -4
  247. data/spec/fixtures/views/template_views/interface_concat_erubis.html.erb +0 -12
  248. data/spec/fixtures/views/template_views/interface_concat_haml.html.haml +0 -11
  249. data/spec/fixtures/views/template_views/interface_concat_markaby.html.mab +0 -14
  250. data/spec/fixtures/views/test.dir/the_template.html.erb +0 -1
  251. data/spec/merb/abstract_controller_spec.rb +0 -38
  252. data/spec/merb/assets_spec.rb +0 -207
  253. data/spec/merb/caching_spec.rb +0 -102
  254. data/spec/merb/config_spec.rb +0 -29
  255. data/spec/merb/controller_filters_spec.rb +0 -253
  256. data/spec/merb/controller_spec.rb +0 -126
  257. data/spec/merb/cookie_store_spec.rb +0 -72
  258. data/spec/merb/cookies_spec.rb +0 -96
  259. data/spec/merb/core_ext/class_spec.rb +0 -97
  260. data/spec/merb/core_ext/enumerable_spec.rb +0 -27
  261. data/spec/merb/core_ext/hash_spec.rb +0 -251
  262. data/spec/merb/core_ext/inflector_spec.rb +0 -34
  263. data/spec/merb/core_ext/kernel_spec.rb +0 -25
  264. data/spec/merb/core_ext/numeric_spec.rb +0 -26
  265. data/spec/merb/core_ext/object_spec.rb +0 -47
  266. data/spec/merb/core_ext/string_spec.rb +0 -22
  267. data/spec/merb/core_ext/symbol_spec.rb +0 -7
  268. data/spec/merb/dependency_spec.rb +0 -22
  269. data/spec/merb/dispatch_spec.rb +0 -528
  270. data/spec/merb/fake_request_spec.rb +0 -80
  271. data/spec/merb/generator_spec.rb +0 -248
  272. data/spec/merb/handler_spec.rb +0 -169
  273. data/spec/merb/mail_controller_spec.rb +0 -177
  274. data/spec/merb/mailer_spec.rb +0 -87
  275. data/spec/merb/multipart_spec.rb +0 -50
  276. data/spec/merb/part_controller_spec.rb +0 -124
  277. data/spec/merb/plugins_spec.rb +0 -80
  278. data/spec/merb/render_spec.rb +0 -469
  279. data/spec/merb/request_spec.rb +0 -287
  280. data/spec/merb/responder_spec.rb +0 -562
  281. data/spec/merb/router_spec.rb +0 -900
  282. data/spec/merb/server_spec.rb +0 -19
  283. data/spec/merb/template_spec.rb +0 -41
  284. data/spec/merb/upload_handler_spec.rb +0 -108
  285. data/spec/merb/version_spec.rb +0 -33
  286. data/spec/merb/view_context_spec.rb +0 -366
  287. data/spec/spec_generator_helper.rb +0 -34
  288. data/spec/spec_helper.rb +0 -101
  289. data/spec/spec_helpers/url_shared_behaviour.rb +0 -112
  290. data/test_unit_generators/merb_controller_test/merb_controller_test_generator.rb +0 -53
  291. data/test_unit_generators/merb_controller_test/templates/functional_test.rb +0 -17
  292. data/test_unit_generators/merb_controller_test/templates/helper_test.rb +0 -9
  293. data/test_unit_generators/merb_model_test/merb_model_test_generator.rb +0 -29
  294. data/test_unit_generators/merb_model_test/templates/model_test_unit_template.erb +0 -9
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
-
4
- # required to overcome a callback in rspec
5
- def at_exit
6
- end
7
-
8
- begin
9
- require 'rubigen'
10
- rescue LoadError
11
- require 'rubygems'
12
- require 'rubigen'
13
- end
14
-
15
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
16
- require File.join(Merb.root, 'config', 'dependencies')
17
- module Kernel
18
- undef dependency if defined?(Kernel.dependency)
19
- end
20
-
21
- # Make the App's local gems available
22
- Gem.clear_paths
23
- Gem.path.unshift(APP_ROOT / "gems")
24
-
25
- require 'rubigen/scripts/generate'
26
-
27
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
28
-
29
- # Default is to use rspec generators in gems. To change this to
30
- # Test::Unit use [:merb, :test_unit]
31
- RubiGen::Base.use_component_sources! Merb::GENERATOR_SCOPE
32
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'fileutils'
3
-
4
- pids=[]
5
-
6
- port_or_star = ARGV[0] || '*'
7
-
8
- Dir[File.dirname(__FILE__)+"/../log/merb.#{port_or_star}.pid"].each do |f|
9
- pid = IO.read(f).chomp.to_i
10
- puts "killing PID: #{pid}"
11
- Process.kill(9, pid)
12
- FileUtils.rm f
13
- end
@@ -1 +0,0 @@
1
- @ruby <%= File.join("script", filename) %> %*
@@ -1,6 +0,0 @@
1
- --colour
2
- --format
3
- progress
4
- --timeout
5
- 20
6
- --diff
@@ -1,15 +0,0 @@
1
- $TESTING=true
2
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
3
- Merb.environment="test"
4
- require File.join(Merb.root, 'config', 'merb_init')
5
-
6
- require 'merb/test/helper'
7
- require 'merb/test/rspec'
8
-
9
- Spec::Runner.configure do |config|
10
- config.include(Merb::Test::Helper)
11
- config.include(Merb::Test::RspecMatchers)
12
- end
13
-
14
-
15
- ### METHODS BELOW THIS LINE SHOULD BE EXTRACTED TO MERB ITSELF
@@ -1,14 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
2
-
3
- $TESTING=true
4
-
5
- require 'rubygems'
6
- require 'test/unit'
7
- require File.join(Merb.root, 'config', 'merb_init')
8
-
9
- require 'merb/test/helper'
10
-
11
- class Test::Unit::TestCase
12
- include Merb::Test::Helper
13
- # Add more helper methods to be used by all tests here...
14
- end
@@ -1,5 +0,0 @@
1
- Description:
2
-
3
-
4
- Usage:
5
-
@@ -1,68 +0,0 @@
1
- class MerbPluginGenerator < RubiGen::Base
2
- attr_reader :name
3
-
4
- DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'],
5
- Config::CONFIG['ruby_install_name'])
6
-
7
- default_options :shebang => DEFAULT_SHEBANG
8
-
9
-
10
- def initialize(args, runtime_options = {})
11
- super
12
- usage if args.empty?
13
- @name = args.shift.gsub(/-/,"_")
14
- @destination_root = File.expand_path(@name)
15
- extract_options
16
- end
17
-
18
- def manifest
19
- record do |m|
20
- # Ensure appropriate folder(s) exists
21
- m.directory ''
22
- m.directory "lib/#{name}"
23
- m.directory "spec"
24
-
25
- m.template "Rakefile", "Rakefile", :assigns => {:name => name}
26
- m.template "README", "README", :assigns => {:name => name}
27
-
28
- m.template "LICENSE", "LICENSE"
29
- m.template "TODO", "TODO", :assigns => {:name => name}
30
-
31
- m.file "spec_helper.rb", "spec/spec_helper.rb"
32
-
33
- m.template "sampleplugin_spec.rb", "spec/#{name}_spec.rb", :assigns => {:name => name}
34
- m.template "sampleplugin.rb", "lib/#{name}.rb", :assigns => {:name => name}
35
- m.template "merbtasks.rb", "lib/#{name}/merbtasks.rb", :assigns => {:name => name}
36
-
37
- m.dependency "install_rubigen_scripts", [destination_root, "rubygems"], :shebang => options[:shebang]
38
- end
39
- end
40
-
41
- protected
42
- def banner
43
- <<-EOS
44
- Creates a Merb plugin stub.
45
-
46
- USAGE: #{spec.name} --generate-plugin path"
47
- EOS
48
- end
49
-
50
- def add_options!(opts)
51
- # opts.separator ''
52
- # opts.separator 'Options:'
53
- # # For each option below, place the default
54
- # # at the top of the file next to "default_options"
55
- # opts.on("-r", "--ruby=path", String,
56
- # "Path to the Ruby binary of your choice (otherwise scripts use env, dispatchers current path).",
57
- # "Default: #{DEFAULT_SHEBANG}") { |options[:shebang]| }
58
- # opts.on("-v", "--version", "Show the #{File.basename($0)} version number and quit.")
59
- end
60
-
61
- def extract_options
62
- # for each option, extract it into a local variable (and create an "attr_reader :author" at the top)
63
- # Templates can access these value via the attr_reader-generated methods, but not the
64
- # raw instance variable value.
65
- # @author = options[:author]
66
- end
67
-
68
- end
@@ -1,20 +0,0 @@
1
- Copyright (c) <%= Time.now.year %> YOUR NAME
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,4 +0,0 @@
1
- <%= name %>
2
- =================
3
-
4
- A plugin for the Merb framework that provides ....
@@ -1,35 +0,0 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
-
4
- PLUGIN = "<%= name %>"
5
- NAME = "<%= name %>"
6
- VERSION = "0.0.1"
7
- AUTHOR = "Your Name"
8
- EMAIL = "Your Email"
9
- HOMEPAGE = "http://merb-plugins.rubyforge.org/<%= name %>/"
10
- SUMMARY = "Merb plugin that provides ..."
11
-
12
- spec = Gem::Specification.new do |s|
13
- s.name = NAME
14
- s.version = VERSION
15
- s.platform = Gem::Platform::RUBY
16
- s.has_rdoc = true
17
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
18
- s.summary = SUMMARY
19
- s.description = s.summary
20
- s.author = AUTHOR
21
- s.email = EMAIL
22
- s.homepage = HOMEPAGE
23
- s.add_dependency('merb', '>= 0.4.0')
24
- s.require_path = 'lib'
25
- s.autorequire = PLUGIN
26
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
27
- end
28
-
29
- Rake::GemPackageTask.new(spec) do |pkg|
30
- pkg.gem_spec = spec
31
- end
32
-
33
- task :install => [:package] do
34
- sh %{sudo gem install pkg/#{NAME}-#{VERSION}}
35
- end
@@ -1,5 +0,0 @@
1
- TODO:
2
- Fix LICENSE with your name
3
- Fix Rakefile with your name and contact info
4
- Add your code to lib/<%= name %>.rb
5
- Add your Merb rake tasks to lib/<%= name %>/merbtasks.rb
@@ -1,6 +0,0 @@
1
- namespace :<%= name %> do
2
- desc "Do something for <%= name %>"
3
- task :default do
4
- puts "<%= name %> doesn't do anything"
5
- end
6
- end
@@ -1,10 +0,0 @@
1
- # make sure we're running inside Merb
2
- if defined?(Merb::Plugins)
3
-
4
- # Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
5
- Merb::Plugins.config[:<%= name %>] = {
6
- :chickens => false
7
- }
8
-
9
- Merb::Plugins.add_rakefiles "<%= name %>/merbtasks"
10
- end
@@ -1,7 +0,0 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
2
-
3
- describe "<%= name %>" do
4
- it "should do nothing" do
5
- true.should == true
6
- end
7
- end
@@ -1,2 +0,0 @@
1
- $TESTING=true
2
- $:.push File.join(File.dirname(__FILE__), '..', 'lib')
data/bin/merb DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'rubygems'
3
- require 'merb/server'
4
- Merb::Server.run
@@ -1,3 +0,0 @@
1
- Autotest.add_discovery do
2
- "merb" if File.exist?('config/merb_init.rb')
3
- end
@@ -1,80 +0,0 @@
1
- # based on rails_rspec.rb from rspec_on_rails by Nick Sieger
2
-
3
- ### rspec_on_rails (c) Copyright 2006 Nick Sieger <nicksieger@gmail.com>
4
- ###
5
- ### Permission is hereby granted, free of charge, to any person
6
- ### obtaining a copy of this software and associated documentation files
7
- ### (the "Software"), to deal in the Software without restriction,
8
- ### including without limitation the rights to use, copy, modify, merge,
9
- ### publish, distribute, sublicense, and/or sell copies of the Software,
10
- ### and to permit persons to whom the Software is furnished to do so,
11
- ### subject to the following conditions:
12
- ###
13
- ### The above copyright notice and this permission notice shall be
14
- ### included in all copies or substantial portions of the Software.
15
- ###
16
- ### THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- ### EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- ### MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- ### NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20
- ### BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21
- ### ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22
- ### CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- ### SOFTWARE.
24
-
25
- require 'autotest/rspec'
26
- require 'merb/core_ext/inflector'
27
-
28
- class Autotest::MerbRspec < Autotest::Rspec
29
-
30
- def initialize # :nodoc:
31
- super
32
- @exceptions = %r%^\./(?:coverage|gems|doc|log|public|schema|script|previous_failures.txt)%
33
- @test_mappings = {
34
- %r%^(test|spec)/fixtures/(.*).yml$% => proc { |_, m|
35
- ["spec/models/#{m[2].singularize}_spec.rb"] + files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
36
- },
37
- %r%^spec/(models|controllers|views|helpers|lib)/.*rb$% => proc { |filename, _|
38
- filename
39
- },
40
- %r%^app/models/(.*)\.rb$% => proc { |_, m|
41
- ["spec/models/#{m[1]}_spec.rb"]
42
- },
43
- %r%^app/helpers/application_helper\.rb$% => proc {
44
- files_matching %r%^spec/(views|helpers)/.*_spec\.rb$%
45
- },
46
- %r%^app/helpers/(.*)_helper\.rb$% => proc { |_, m|
47
- if m[1] == "application" then
48
- files_matching(%r%^spec/(views|helpers)/.*_spec\.rb$%)
49
- else
50
- ["spec/helpers/#{m[1]}_helper_spec.rb"] + files_matching(%r%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
51
- end
52
- },
53
- # Handles both the old .rhtml and new .html.erb extensions
54
- # index.rhtml => index_rhtml_spec.rb
55
- # index.html.erb => index_html_spec.rb
56
- %r%^app/views/([^.]*)\.([^.]*)(\..*)?$% => proc { |_, m|
57
- files_matching %r%^spec/views/#{m[1]}(_|\.)#{m[2]}_spec.rb$%
58
- },
59
- %r%^app/controllers/application\.rb$% => proc { |_, m|
60
- files_matching %r%^spec/controllers/.*_spec\.rb$%
61
- },
62
- %r%^app/controllers/(.*)\.rb$% => proc { |_, m|
63
- ["spec/controllers/#{m[1]}_spec.rb"]
64
- },
65
- %r%^config/router\.rb$% => proc { # FIX:
66
- files_matching %r%^spec/(controllers|views|helpers)/.*_spec\.rb$%
67
- },
68
- %r%^config/database\.yml$% => proc { |_, m|
69
- files_matching %r%^spec/models/.*_spec\.rb$%
70
- },
71
- %r%^(spec/(spec_helper|shared/.*)|config/(dependencies|merb_init|environment(s/test)?))\.rb$% => proc {
72
- files_matching %r%^spec/(models|controllers|views|helpers)/.*_spec\.rb$%
73
- },
74
- %r%^lib/(.*)\.rb$% => proc { |_, m|
75
- ["spec/lib/#{m[1]}_spec.rb"]
76
- },
77
- }
78
- end
79
-
80
- end
data/lib/merb.rb DELETED
@@ -1,188 +0,0 @@
1
- require 'rubygems'
2
- if ENV['SWIFT']
3
- begin
4
- require 'swiftcore/swiftiplied_mongrel'
5
- puts "Using Swiftiplied Mongrel"
6
- rescue LoadError
7
- require 'mongrel'
8
- puts "SWIFT variable set but not installed - falling back to normal Mongrel"
9
- end
10
- elsif ENV['EVENT']
11
- begin
12
- require 'swiftcore/evented_mongrel'
13
- puts "Using Evented Mongrel"
14
- rescue LoadError
15
- require 'mongrel'
16
- puts "EVENT variable set but swiftiply not installed - falling back to normal Mongrel"
17
- end
18
- elsif ENV['PACKET']
19
- begin
20
- require 'packet_mongrel'
21
- puts "Using Packet Mongrel"
22
- rescue LoadError
23
- require 'mongrel'
24
- puts "PACKET variable set but packet not installed - falling back to normal Mongrel"
25
- end
26
- else
27
- require 'mongrel'
28
- end
29
- require 'set'
30
- require 'fileutils'
31
- require 'merb/erubis_ext'
32
- require 'merb/logger'
33
- require 'merb/version'
34
- require 'merb/config'
35
-
36
- autoload :MerbUploadHandler, 'merb/upload_handler'
37
- autoload :MerbHandler, 'merb/mongrel_handler'
38
-
39
- module Merb
40
- autoload :AbstractController, 'merb/abstract_controller'
41
- autoload :Assets, 'merb/assets'
42
- autoload :Authentication, 'merb/mixins/basic_authentication'
43
- autoload :Caching, 'merb/caching'
44
- autoload :Const, 'merb/constants'
45
- autoload :Controller, 'merb/controller'
46
- autoload :ControllerExceptions, 'merb/exceptions'
47
- autoload :ControllerMixin, 'merb/mixins/controller'
48
- autoload :Cookies, 'merb/cookies'
49
- autoload :Dispatcher, 'merb/dispatcher'
50
- autoload :DrbServiceProvider, 'drb_server'
51
- autoload :ErubisCaptureMixin, 'merb/mixins/erubis_capture'
52
- autoload :GeneralControllerMixin, 'merb/mixins/general_controller'
53
- autoload :InlinePartialMixin, 'merb/mixins/inline_partial'
54
- autoload :MailController, 'merb/mail_controller'
55
- autoload :Mailer, 'merb/mailer'
56
- autoload :PartController, 'merb/part_controller'
57
- autoload :Plugins, 'merb/plugins'
58
- autoload :Rack, 'merb/rack_adapter'
59
- autoload :RenderMixin, 'merb/mixins/render'
60
- autoload :Request, 'merb/request'
61
- autoload :ResponderMixin, 'merb/mixins/responder'
62
- autoload :Router, 'merb/router'
63
- autoload :Server, 'merb/server'
64
- autoload :SessionMixin, 'merb/session'
65
- autoload :Template, 'merb/template'
66
- autoload :UploadProgress, 'merb/upload_progress'
67
- autoload :ViewContext, 'merb/view_context'
68
- autoload :ViewContextMixin, 'merb/mixins/view_context'
69
- autoload :WebControllerMixin, 'merb/mixins/web_controller'
70
-
71
- # This is where Merb-global variables are set and held
72
- class << self
73
-
74
- def environment
75
- @environment
76
- end
77
-
78
- def environment=(value)
79
- @environment = value
80
- end
81
-
82
- def load_paths
83
- @load_paths ||= [ "/app/models/**/*.rb",
84
- "/app/controllers/application.rb",
85
- "/app/controllers/**/*.rb",
86
- "/app/helpers/**/*.rb",
87
- "/app/mailers/**/*.rb",
88
- "/app/parts/**/*.rb",
89
- "/config/router.rb"
90
- ]
91
- end
92
-
93
- # Application paths
94
- def root
95
- @root || Merb::Config[:merb_root] || Dir.pwd
96
- end
97
-
98
- def root_path(*path)
99
- File.join(root, *path)
100
- end
101
-
102
- def view_path
103
- root_path 'app/views'
104
- end
105
-
106
- def model_path
107
- root_path 'app/models'
108
- end
109
-
110
- def application_controller_path
111
- root_path 'app/controllers/application.rb'
112
- end
113
-
114
- def controller_path
115
- root_path 'app/controllers'
116
- end
117
-
118
- def helper_path
119
- root_path 'app/helpers'
120
- end
121
-
122
- def mailer_path
123
- root_path 'app/mailers'
124
- end
125
-
126
- def part_path
127
- root_path 'app/parts'
128
- end
129
-
130
- def router_path
131
- root_path '/config/router.rb'
132
- end
133
-
134
- def root=(value)
135
- @root ||= value
136
- end
137
-
138
- # Logger settings
139
- attr :logger, true
140
-
141
- def log_path
142
- if $TESTING
143
- "#{Merb.root}/log/merb_test.log"
144
- elsif !(Merb::Config[:daemonize] || Merb::Config[:cluster] )
145
- STDOUT
146
- else
147
- "#{Merb.root}/log/merb.#{Merb::Config[:port]}.log"
148
- end
149
- end
150
-
151
- # Framework paths
152
-
153
- def framework_root
154
- @framework_root ||= File.dirname(__FILE__)
155
- end
156
-
157
- def framework_path(path)
158
- File.join(framework_root, path)
159
- end
160
-
161
- def lib_path
162
- framework_path 'merb'
163
- end
164
-
165
- def skeleton_path
166
- framework_path '../app_generators/merb/templates'
167
- end
168
- end
169
-
170
- # Set up default generator scope
171
- GENERATOR_SCOPE = [:merb_default, :merb, :rspec]
172
- end
173
-
174
- # Load up the core extensions
175
- require Merb.framework_path('merb/core_ext')
176
- require Merb.framework_path('merb/version')
177
-
178
- # Set the environment
179
- Merb.environment = Merb::Config[:environment] || ($TESTING ? 'test' : 'development')
180
-
181
- # Create and setup the logger
182
- Merb.logger = Merb::Logger.new(Merb.log_path)
183
- Merb.logger.level = Merb::Logger.const_get(Merb::Config[:log_level].upcase) rescue Merb::Logger::INFO
184
-
185
- if $TESTING
186
- test_files = File.join(Merb.lib_path, 'test', '*.rb')
187
- Dir[test_files].each { |file| require file }
188
- end