dyoder-waves 0.7.3 → 0.7.6

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 (83) hide show
  1. data/app/bin/waves-console +1 -0
  2. data/app/bin/waves-server +1 -0
  3. data/app/configurations/development.rb.erb +5 -6
  4. data/app/configurations/mapping.rb.erb +1 -2
  5. data/app/configurations/production.rb.erb +2 -2
  6. data/app/controllers/.gitignore +0 -0
  7. data/app/doc/.gitignore +0 -0
  8. data/app/helpers/.gitignore +0 -0
  9. data/app/lib/application.rb.erb +4 -2
  10. data/app/lib/tasks/.gitignore +0 -0
  11. data/app/log/.gitignore +0 -0
  12. data/app/models/.gitignore +0 -0
  13. data/app/public/css/.gitignore +0 -0
  14. data/app/public/flash/.gitignore +0 -0
  15. data/app/public/images/.gitignore +0 -0
  16. data/app/public/javascript/.gitignore +0 -0
  17. data/app/schema/migrations/.gitignore +0 -0
  18. data/app/tmp/sessions/.gitignore +0 -0
  19. data/app/views/.gitignore +0 -0
  20. data/bin/waves +29 -46
  21. data/bin/waves-console +1 -1
  22. data/bin/waves-server +1 -1
  23. data/lib/commands/waves-console.rb +0 -3
  24. data/lib/controllers/base.rb +11 -0
  25. data/lib/controllers/mixin.rb +39 -32
  26. data/lib/dispatchers/base.rb +37 -22
  27. data/lib/dispatchers/default.rb +25 -11
  28. data/lib/foundations/default.rb +6 -8
  29. data/lib/foundations/simple.rb +13 -0
  30. data/lib/helpers/asset_helper.rb +67 -0
  31. data/lib/helpers/common.rb +4 -0
  32. data/lib/helpers/default.rb +13 -0
  33. data/lib/helpers/form.rb +1 -0
  34. data/lib/helpers/number_helper.rb +25 -0
  35. data/lib/helpers/tag_helper.rb +58 -0
  36. data/lib/helpers/url_helper.rb +77 -0
  37. data/lib/layers/default_errors.rb +7 -5
  38. data/lib/layers/mvc.rb +54 -0
  39. data/lib/layers/orm/active_record.rb +93 -0
  40. data/lib/layers/orm/active_record/migrations/empty.rb.erb +9 -0
  41. data/lib/layers/orm/active_record/tasks/generate.rb +28 -0
  42. data/lib/layers/orm/active_record/tasks/schema.rb +22 -0
  43. data/lib/layers/orm/data_mapper.rb +38 -0
  44. data/lib/layers/orm/filebase.rb +22 -0
  45. data/lib/layers/orm/migration.rb +79 -0
  46. data/lib/layers/orm/sequel.rb +86 -0
  47. data/lib/layers/orm/sequel/migrations/empty.rb.erb +9 -0
  48. data/lib/layers/orm/sequel/tasks/generate.rb +28 -0
  49. data/lib/layers/orm/sequel/tasks/schema.rb +16 -0
  50. data/lib/layers/simple.rb +35 -0
  51. data/lib/layers/simple_errors.rb +11 -5
  52. data/lib/mapping/mapping.rb +61 -24
  53. data/lib/mapping/pretty_urls.rb +5 -3
  54. data/lib/renderers/erubis.rb +3 -1
  55. data/lib/renderers/mixin.rb +1 -4
  56. data/lib/runtime/application.rb +12 -8
  57. data/lib/runtime/blackboard.rb +57 -0
  58. data/lib/runtime/configuration.rb +60 -55
  59. data/lib/runtime/logger.rb +8 -1
  60. data/lib/runtime/request.rb +5 -4
  61. data/lib/runtime/response.rb +3 -3
  62. data/lib/runtime/response_mixin.rb +3 -0
  63. data/lib/runtime/response_proxy.rb +4 -1
  64. data/lib/runtime/server.rb +18 -5
  65. data/lib/runtime/session.rb +20 -10
  66. data/lib/tasks/cluster.rb +2 -1
  67. data/lib/tasks/generate.rb +76 -11
  68. data/lib/utilities/hash.rb +31 -0
  69. data/lib/utilities/inflect.rb +86 -170
  70. data/lib/utilities/inflect/english.rb +84 -0
  71. data/lib/utilities/integer.rb +23 -16
  72. data/lib/utilities/module.rb +19 -15
  73. data/lib/utilities/object.rb +22 -14
  74. data/lib/utilities/proc.rb +13 -6
  75. data/lib/utilities/string.rb +58 -44
  76. data/lib/utilities/symbol.rb +4 -1
  77. data/lib/views/base.rb +9 -0
  78. data/lib/views/mixin.rb +3 -1
  79. data/lib/waves.rb +15 -13
  80. metadata +50 -25
  81. data/lib/utilities/kernel.rb +0 -34
  82. data/lib/verify/mapping.rb +0 -29
  83. data/lib/verify/request.rb +0 -40
@@ -1,34 +0,0 @@
1
- module Kernel
2
- #
3
- # From Rails. This comes in handy when you want to return a value that you need to modify.
4
- # So instead of the awkward:
5
- #
6
- # foo = Foo.new
7
- # foo.bar = 'bar'
8
- # foo
9
- #
10
- # You can just say
11
- #
12
- # returning Foo.new { |foo| foo.bar = 'bar' }
13
- #
14
- def returning( object, &block )
15
- yield object; object
16
- end
17
-
18
- #
19
- # Inspired by a question on comp.lang.ruby. Sort of like returning, except
20
- # you don't need to pass in the returnee as an argument. The drawback is that,
21
- # since this relies on instance_eval, you can't access in methods in the local
22
- # scope. You can work around this by assigning values to variables, but in that
23
- # case, you might be better off using returning.
24
- #
25
- # Our above example would look like this:
26
- #
27
- # with( Foo.new ) { bar = 'bar' }
28
- #
29
- def with( object, &block )
30
- object.instance_eval(&block); object
31
- end
32
-
33
-
34
- end
@@ -1,29 +0,0 @@
1
- module Waves
2
- module Verify
3
- module Helpers
4
- module Mapping
5
-
6
- def mapping
7
- ::Waves::Application.instance.mapping
8
- end
9
-
10
- def path(*args,&block)
11
- mapping.path(*args,&block)
12
- end
13
-
14
- def url(*args,&block)
15
- mapping.url(*args,&block)
16
- end
17
-
18
- def handle(*args,&block)
19
- mapping.handle(*args,&block)
20
- end
21
-
22
- def threaded(*args,&block)
23
- mapping.threaded(*args,&block)
24
- end
25
-
26
- end
27
- end
28
- end
29
- end
@@ -1,40 +0,0 @@
1
- module Waves
2
- module Verify
3
- module Helpers
4
- module Request
5
-
6
- ::Rack::MockRequest::DEFAULT_ENV.merge!(
7
- 'REMOTE_ADDR' => '127.0.0.1',
8
- 'REMOTE_HOST' => 'localhost',
9
- 'SERVER_NAME' => 'localhost',
10
- 'SERVER_PORT' => '3000',
11
- 'SERVER_PORT_SECURE' => '0',
12
- 'SERVER_PROTOCOL' => 'HTTP/1.1',
13
- 'SERVER_SOFTWARE' => 'Waves 1.0',
14
- 'HTTP_HOST' => 'localhost',
15
- 'HTTP_VERSION' => 'HTTP/1.1',
16
- 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
17
- 'HTTP_CACHE_CONTROL' => 'max-age=0',
18
- 'HTTP_ACCEPT' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5',
19
- 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5',
20
- 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
21
- 'HTTP_ACCEPT_ENCODING' => 'gzip,compress;q=0.5,*;q=0.0,',
22
- 'HTTP_CONNECTION' => 'keep-alive',
23
- 'HTTP_KEEP_ALIVE' => '300',
24
- 'HTTP_REFERER' => 'http://localhost/',
25
- 'GATEWAY_INTERFACE' => 'CGI/1.1'
26
- )
27
-
28
- def request
29
- @request ||= ::Rack::MockRequest.new( ::Waves::Dispatchers::Default.new )
30
- end
31
-
32
- def get(uri, opts={}) request.get(uri, opts) end
33
- def post(uri, opts={}) request.post(uri, opts) end
34
- def put(uri, opts={}) request.put(uri, opts) end
35
- def delete(uri, opts={}) request.delete(uri, opts) end
36
-
37
- end
38
- end
39
- end
40
- end