booklab-toc 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 5dcff03faea9255ce3e885606b9e3525424ca713c68c4f95e243118744222dc3
4
- data.tar.gz: 9b4a848863736348b8eb7b13912eb79640592146595fb97e4ad67d5fabed5685
3
+ metadata.gz: d370a5011686b9b3fc2adde105223dde812c11098cb1bb087e84496181481a1f
4
+ data.tar.gz: 2ef2492210e693984f3b5ba4d533c6d4eb935dbf08889597783824f86038b0c0
5
5
  SHA512:
6
- metadata.gz: 28d3a4fa6ebc7b55d0aea9d46bf7db5e861c6ad9f9a14841c261e404a02eb77871ed25c9bddce8ac53e6c597e144b4c13410ebe25a449f19e7ef1ef2f3f8e38e
7
- data.tar.gz: 404e6d25c860389a251015b6ca2568c92cca598214fadae1381e40f0a48ba0ce702562f99079c93800cd07aa6d30a9ed95dd5d7e288693e58255b1bd38f132f9
6
+ metadata.gz: 753ba7a062ae278e19a5f167d057d6efdcb53f55def47583732a1d026a83d7b91a3b0fe237ca46425f461e985d5971f1de9694cd6eff84182b8acfc80ab5cc54
7
+ data.tar.gz: 4aa42aec65cb92ee956a6d193ea83686981196642b7ad256d3d98b3cec154efe8ec32872f369b5d5822892b4b0027ed5f1afd2e9b8340305a654c52dd6d7d8e9
@@ -31,16 +31,16 @@ module BookLab
31
31
  render_items = []
32
32
  items.each do |item|
33
33
  new_item = item.dup
34
-
34
+
35
35
  new_item.slug = new_item.url
36
36
  if prefix && new_item.url && !new_item.slug.include?("/")
37
37
  new_item.url = "#{prefix}#{new_item.slug}"
38
38
  end
39
39
  render_items << new_item
40
40
  end
41
-
42
- ApplicationController.renderer.render(partial: "booklab/toc/content", locals: {
43
- format: format,
41
+
42
+ ApplicationController.renderer.render(partial: "booklab/toc/content", locals: {
43
+ format: format,
44
44
  items: render_items,
45
45
  })
46
46
  end
@@ -1,5 +1,5 @@
1
1
  module BookLab
2
2
  module Toc
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
data/lib/booklab-toc.rb CHANGED
@@ -28,7 +28,9 @@ module BookLab
28
28
  end
29
29
 
30
30
  datas.each do |obj|
31
- items << ListItem.new(obj.to_hash.deep_symbolize_keys)
31
+ item_hash = obj.to_hash
32
+ item_hash.deep_symbolize_keys!
33
+ items << ListItem.new(id: item_hash[:id], title: item_hash[:title], url: item_hash[:url], depth: item_hash[:depth])
32
34
  end
33
35
  Content.new(items)
34
36
  rescue => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: booklab-toc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2018-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  version: '0'
78
78
  requirements: []
79
79
  rubyforge_project:
80
- rubygems_version: 2.7.7
80
+ rubygems_version: 2.7.8
81
81
  signing_key:
82
82
  specification_version: 4
83
83
  summary: Toc format read/write for BookLab