gara 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gara/delegator.rb +3 -3
- data/lib/gara/html5_emitter.rb +1 -1
- data/lib/gara/renderer.rb +7 -0
- data/lib/gara/template/handler.rb +1 -1
- data/lib/gara/version.rb +1 -1
- data/lib/gara.rb +3 -0
- data/test/dummy/app/controllers/hello_controller.rb +1 -0
- data/test/dummy/app/views/hello/show.html.gara +1 -1
- data/test/dummy/log/development.log +6 -0
- data/test/dummy/log/test.log +1905 -0
- data/test/dummy/test/controllers/hello_controller_test.rb +1 -0
- data/test/gara_test.rb +44 -0
- data/test/handler_test.rb +5 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ac74cf48840c8830258afe2ea3733f4f39240c
|
4
|
+
data.tar.gz: 4bd67171c9ac39e2b4b65b1a4ba1fa4bc653ad83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7743c123c5bb7cdeeea973f41b6a1b2b49ec4b5ea5e77deb4503828ab1123f280c7e768f7a0d64be4549ea7f67c0b6ed4be3bf63000c86419321316767952bb8
|
7
|
+
data.tar.gz: f2a3f4b3afe8b3d0a1e7cfc628cfb26c4ef21a25a2c850fc2ad3ea83764f0082a1d4e04249e4f9fe9d34b753d9c049f4c2fe3d70344856be56344d287c6592c4
|
data/README.md
CHANGED
data/lib/gara/delegator.rb
CHANGED
@@ -12,15 +12,15 @@ module Gara
|
|
12
12
|
end
|
13
13
|
|
14
14
|
|
15
|
-
def initialize(view_context, emitter
|
15
|
+
def initialize(view_context, emitter)
|
16
16
|
@emitter = emitter
|
17
17
|
view_context.instance_variable_set(:@gara_delegate, emitter)
|
18
18
|
view_context.extend(emitter.registered_methods)
|
19
19
|
yield if block_given?
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
emitter.
|
22
|
+
def render
|
23
|
+
@emitter.emit
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
data/lib/gara/html5_emitter.rb
CHANGED
data/lib/gara/version.rb
CHANGED
data/lib/gara.rb
CHANGED
@@ -2,7 +2,10 @@ module Gara
|
|
2
2
|
require 'gara/template/handler'
|
3
3
|
require 'gara/delegator'
|
4
4
|
require 'gara/html5_emitter'
|
5
|
+
require 'gara/renderer'
|
6
|
+
extend Renderer
|
5
7
|
if defined?(Rails)
|
6
8
|
::ActionView::Template.register_template_handler :gara, Gara::Template::Handler
|
7
9
|
end
|
10
|
+
|
8
11
|
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
h1
|
1
|
+
h1 @hello
|
2
2
|
p 'Find me in app/views/hello/show.html.gara'
|
@@ -1593,3 +1593,9 @@ Started GET "/hello" for 127.0.0.1 at 2014-08-12 16:15:09 +0800
|
|
1593
1593
|
Processing by HelloController#show as HTML
|
1594
1594
|
Rendered hello/show.html.gara within layouts/application (1.0ms)
|
1595
1595
|
Completed 200 OK in 40ms (Views: 39.6ms)
|
1596
|
+
|
1597
|
+
|
1598
|
+
Started GET "/hello" for 127.0.0.1 at 2014-08-13 04:19:27 +0800
|
1599
|
+
Processing by HelloController#show as HTML
|
1600
|
+
Rendered hello/show.html.gara within layouts/application (1.6ms)
|
1601
|
+
Completed 200 OK in 37ms (Views: 37.0ms)
|