jekyll-attendease 0.6.26f → 0.6.26g
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3801098fe322dcb018ebf7f94f9b5941f15945a0
|
4
|
+
data.tar.gz: 52b883649eee0224f7417f92560c7074e91208b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23381e4b92c34d2b4266e00ac1c82f903fb0f00e0bb96f73e723a529d630788f2daab60ee065fa17d319b69a7befc176eb2e1871127f554738ef0ab8de3cdffa
|
7
|
+
data.tar.gz: 2f37f4bf699298e532996a17a06adadd53ce58648f2be3d22676635db6efb07ad5ec098dfec5a2afad022d360d6e7c77ba5ad032bf8c3c3dbe0bd7bcc00c5840
|
@@ -40,10 +40,14 @@ module Jekyll
|
|
40
40
|
end
|
41
41
|
|
42
42
|
if update_data
|
43
|
+
unless site.config.attendease['access_token']
|
44
|
+
raise "Missing user access_token in the attendease section of _config.yml"
|
45
|
+
end
|
46
|
+
|
43
47
|
options = {}
|
44
|
-
options.merge!(:headers => {'X-
|
48
|
+
options.merge!(:headers => {'X-User-Token' => site.config.attendease['access_token']})
|
45
49
|
|
46
|
-
response = get("#{site.config.attendease['api_host']}api
|
50
|
+
response = get("#{site.config.attendease['api_host']}api/#{filename}", options)
|
47
51
|
|
48
52
|
if (!response.nil? && response.response.is_a?(Net::HTTPOK))
|
49
53
|
Jekyll.logger.info "[Attendease] Saving #{filename} data..."
|
@@ -55,7 +59,12 @@ module Jekyll
|
|
55
59
|
File.open(file, 'w') { |f| f.write(response.body) }
|
56
60
|
end
|
57
61
|
else
|
58
|
-
|
62
|
+
case response.code
|
63
|
+
when 403
|
64
|
+
raise "#{response.code} Access token invalid for #{site.config.attendease['api_host']}api/#{filename}"
|
65
|
+
else
|
66
|
+
raise "#{response.code} Request failed for #{site.config.attendease['api_host']}api/#{filename}. Is your Attendease api_host site properly in _config.yml?"
|
67
|
+
end
|
59
68
|
end
|
60
69
|
end
|
61
70
|
|