jekyll-amazon 0.1.0 → 0.1.1
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/lib/jekyll-amazon/amazon_tag.rb +7 -9
- data/lib/jekyll-amazon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca523ca8a7c9ba1c1c54d2d7734216e9ad4c407e
|
4
|
+
data.tar.gz: 853231b464607715817ad6898c5aff16bfd06579
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d34bb4b136dd9dd1475d855e207569a9ba7305ef860537140b41b2ae5b635f9545e72d17d436a0ec0e926a86829b2f0dadb49930208e7f9c88100cf1bb612187
|
7
|
+
data.tar.gz: 02ee3b0187a8e862b6499b2caafc41757bb9ca97bc97a23f2c4bbac4add732e6bc3b1803f16b2763a05abf601f586c4523c65762aafd29d6b95ba4b192434270
|
@@ -1,7 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
require 'amazon/ecs'
|
3
3
|
require 'singleton'
|
4
|
-
require 'pathname'
|
5
4
|
|
6
5
|
module Jekyll
|
7
6
|
module Amazon
|
@@ -33,13 +32,12 @@ module Jekyll
|
|
33
32
|
|
34
33
|
def initialize
|
35
34
|
@result_cache = {}
|
36
|
-
|
37
|
-
@cache_dir.mkdir_p
|
35
|
+
FileUtils.mkdir_p(CACHE_DIR)
|
38
36
|
end
|
39
37
|
|
40
38
|
def setup(context)
|
41
39
|
context.registers[:site]
|
42
|
-
::Amazon::Ecs.debug = true
|
40
|
+
# ::Amazon::Ecs.debug = true
|
43
41
|
::Amazon::Ecs.configure do |options|
|
44
42
|
options[:associate_tag] = ECS_ASSOCIATE_TAG
|
45
43
|
options[:AWS_access_key_id] = AWS_ACCESS_KEY_ID
|
@@ -66,14 +64,14 @@ module Jekyll
|
|
66
64
|
private
|
67
65
|
|
68
66
|
def read_cache(asin)
|
69
|
-
path =
|
70
|
-
return nil unless
|
71
|
-
Marshal.load(
|
67
|
+
path = File.join(CACHE_DIR, asin)
|
68
|
+
return nil unless File.exist?(path)
|
69
|
+
File.open(path, 'r') { |f| Marshal.load(f.read) }
|
72
70
|
end
|
73
71
|
|
74
72
|
def write_cache(asin, obj)
|
75
|
-
path =
|
76
|
-
|
73
|
+
path = File.join(CACHE_DIR, asin)
|
74
|
+
File.open(path, 'w') { |f| f.write(Marshal.dump(obj)) }
|
77
75
|
end
|
78
76
|
|
79
77
|
def retry_api
|