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 +4 -4
- data/lib/booklab/toc/content.rb +4 -4
- data/lib/booklab/toc/version.rb +1 -1
- data/lib/booklab-toc.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d370a5011686b9b3fc2adde105223dde812c11098cb1bb087e84496181481a1f
|
4
|
+
data.tar.gz: 2ef2492210e693984f3b5ba4d533c6d4eb935dbf08889597783824f86038b0c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 753ba7a062ae278e19a5f167d057d6efdcb53f55def47583732a1d026a83d7b91a3b0fe237ca46425f461e985d5971f1de9694cd6eff84182b8acfc80ab5cc54
|
7
|
+
data.tar.gz: 4aa42aec65cb92ee956a6d193ea83686981196642b7ad256d3d98b3cec154efe8ec32872f369b5d5822892b4b0027ed5f1afd2e9b8340305a654c52dd6d7d8e9
|
data/lib/booklab/toc/content.rb
CHANGED
@@ -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
|
data/lib/booklab/toc/version.rb
CHANGED
data/lib/booklab-toc.rb
CHANGED
@@ -28,7 +28,9 @@ module BookLab
|
|
28
28
|
end
|
29
29
|
|
30
30
|
datas.each do |obj|
|
31
|
-
|
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.
|
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-
|
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.
|
80
|
+
rubygems_version: 2.7.8
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Toc format read/write for BookLab
|