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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72c45367933abdb3238152c3a39b71731365c8e4
4
- data.tar.gz: 1641e8404d810292230f42c81145f8a10fa88b8b
3
+ metadata.gz: ca523ca8a7c9ba1c1c54d2d7734216e9ad4c407e
4
+ data.tar.gz: 853231b464607715817ad6898c5aff16bfd06579
5
5
  SHA512:
6
- metadata.gz: a3b7c025dba826e7e76546bf636640c34bd39a30f8d42c4854cd93baf35e0b2bbc9f2afcf1004cf0c0ef312b4ed9c4dd2eaba06acfadb681dbf0337682abcfd1
7
- data.tar.gz: cbc1e9fa948d35dd162ca3bb6d0b0ac1f1086c3e5e4c376ab0d7a0695fc830a2d1718de5aead19f5478ba921df0880924c69114a64d0525b87b42dcf477794a3
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
- @cache_dir = Pathname.new(CACHE_DIR)
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 = @cache_dir.join(asin)
70
- return nil unless path.file?
71
- Marshal.load(path.read)
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 = @cache_dir.join(asin)
76
- path.open { |f| f.write(Marshal.dump(obj)) }
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
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Amazon
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.1.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-amazon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tokzk