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/bin/nitrogen DELETED
@@ -1,5 +0,0 @@
1
- puts <<-MSG
2
-
3
- This script is deprecated. Use 'gen app my_app' instead.
4
-
5
- MSG
@@ -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>