puzzly_api_plugin 0.1.6 → 0.1.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a63bbea1b65df643dd65e69b0a99ffa7adb42b4d717e4a45a15e7754f924fbf
|
4
|
+
data.tar.gz: 7352fc5d659ba8f6f5df964d449484fb7b7763e758e4bf0807bc55e538558be6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ad94df9ee105ebb7db5fe72bffc33c6f3e2225decfa624e1ab7cd6430648ed1e3404a96ab6aabe50c95c84ec6b1996ac8c2a3b3f0c71dbd901f730df04f9e7a
|
7
|
+
data.tar.gz: 5d55139bca881000b4a6e00118631a8bbe6f0127d40cf6d4244566d5609afa16d66c06a9eab6c2892c08ff52e3a36da064aad53e28a13b3937d654c65a3a96ba
|
data/lib/puzzly_api_plugin.rb
CHANGED
@@ -52,4 +52,11 @@ require 'puzzly_api_plugin/view/topics'
|
|
52
52
|
require 'puzzly_api_plugin/generator'
|
53
53
|
|
54
54
|
module PuzzlyApiPlugin
|
55
|
+
def self.warn(message)
|
56
|
+
Jekyll.logger.warn log_category = "Review your file #{path}:", message
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.log(message)
|
60
|
+
Jekyll.logger.info "Puzzly:", message
|
61
|
+
end
|
55
62
|
end
|
@@ -7,9 +7,12 @@ module PuzzlyApiPlugin
|
|
7
7
|
def generate(site)
|
8
8
|
clean(site)
|
9
9
|
|
10
|
+
log("Processing #{site.documents.size} documents")
|
11
|
+
|
10
12
|
site.documents.each do |document|
|
11
13
|
collection = PuzzlyApiPlugin.const_get("#{document.collection.label.capitalize}Collection").instance
|
12
14
|
collection.add(document)
|
15
|
+
log("Processing document #{document.data}")
|
13
16
|
end
|
14
17
|
|
15
18
|
render site, HomeDashboardView.create
|
@@ -56,6 +59,8 @@ module PuzzlyApiPlugin
|
|
56
59
|
end
|
57
60
|
|
58
61
|
def clean(site)
|
62
|
+
log("Cleanning site destination folder")
|
63
|
+
|
59
64
|
destination = site.config["destination"]
|
60
65
|
clean_collection_directory("#{destination}/apis")
|
61
66
|
clean_collection_directory("#{destination}/caches")
|
@@ -71,7 +76,7 @@ module PuzzlyApiPlugin
|
|
71
76
|
if(!Dir.exist?(path))
|
72
77
|
return
|
73
78
|
end
|
74
|
-
|
79
|
+
|
75
80
|
Dir.foreach(path) do |file|
|
76
81
|
if ((file.to_s != ".") and (file.to_s != ".."))
|
77
82
|
File.delete("#{path}/#{file}")
|
@@ -84,5 +89,9 @@ module PuzzlyApiPlugin
|
|
84
89
|
path = view.path
|
85
90
|
site.pages << JSONPage.new(site, site.source, File.dirname(path), File.basename(path), content)
|
86
91
|
end
|
92
|
+
|
93
|
+
def log(message)
|
94
|
+
PuzzlyApiPlugin.log(message)
|
95
|
+
end
|
87
96
|
end
|
88
97
|
end
|