web_fetch 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.strong_versions.yml +6 -0
- data/Makefile +11 -2
- data/README.md +25 -6
- data/Rakefile +5 -3
- data/bin/strong_versions +29 -0
- data/config/locales/en.yml +0 -3
- data/docker/Dockerfile +2 -2
- data/lib/web_fetch.rb +4 -1
- data/lib/web_fetch/client.rb +28 -29
- data/lib/web_fetch/concerns/http_helpers.rb +8 -35
- data/lib/web_fetch/gatherer.rb +65 -3
- data/lib/web_fetch/logger.rb +1 -2
- data/lib/web_fetch/promise.rb +3 -3
- data/lib/web_fetch/request.rb +8 -15
- data/lib/web_fetch/resources.rb +12 -22
- data/lib/web_fetch/response.rb +15 -10
- data/lib/web_fetch/retriever.rb +6 -25
- data/lib/web_fetch/server.rb +15 -28
- data/lib/web_fetch/storage.rb +17 -13
- data/lib/web_fetch/storage/memcached.rb +45 -0
- data/lib/web_fetch/storage/memory.rb +35 -0
- data/lib/web_fetch/storage/redis.rb +45 -0
- data/lib/web_fetch/version.rb +1 -1
- data/manifest +64 -0
- data/spec/client_spec.rb +3 -6
- data/spec/gatherer_spec.rb +38 -21
- data/spec/promise_spec.rb +49 -11
- data/spec/resources_spec.rb +14 -17
- data/spec/response_spec.rb +13 -9
- data/spec/retriever_spec.rb +16 -17
- data/spec/router_spec.rb +6 -4
- data/spec/spec_helper.rb +15 -7
- data/spec/storage/memcached_spec.rb +27 -0
- data/spec/storage/memory_spec.rb +5 -0
- data/spec/storage/redis_spec.rb +27 -0
- data/spec/storage/shared_examples.rb +27 -0
- data/web_fetch.gemspec +9 -5
- metadata +75 -11
- data/lib/web_fetch/concerns/event_machine_helpers.rb +0 -57
- data/spec/storage_spec.rb +0 -27
data/spec/storage_spec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
describe WebFetch::Storage do
|
4
|
-
describe '.store' do
|
5
|
-
it 'accepts a key and value to store' do
|
6
|
-
expect do
|
7
|
-
described_class.store(:key, :value)
|
8
|
-
end.to_not raise_error
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
describe '.fetch' do
|
13
|
-
it 'fetches stored values' do
|
14
|
-
described_class.store(:key, :value)
|
15
|
-
expect(described_class.fetch(:key)).to eql :value
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '.delete' do
|
20
|
-
it 'deletes stored values' do
|
21
|
-
described_class.store(:key, :value)
|
22
|
-
expect(described_class.fetch(:key)).to eql :value
|
23
|
-
described_class.delete(:key)
|
24
|
-
expect(described_class.fetch(:key)).to eql nil
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|