Skip to content

Commit 7bc6977

Browse files
committed
Enable HTTP client caching.
That should help accross several nanoc runs.
1 parent 6aafe7b commit 7bc6977

File tree

10 files changed

+127
-115
lines changed

10 files changed

+127
-115
lines changed

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ gemspec
55
gem "rake", "~> 13.0"
66
gem "minitest", "~> 5.14"
77
gem "webmock", "~> 3.8"
8-
gem "vcr", "~> 5.1.0"
8+
gem "vcr", "~> 5.1.0"
9+
gem "faraday-http-cache"

Gemfile.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ GEM
2323
ddplugin (1.0.2)
2424
diff-lcs (1.3)
2525
equatable (0.6.1)
26-
faraday (1.0.0)
26+
faraday (0.17.3)
2727
multipart-post (>= 1.2, < 3)
28+
faraday-http-cache (2.0.0)
29+
faraday (~> 0.8)
2830
front_matter_parser (0.2.1)
2931
hamster (3.0.0)
3032
concurrent-ruby (~> 1.0)
@@ -86,7 +88,7 @@ GEM
8688
tty-platform (0.3.0)
8789
tty-which (0.4.2)
8890
vcr (5.1.0)
89-
webmock (3.8.2)
91+
webmock (3.8.3)
9092
addressable (>= 2.3.6)
9193
crack (>= 0.3.2)
9294
hashdiff (>= 0.4.0, < 2.0.0)
@@ -96,6 +98,7 @@ PLATFORMS
9698
ruby
9799

98100
DEPENDENCIES
101+
faraday-http-cache
99102
minitest (~> 5.14)
100103
nanoc-github!
101104
rake (~> 13.0)

lib/nanoc/github.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ module Github
99
class Source < Nanoc::DataSource
1010
identifier :github
1111

12+
def up
13+
Octokit.middleware = Faraday::RackBuilder.new do |builder|
14+
builder.use Faraday::HttpCache, serializer: Marshal, shared_cache: false
15+
builder.use Octokit::Response::RaiseError
16+
builder.adapter Faraday.default_adapter
17+
end
18+
end
19+
1220
def items
1321
@items ||= begin
1422
repository_items.map do |item|

test/fixtures/test_frontmatter.yml

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/fixtures/test_item.yml

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)