jekyll-gist 1.3.0 → 1.3.2

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: a99d6197be7bf77cd1ce83e1df647719fe1e280c
4
- data.tar.gz: 3efd76801e613587054fab6aea4733e8db3f68fd
3
+ metadata.gz: 5963b7bd175984be6980f49a41df4a5afaf42f3c
4
+ data.tar.gz: a03afe7e0dca0f434804410b2a5d272e2d58ca7a
5
5
  SHA512:
6
- metadata.gz: 54b90840b261aae9fd31927bd9d6731caf5485079d478950b8cece2c18667116edc7a959527d6e80086a303db17524f2ba73700b32d61a725e56a355aba29f41
7
- data.tar.gz: fe8c68f496c3228083ef3d513e36b813831725493031abd325688df8103df7dcb3f0c0f26bdb027049eae0e86dc1c1ea7b2e16a278cc0d72746bfb3240b5aa27
6
+ metadata.gz: 4a59ea77c5cc2b645a8fa1513457d80182838d809ad179dc9d09dff7cbb2b9ef1c2ddd1b88cb338ef6e234e15ef72d6f528546690d7398d7ea3dc3f82a2d4c4e
7
+ data.tar.gz: 712bbda80055fa286ab95d466e6aec6f737399b19541ddf07041f8eb84213a361f02547ade0c76565ec0f49eabc7a66ef9ec59415d33fa5f819398f02eb88392
@@ -1,8 +1,13 @@
1
1
  language: ruby
2
2
  script : script/cibuild
3
3
  rvm:
4
+ - 2.2
4
5
  - 2.1
5
6
  - 2.0
6
7
  - 1.9.3
8
+ sudo: false
7
9
  notifications:
8
10
  email: false
11
+ branches:
12
+ only:
13
+ - master
@@ -1,4 +1,13 @@
1
- ## HEAD
1
+ ## 1.3.2 / 2016-08-19
2
+
3
+ * Re-add support for Ruby 1.9.3. Fixes #11 for 1.9.3 (#14)
4
+ * Replaced `OpenURI` with `Net::HTTP` and introduced timeout of 3 seconds (#11)
5
+
6
+ ## 1.3.1 / 2015-08-16 (yanked)
7
+
8
+ * Replaced `OpenURI` with `Net::HTTP` and introduced timeout of 3 seconds (#11)
9
+
10
+ ## 1.3.0 / 2015-08-05
2
11
 
3
12
  * Added an `noscript` fallback for browsers without JavaScript enabled. (#7)
4
13
 
@@ -12,6 +12,8 @@ Gem::Specification.new do |spec|
12
12
  spec.homepage = "https://github.com/jekyll/jekyll-gist"
13
13
  spec.license = "MIT"
14
14
 
15
+ spec.required_ruby_version = '>= 2.0'
16
+
15
17
  spec.files = `git ls-files -z`.split("\x0")
16
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
@@ -1,5 +1,8 @@
1
1
  require 'cgi'
2
- require 'open-uri'
2
+ require 'net/http'
3
+
4
+ Net::OpenTimeout = Class.new(RuntimeError) unless Net.const_defined?(:OpenTimeout)
5
+ Net::ReadTimeout = Class.new(RuntimeError) unless Net.const_defined?(:ReadTimeout)
3
6
 
4
7
  module Jekyll
5
8
  module Gist
@@ -57,13 +60,18 @@ module Jekyll
57
60
  end
58
61
 
59
62
  def fetch_raw_code(gist_id, filename = nil)
63
+ url = "https://gist.githubusercontent.com/#{gist_id}/raw"
64
+ url = "#{url}/#{filename}" unless filename.empty?
60
65
  begin
61
- url = "https://gist.githubusercontent.com/#{gist_id}/raw"
62
- url = "#{url}/#{filename}" unless filename.empty?
63
- open(url).read.chomp
64
- rescue SocketError
65
- nil
66
- rescue OpenURI::HTTPError
66
+ uri = URI(url)
67
+ Net::HTTP.start(uri.host, uri.port,
68
+ use_ssl: uri.scheme == 'https',
69
+ read_timeout: 3, open_timeout: 3) do |http|
70
+ request = Net::HTTP::Get.new uri.to_s
71
+ response = http.request(request)
72
+ response.body
73
+ end
74
+ rescue SocketError, Net::HTTPError, Net::OpenTimeout, Net::ReadTimeout
67
75
  nil
68
76
  end
69
77
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Gist
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-gist
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-05 00:00:00.000000000 Z
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
- version: '0'
118
+ version: '2.0'
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - ">="