aweplug 1.0.0.a12 → 1.0.0.a13
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'yaml/store'
|
2
2
|
|
3
|
-
module Aweplug
|
3
|
+
module Aweplug::Cache
|
4
4
|
# Public: A simple caching implementation.
|
5
5
|
# Internally it using a YAML::Store for a file backing. It also saves
|
6
6
|
# data in a hash for the life of the object. Any keys which are
|
@@ -14,7 +14,7 @@ module Aweplug
|
|
14
14
|
#
|
15
15
|
# Examples
|
16
16
|
#
|
17
|
-
# store = Aweplug::YamlFileCache.new
|
17
|
+
# store = Aweplug::Cache::YamlFileCache.new
|
18
18
|
# store.write('key', 'data')
|
19
19
|
# # => 'data'
|
20
20
|
# store.read('key')
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'faraday_middleware'
|
3
|
+
require 'aweplug/cache/yaml_file_cache'
|
3
4
|
|
4
5
|
module Aweplug::Helpers
|
5
6
|
# Public: A helper class for using Searchisko.
|
@@ -27,6 +28,7 @@ module Aweplug::Helpers
|
|
27
28
|
end
|
28
29
|
builder.response :logger if opts[:logging]
|
29
30
|
builder.response :raise_error if opts[:raise_error]
|
31
|
+
builder.use FaradayMiddleware::Caching, Aweplug::Cache::YamlFileCache.new, {}
|
30
32
|
#builder.response :json, :content_type => /\bjson$/
|
31
33
|
builder.adapter opts[:adapter] || :net_http
|
32
34
|
end
|
data/lib/aweplug/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'aweplug/cache/yaml_file_cache'
|
3
3
|
|
4
|
-
describe Aweplug::YamlFileCache do
|
4
|
+
describe Aweplug::Cache::YamlFileCache do
|
5
5
|
specify 'it should respond to #write' do
|
6
6
|
expect(subject).to respond_to :write
|
7
7
|
end
|
@@ -12,7 +12,7 @@ describe Aweplug::YamlFileCache do
|
|
12
12
|
expect(subject).to respond_to :read
|
13
13
|
end
|
14
14
|
context 'with a new instance' do
|
15
|
-
subject = Aweplug::YamlFileCache.new
|
15
|
+
subject = Aweplug::Cache::YamlFileCache.new
|
16
16
|
# destroy any file stores
|
17
17
|
before { File.delete 'tmp/cache.store' if File.exists? 'tmp/cache.store' }
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aweplug
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.a13
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|
@@ -190,7 +190,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
190
190
|
version: '0'
|
191
191
|
segments:
|
192
192
|
- 0
|
193
|
-
hash:
|
193
|
+
hash: 1610229825518981693
|
194
194
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
195
195
|
none: false
|
196
196
|
requirements:
|