jekyll-fetch 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
  SHA256:
3
- metadata.gz: 78fbc096ac10a2e0de1821d788ef39d7d3aac90d548f991a86fb2321648b64de
4
- data.tar.gz: 0c64327b464de1bf621164c567e9aed699397b39efdeb4806f7a1015f81176d4
3
+ metadata.gz: c48088f55e630fa5865535fdcf4eb47bfef25c876d965f1e254199d0977a5160
4
+ data.tar.gz: 96f9f13e4d5577f53d81c5697b2bf3298a5a8e5c8bb479ab61dcc9d57a3a053f
5
5
  SHA512:
6
- metadata.gz: 693b15d089811dcc193f2857156049ad0a1d53b2df37ebd7f26dce5c4b253f4b4c0bd5c51117a8029677ea288f63c2544dc65b18f2663903b963094bc9f9e478
7
- data.tar.gz: 968522b19ff9b1e5b804cadbbc6cf8e59986ebc14c62f3da892324456984a02eeb46dd1634cc3a0e7c55fa3137d41031db3cf9691d3a38f41c2d26af02cf19cb
6
+ metadata.gz: d3b8b051a198b602949f1100341291754f02ec9c479ffdb9c2936d081622fe9a0bcc4055bfe413a61bc80514c35fabe7b75da68066d94853abe69691c210cc8b
7
+ data.tar.gz: 518db64573f46664c8c39dc20ce9a60ec282b7d67ef2a23a24704f2a2032c1f2b39714ce763eac6810758b3eb69a36774fba49f2d47e5942309092e3ff51f76f
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllFetch
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/jekyll-fetch.rb CHANGED
@@ -12,11 +12,12 @@ module Jekyll
12
12
  # You should choose better exception.
13
13
  raise ArgumentError, 'HTTP redirect too deep' if limit == 0
14
14
 
15
+ puts uri_str
15
16
  url = URI.parse(uri_str)
16
17
  req = Net::HTTP::Get.new(url.path, { 'User-Agent' => 'Mozilla/5.0 (etc...)' })
17
18
  response = Net::HTTP.start(url.host, url.port, use_ssl: true) { |http| http.request(req) }
18
19
  case response
19
- when Net::HTTPSuccess then response.body
20
+ when Net::HTTPSuccess then response.body.force_encoding("UTF-8")
20
21
  when Net::HTTPRedirection then fetch(response['location'], limit - 1)
21
22
  else
22
23
  response.error!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-fetch
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
  - pcouy