yaks-html 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18b28bb7180d5d6f07d0c10c40fd14a6beda9f23
4
- data.tar.gz: cb771dc27b2dc16b7db118bfac3c342c94bcc54b
3
+ metadata.gz: 1712b24b647d3652edfd89a0496157c02e9c31c2
4
+ data.tar.gz: accaabeff3f59cbafd064700c2bd6b3c49fc9151
5
5
  SHA512:
6
- metadata.gz: 66db9029a90c53ddf6d3da2001b7b9a3b02a68cb92b6911db526a8e6755b6e548e0a13e009bc1a84a0efda7c3076c221d018d7565288411d9f647463dc57c6c8
7
- data.tar.gz: 3089ec5f28fd38a2f3f09a72d92e432d5dab7039ecf17fc403ed7f6a021da5a92a445ce433487836ccbdf6f50507de5af08e87ed168478b0e11194c8bf5cc677
6
+ metadata.gz: 24702a449c3a81e79c68b790bce2c0df3e38b476fc6465e8151c6e3f3c3463bb28224ddfd33c299afafe6055c7ef6a22c36f646fe5565f499f267b70be93f60b
7
+ data.tar.gz: 02e961efef34ad9be79cc9da58196869ac92a61bd6e762da91af388bd71eee980aa8fa75b62bc5e69918a173671026a083c3db1d050598663d9db74f236ec30d
@@ -47,7 +47,7 @@ module Yaks
47
47
  templ
48
48
  .replace('.rel a') {|a| a.attr('href', link.rel.to_s).content(link.rel.to_s) }
49
49
  .replace('.uri a') {|a| a.attr('href', link.uri).content(link.uri) }
50
- .replace('.title') {|x| x.content(link.title) }
50
+ .replace('.title') {|x| x.content(link.title.to_s) }
51
51
  .replace('.templated') {|x| x.content(link.templated?.inspect) }
52
52
  end
53
53
  end
@@ -56,14 +56,15 @@ module Yaks
56
56
  def render_subresources(resource, templ, sub_templ)
57
57
  templ = templ.replace('h1,h2,h3,h4') {|h| h.set_tag("h#{h.tag[/\d/].to_i.next}") }
58
58
  if resource.collection?
59
- resource.map do |r|
59
+ resource.seq.map do |r|
60
60
  render_resource(r, templ)
61
61
  end
62
62
  else
63
- resource.subresources.map do |rel, resources|
63
+ resource.subresources.map do |resources|
64
+ rel = resources.rels.first.to_s
64
65
  sub_templ
65
- .replace('.rel a') {|a| a.attr('href', rel.to_s).content(rel.to_s) }
66
- .replace('.value') {|x| x.content(resources.map { |resource| render_resource(resource, templ) })}
66
+ .replace('.rel a') {|a| a.attr('href', rel).content(rel) }
67
+ .replace('.value') {|x| x.content(resources.seq.map { |resource| render_resource(resource, templ) })}
67
68
  end
68
69
  end
69
70
  end
data/lib/yaks-html.rb CHANGED
@@ -2,4 +2,7 @@ require 'hexp'
2
2
  require 'yaks'
3
3
  require 'yaks/format/html'
4
4
 
5
- Yaks::Serializer.register(:html, Hexp::Unparser.new({}))
5
+ -> do
6
+ unparser = Hexp::Unparser.new({})
7
+ Yaks::Serializer.register(:html, ->(data, env) { unparser.call(data) })
8
+ end.call
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaks-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Brasseur
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaks
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.6.2
19
+ version: 0.7.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.6.2
26
+ version: 0.7.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: hexp
29
29
  requirement: !ruby/object:Gem::Requirement