cloudcannon-jekyll-bookshop 2.0.1 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cloudcannon-jekyll-bookshop/structures.rb +39 -9
- data/lib/cloudcannon-jekyll-bookshop/version.rb +1 -1
- data/node_modules/@bookshop/cloudcannon-structures/package.json +2 -2
- data/node_modules/@bookshop/toml-narrator/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d904ddbae9b38e3decf17c9107d8faa47b962894b9e7472296ee4ae53c97913
|
4
|
+
data.tar.gz: e3344f22a4cf1e4a8e4b4227efd58ca0958bbb1a44ee2cfe25b7647ed64a8ddb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20ba82495584aaa27667160d96535ab128cbc36c80cc2fd7e3208439d65ce747707b77931540410f6ad1d3270725b022c27409fd314b3db2bc93f88562b81738
|
7
|
+
data.tar.gz: 3ed20d1f6d2a95268b0ad016f59344f61c92e5bc8373fc51681f00558bdb6a6c47a564c84c5da7b164d9837d94ea9b6e1cc63480d56262c12f39c173b8b4f2a1
|
data/Gemfile.lock
CHANGED
@@ -47,6 +47,7 @@ module CloudCannonJekyllBookshop
|
|
47
47
|
array_structures = component.delete("structures")
|
48
48
|
array_structures.each do |key|
|
49
49
|
hash[key] ||= {}
|
50
|
+
hash[key]["id_key"] = "_bookshop_name"
|
50
51
|
hash[key]["values"] ||= []
|
51
52
|
hash[key]["values"].push(component)
|
52
53
|
end
|
@@ -58,18 +59,47 @@ module CloudCannonJekyllBookshop
|
|
58
59
|
Jekyll.logger.info "Bookshop:",
|
59
60
|
"Parsing Stories from #{base_path}"
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
files = Dir.glob("**/*.{bookshop}.{toml,tml,tom,tm}", :base => base_path);
|
63
|
+
|
64
|
+
read_attempts = 0
|
65
|
+
while files.size > 0 && read_attempts < 5
|
66
|
+
processing = files.map(&:clone)
|
67
|
+
files = []
|
68
|
+
threads = []
|
69
|
+
processing.each do |f|
|
70
|
+
threads << Thread.new do
|
71
|
+
begin
|
72
|
+
raw_file = File.read(base_path + "/" + f)
|
73
|
+
component = load_component(raw_file)
|
74
|
+
|
75
|
+
transform_component(f, component).each do |transformed_component|
|
76
|
+
add_structure(site.config["_array_structures"], transformed_component)
|
77
|
+
end
|
78
|
+
rescue
|
79
|
+
Thread.current[:output] = f
|
80
|
+
end
|
69
81
|
end
|
70
82
|
end
|
83
|
+
threads.each do |t|
|
84
|
+
t.join
|
85
|
+
files << t[:output] if t[:output]
|
86
|
+
end
|
87
|
+
Jekyll.logger.info "Bookshop:",
|
88
|
+
"Had trouble reading #{files.size} file(s), retrying" if files.size > 0
|
89
|
+
read_attempts += 1
|
90
|
+
end
|
91
|
+
|
92
|
+
if files.size > 0
|
93
|
+
Jekyll.logger.error "Bookshop:",
|
94
|
+
"❌ Failed to read #{files.size} file(s)"
|
95
|
+
files.each do |f|
|
96
|
+
Jekyll.logger.error "Bookshop:",
|
97
|
+
"❌ Failed to read #{f}"
|
98
|
+
end
|
99
|
+
Jekyll.logger.error "Bookshop:",
|
100
|
+
"❌ Check your TOML files are valid."
|
101
|
+
exit 1
|
71
102
|
end
|
72
|
-
threads.each(&:join)
|
73
103
|
end
|
74
104
|
|
75
105
|
def self.setup_helpers
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@bookshop/cloudcannon-structures",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.5",
|
4
4
|
"description": "Convert a Bookshop object into a CloudCannon structure",
|
5
5
|
"main": "main.js",
|
6
6
|
"scripts": {
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"access": "public"
|
17
17
|
},
|
18
18
|
"devDependencies": {
|
19
|
-
"@bookshop/toml-narrator": "2.0.
|
19
|
+
"@bookshop/toml-narrator": "2.0.5",
|
20
20
|
"@ltd/j-toml": "^1.17.0",
|
21
21
|
"ava": "^3.15.0",
|
22
22
|
"nyc": "^15.1.0",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudcannon-jekyll-bookshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Bigelow
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|