nitro 0.30.0 → 0.31.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ProjectInfo +6 -6
- data/bin/nitro +100 -7
- data/doc/RELEASES +18 -0
- data/lib/glue/sweeper.rb +9 -5
- data/lib/nitro.rb +13 -13
- data/lib/nitro/adapter/console.rb +7 -0
- data/lib/nitro/adapter/mongrel.rb +34 -71
- data/lib/nitro/adapter/script.rb +71 -0
- data/lib/nitro/adapter/webrick.rb +0 -2
- data/lib/nitro/caching.rb +0 -1
- data/lib/nitro/caching/fragments.rb +2 -3
- data/lib/nitro/caching/output.rb +3 -4
- data/lib/nitro/cgi.rb +14 -0
- data/lib/nitro/cgi/request.rb +10 -9
- data/lib/nitro/cgi/sendfile.rb +45 -0
- data/lib/nitro/compiler.rb +1 -1
- data/lib/nitro/compiler/errors.rb +3 -3
- data/lib/nitro/context.rb +16 -1
- data/lib/nitro/controller.rb +60 -5
- data/lib/nitro/dispatcher.rb +2 -1
- data/lib/nitro/helper.rb +0 -2
- data/lib/nitro/helper/form/builder.rb +5 -1
- data/lib/nitro/helper/javascript.rb +1 -1
- data/lib/nitro/helper/pager.rb +19 -10
- data/lib/nitro/helper/table.rb +28 -3
- data/lib/nitro/helper/xhtml.rb +4 -3
- data/lib/nitro/part.rb +57 -2
- data/lib/nitro/render.rb +67 -28
- data/lib/nitro/router.rb +1 -0
- data/lib/nitro/scaffold.rb +141 -0
- data/lib/nitro/scaffolding.rb +17 -17
- data/lib/nitro/server/runner.rb +2 -9
- data/lib/nitro/session.rb +13 -5
- data/lib/nitro/test/testcase.rb +2 -0
- data/proto/run.rb +3 -1
- data/src/part/admin/controller.rb +2 -1
- data/src/part/admin/template/index.xhtml +2 -2
- data/test/nitro/tc_element.rb +13 -11
- data/test/nitro/tc_render.rb +1 -2
- metadata +186 -182
- data/bin/nitrogen +0 -5
- data/lib/nitro/helper/wee.rb +0 -57
data/bin/nitrogen
DELETED
data/lib/nitro/helper/wee.rb
DELETED
@@ -1,57 +0,0 @@
|
|
1
|
-
require 'nitro/controller'
|
2
|
-
|
3
|
-
require 'wee'
|
4
|
-
require 'wee/adaptors/nitro'
|
5
|
-
|
6
|
-
module Nitro
|
7
|
-
|
8
|
-
# Include this mixin to the standard Controller to have easy
|
9
|
-
# access to Wee Components.
|
10
|
-
|
11
|
-
module WeeHelper
|
12
|
-
include Wee::Nitro::ControllerMixin
|
13
|
-
|
14
|
-
# Returns the output of the component.
|
15
|
-
|
16
|
-
def component(klass, options = {})
|
17
|
-
out = ''
|
18
|
-
name = options[:name] || klass.to_s
|
19
|
-
|
20
|
-
cb = Wee::CallbackRegistry.new(Wee::SequentialIdGenerator.new)
|
21
|
-
rctx = Wee::RenderingContext.new(context(), cb, Wee::HtmlWriter.new(out))
|
22
|
-
rctx.component_name = name
|
23
|
-
rctx.controller = self
|
24
|
-
rctx.redirect_action = options[:redirect_action]
|
25
|
-
|
26
|
-
unless c = components[name]
|
27
|
-
unless block = self.class.registered_components[name]
|
28
|
-
block = proc { klass.new }
|
29
|
-
self.class.register_component(name, &block)
|
30
|
-
end
|
31
|
-
make_component name, block.call
|
32
|
-
c = components[name]
|
33
|
-
end
|
34
|
-
|
35
|
-
raise "Component #{name} not found" if c.nil?
|
36
|
-
|
37
|
-
c.render(rctx)
|
38
|
-
c.callbacks = cb
|
39
|
-
|
40
|
-
return out
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
#--
|
45
|
-
# Add Wee-related helper methods to the default Nitro
|
46
|
-
# controller.
|
47
|
-
#++
|
48
|
-
|
49
|
-
class Controller
|
50
|
-
include Wee::Nitro::ControllerMixin
|
51
|
-
include WeeHelper
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
# * George Moschovitis <gm@navel.gr>
|
57
|
-
# * Michael Neumann <mneumann@ntecs.de>
|