ahc 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/ahcx_template_handler.rb +11 -8
  2. metadata +1 -1
@@ -5,13 +5,7 @@ class AhcxTemplateHandler
5
5
  def self.call(template)
6
6
  erb = ActionView::Template.registered_template_handler(:erb)
7
7
  source = erb.call(template)
8
- ahcx_source = "<document>#{eval(source)}</document>"
9
- ahcx = Nokogiri.parse(ahcx_source)
10
- content = ''
11
- ahcx.children.first.children.each do |node|
12
- content += node_content(node)
13
- end
14
- content.inspect
8
+ source + ";AhcxTemplateHandler.render(@output_buffer.to_s)"
15
9
  end
16
10
 
17
11
  def self.node_content(node)
@@ -36,5 +30,14 @@ class AhcxTemplateHandler
36
30
  Ahc.render(tag, params)
37
31
  end
38
32
 
39
- end
33
+ def self.render(xml)
34
+ ahcx_source = "<document>#{xml}</document>"
35
+ ahcx = Nokogiri.parse(ahcx_source)
36
+ content = ''
37
+ ahcx.children.first.children.each do |node|
38
+ content += node_content(node)
39
+ end
40
+ content
41
+ end
40
42
 
43
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ahc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: