Skip to content

Commit af85461

Browse files
committed
cache on the class, not the instance
1 parent 9153e43 commit af85461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/jekyll-gist/gist_tag.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def fetch_raw_code(gist_id, filename = nil)
9090
private
9191

9292
def code_from_api(gist_id, filename = nil)
93-
gist = client.gist gist_id
93+
gist = GistTag.client.gist gist_id
9494

9595
file = if filename.to_s.empty?
9696
# No file specified, return the value of the first key/value pair
@@ -106,7 +106,7 @@ def code_from_api(gist_id, filename = nil)
106106
file[:content] if file
107107
end
108108

109-
def client
109+
def self.client
110110
@client ||= Octokit::Client.new :access_token => ENV["JEKYLL_GITHUB_TOKEN"]
111111
end
112112
end

0 commit comments

Comments
 (0)