oil_fetcher 0.1.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/oil_fetcher/configuration.rb +1 -1
- data/lib/oil_fetcher/fetcher.rb +8 -3
- data/lib/oil_fetcher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53274b7a567c7669b3a4bc0e8dfc37dc52f7af6d
|
4
|
+
data.tar.gz: 62381e1fb881138aebd66f783f467d020f8c0e54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a2b7bf87617d0d6334ba789249cc9a10c2e704d11ffbc5ad5a22ddbc9b7f74b7f366e79b061cff72383837e0e4ec4bd77c526f6d43175eea60706aa7db6801e
|
7
|
+
data.tar.gz: 89517c22dcda902a0ab40c4274499194086ec4f32eb5a25b31f60f8896ab15b87f5afc26e59499f8f18ad0900c30e14277141f1ce681f4f41e7f81742ba2902e
|
data/README.md
CHANGED
data/lib/oil_fetcher/fetcher.rb
CHANGED
@@ -3,7 +3,11 @@ require 'json'
|
|
3
3
|
module OilFetcher
|
4
4
|
class Fetcher
|
5
5
|
def call
|
6
|
-
json = fetch_json
|
6
|
+
json = fetch_json(
|
7
|
+
OilFetcher.configuration.uri,
|
8
|
+
OilFetcher.configuration.proxy_host,
|
9
|
+
OilFetcher.configuration.proxy_port
|
10
|
+
)
|
7
11
|
return unless json
|
8
12
|
|
9
13
|
Oil.new(extract_params(json))
|
@@ -11,9 +15,10 @@ module OilFetcher
|
|
11
15
|
|
12
16
|
private
|
13
17
|
|
14
|
-
def fetch_json(uri)
|
18
|
+
def fetch_json(uri, proxy_host, proxy_port)
|
15
19
|
uri = URI(uri)
|
16
|
-
|
20
|
+
http = Net::HTTP::Proxy(proxy_host, proxy_port)
|
21
|
+
file = http.get(uri)
|
17
22
|
return unless file
|
18
23
|
|
19
24
|
JSON.parse file
|
data/lib/oil_fetcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oil_fetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yana Petrova
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|