We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 748c701 commit 6ea01cfCopy full SHA for 6ea01cf
lib/jekyll-gist/gist_tag.rb
@@ -59,13 +59,10 @@ def gist_noscript_tag(gist_id, filename = nil)
59
end
60
61
def fetch_raw_code(gist_id, filename = nil)
62
- if filename.empty?
63
- uri = "https://gist.githubusercontent.com/#{gist_id}/raw"
64
- else
65
- uri = "https://gist.githubusercontent.com/#{gist_id}/raw/#{filename}"
66
- end
67
begin
68
- open(uri).read.chomp
+ url = "https://gist.githubusercontent.com/#{gist_id}/raw"
+ url = "#{url}/#{filename}" unless filename.empty?
+ open(url).read.chomp
69
rescue SocketError
70
nil
71
rescue OpenURI::HTTPError
0 commit comments