Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit cbd2794

Browse files
committed
set file storer for caching
1 parent 6e910a3 commit cbd2794

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apk add --update openssh-client
88
RUN apk add --update perl
99
RUN apk add --update ruby
1010
RUN apk add --update ruby-json
11-
RUN gem install octokit httpclient faraday-http-cache --no-rdoc --no-ri
11+
RUN gem install octokit activesupport httpclient faraday-http-cache --no-rdoc --no-ri
1212

1313
ADD assets/ /opt/resource/
1414
RUN chmod +x /opt/resource/*

Dockerfile.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apk add --update openssh-client
88
RUN apk add --update perl
99
RUN apk add --update ruby
1010
RUN apk add --update ruby-json
11-
RUN gem install octokit httpclient faraday-http-cache --no-rdoc --no-ri
11+
RUN gem install octokit activesupport httpclient faraday-http-cache --no-rdoc --no-ri
1212

1313
ADD assets/ /opt/resource/
1414
RUN chmod +x /opt/resource/*

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
33
gem 'octokit'
44
gem 'httpclient'
55
gem 'faraday-http-cache'
6+
gem 'activesupport'
67

78
group :development do
89
gem 'pry'

Gemfile.lock

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
activesupport (5.1.2)
5+
concurrent-ruby (~> 1.0, >= 1.0.2)
6+
i18n (~> 0.7)
7+
minitest (~> 5.1)
8+
tzinfo (~> 1.1)
49
addressable (2.5.0)
510
public_suffix (~> 2.0, >= 2.0.2)
611
ast (2.3.0)
712
coderay (1.1.1)
13+
concurrent-ruby (1.0.5)
814
cookiejar (0.3.3)
915
crack (0.4.3)
1016
safe_yaml (~> 1.0.0)
@@ -28,7 +34,9 @@ GEM
2834
hashdiff (0.3.0)
2935
http_parser.rb (0.6.0)
3036
httpclient (2.8.2.4)
37+
i18n (0.8.6)
3138
method_source (0.8.2)
39+
minitest (5.10.2)
3240
multi_json (1.12.1)
3341
multipart-post (2.0.0)
3442
octokit (4.6.0)
@@ -77,6 +85,9 @@ GEM
7785
addressable (>= 2.3.5, < 2.6)
7886
faraday (~> 0.8, < 0.10)
7987
slop (3.6.0)
88+
thread_safe (0.3.6)
89+
tzinfo (1.2.3)
90+
thread_safe (~> 0.1)
8091
unicode-display_width (1.1.1)
8192
webmock (2.1.0)
8293
addressable (>= 2.3.6)
@@ -87,6 +98,7 @@ PLATFORMS
8798
ruby
8899

89100
DEPENDENCIES
101+
activesupport
90102
faraday-http-cache
91103
httpclient
92104
octokit
@@ -98,4 +110,4 @@ DEPENDENCIES
98110
webmock
99111

100112
BUNDLED WITH
101-
1.14.6
113+
1.15.1

assets/lib/commands/base.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
require 'faraday'
22
require 'octokit'
33
require 'faraday-http-cache'
4+
require 'active_support/cache'
5+
require 'active_support/cache/file_store'
46

57
stack = Faraday::RackBuilder.new do |builder|
6-
builder.use Faraday::HttpCache, serializer: Marshal, shared_cache: false
8+
storer = ActiveSupport::Cache::FileStore.new('/tmp', namespace: 'pullrequest')
9+
builder.use Faraday::HttpCache, store: storer, serializer: Marshal, shared_cache: true
710
builder.use Octokit::Response::RaiseError
811
# httpclient and excon are the only Faraday adpater which support
912
# the no_proxy environment variable atm

0 commit comments

Comments
 (0)