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.
- data/app/bin/waves-console +1 -0
- data/app/bin/waves-server +1 -0
- data/app/configurations/development.rb.erb +5 -6
- data/app/configurations/mapping.rb.erb +1 -2
- data/app/configurations/production.rb.erb +2 -2
- data/app/controllers/.gitignore +0 -0
- data/app/doc/.gitignore +0 -0
- data/app/helpers/.gitignore +0 -0
- data/app/lib/application.rb.erb +4 -2
- data/app/lib/tasks/.gitignore +0 -0
- data/app/log/.gitignore +0 -0
- data/app/models/.gitignore +0 -0
- data/app/public/css/.gitignore +0 -0
- data/app/public/flash/.gitignore +0 -0
- data/app/public/images/.gitignore +0 -0
- data/app/public/javascript/.gitignore +0 -0
- data/app/schema/migrations/.gitignore +0 -0
- data/app/tmp/sessions/.gitignore +0 -0
- data/app/views/.gitignore +0 -0
- data/bin/waves +29 -46
- data/bin/waves-console +1 -1
- data/bin/waves-server +1 -1
- data/lib/commands/waves-console.rb +0 -3
- data/lib/controllers/base.rb +11 -0
- data/lib/controllers/mixin.rb +39 -32
- data/lib/dispatchers/base.rb +37 -22
- data/lib/dispatchers/default.rb +25 -11
- data/lib/foundations/default.rb +6 -8
- data/lib/foundations/simple.rb +13 -0
- data/lib/helpers/asset_helper.rb +67 -0
- data/lib/helpers/common.rb +4 -0
- data/lib/helpers/default.rb +13 -0
- data/lib/helpers/form.rb +1 -0
- data/lib/helpers/number_helper.rb +25 -0
- data/lib/helpers/tag_helper.rb +58 -0
- data/lib/helpers/url_helper.rb +77 -0
- data/lib/layers/default_errors.rb +7 -5
- data/lib/layers/mvc.rb +54 -0
- data/lib/layers/orm/active_record.rb +93 -0
- data/lib/layers/orm/active_record/migrations/empty.rb.erb +9 -0
- data/lib/layers/orm/active_record/tasks/generate.rb +28 -0
- data/lib/layers/orm/active_record/tasks/schema.rb +22 -0
- data/lib/layers/orm/data_mapper.rb +38 -0
- data/lib/layers/orm/filebase.rb +22 -0
- data/lib/layers/orm/migration.rb +79 -0
- data/lib/layers/orm/sequel.rb +86 -0
- data/lib/layers/orm/sequel/migrations/empty.rb.erb +9 -0
- data/lib/layers/orm/sequel/tasks/generate.rb +28 -0
- data/lib/layers/orm/sequel/tasks/schema.rb +16 -0
- data/lib/layers/simple.rb +35 -0
- data/lib/layers/simple_errors.rb +11 -5
- data/lib/mapping/mapping.rb +61 -24
- data/lib/mapping/pretty_urls.rb +5 -3
- data/lib/renderers/erubis.rb +3 -1
- data/lib/renderers/mixin.rb +1 -4
- data/lib/runtime/application.rb +12 -8
- data/lib/runtime/blackboard.rb +57 -0
- data/lib/runtime/configuration.rb +60 -55
- data/lib/runtime/logger.rb +8 -1
- data/lib/runtime/request.rb +5 -4
- data/lib/runtime/response.rb +3 -3
- data/lib/runtime/response_mixin.rb +3 -0
- data/lib/runtime/response_proxy.rb +4 -1
- data/lib/runtime/server.rb +18 -5
- data/lib/runtime/session.rb +20 -10
- data/lib/tasks/cluster.rb +2 -1
- data/lib/tasks/generate.rb +76 -11
- data/lib/utilities/hash.rb +31 -0
- data/lib/utilities/inflect.rb +86 -170
- data/lib/utilities/inflect/english.rb +84 -0
- data/lib/utilities/integer.rb +23 -16
- data/lib/utilities/module.rb +19 -15
- data/lib/utilities/object.rb +22 -14
- data/lib/utilities/proc.rb +13 -6
- data/lib/utilities/string.rb +58 -44
- data/lib/utilities/symbol.rb +4 -1
- data/lib/views/base.rb +9 -0
- data/lib/views/mixin.rb +3 -1
- data/lib/waves.rb +15 -13
- metadata +50 -25
- data/lib/utilities/kernel.rb +0 -34
- data/lib/verify/mapping.rb +0 -29
- data/lib/verify/request.rb +0 -40
data/lib/utilities/kernel.rb
DELETED
@@ -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
|
data/lib/verify/mapping.rb
DELETED
@@ -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
|
data/lib/verify/request.rb
DELETED
@@ -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
|