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: 45bdb8faa3538443ada11b4f7c084240a600506befa7575f68b82594ab30f42f
4
- data.tar.gz: 2fa8f399c64a9314ac68eac4881625b11ff439c34562537e33044ab8e7abc9fc
3
+ metadata.gz: 4a63bbea1b65df643dd65e69b0a99ffa7adb42b4d717e4a45a15e7754f924fbf
4
+ data.tar.gz: 7352fc5d659ba8f6f5df964d449484fb7b7763e758e4bf0807bc55e538558be6
5
5
  SHA512:
6
- metadata.gz: 606ffb37200d9d46c1dc5d8d5f17ac5d1d46146f40627b1ad46e33e7b3ffe4b57338cf677c851773b72afb1872cf7d02907fde3381e06f4d9f45a5f0f1a391d1
7
- data.tar.gz: 417e47584d268f0eff52badc51707055e863289ec24f8280d86f70201bf68881a7a208853c154c9c28812ef2eb6dae5f99b2cf377b75b98b9ebe5188533a3f8f
6
+ metadata.gz: 4ad94df9ee105ebb7db5fe72bffc33c6f3e2225decfa624e1ab7cd6430648ed1e3404a96ab6aabe50c95c84ec6b1996ac8c2a3b3f0c71dbd901f730df04f9e7a
7
+ data.tar.gz: 5d55139bca881000b4a6e00118631a8bbe6f0127d40cf6d4244566d5609afa16d66c06a9eab6c2892c08ff52e3a36da064aad53e28a13b3937d654c65a3a96ba
@@ -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
@@ -11,9 +11,5 @@ module PuzzlyApiPlugin
11
11
  def to_s
12
12
  to_json
13
13
  end
14
-
15
- def info message
16
- Jekyll.logger.info "Puzzly:", message
17
- end
18
14
  end
19
15
  end
@@ -22,10 +22,6 @@ module PuzzlyApiPlugin
22
22
 
23
23
  def to_identity
24
24
  Identity.create(self)
25
- end
26
-
27
- def warn message
28
- Jekyll.logger.warn log_category = "Review your file #{path}:", message
29
- end
25
+ end
30
26
  end
31
27
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuzzlyApiPlugin
4
- VERSION = '0.1.6'
4
+ VERSION = '0.1.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puzzly_api_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mr. Braz