fire-model 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/fire-model.gemspec +2 -2
- data/lib/connection/request.rb +10 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeeadf3f741c62914fe9dec55ab94e35051aea77
|
4
|
+
data.tar.gz: f0ce83cc0485c7da731d0415f8e2a1af98a0f747
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d598e6c1435655359764f0da9694f0adfec08853d6f88ff9db3935053f405f4d066185c9f27037009f6bf1073b56562bdfeabba8c336ab48e0a2bf212fb2df02
|
7
|
+
data.tar.gz: 3d5342b8cbe8bf7584798654107643555a0f73245feeb523fa39fe007f85ba1b25640e214ddb21bcc5c60509a742a7989ad02720c120dc4a142b73c21db7cc81
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.15
|
data/fire-model.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: fire-model 0.0.
|
5
|
+
# stub: fire-model 0.0.15 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "fire-model"
|
9
|
-
s.version = "0.0.
|
9
|
+
s.version = "0.0.15"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
data/lib/connection/request.rb
CHANGED
@@ -6,6 +6,7 @@ module Fire
|
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@client = HTTPClient.new(base_url: Fire.config.base_uri)
|
9
|
+
@client.connect_timeout = Fire.config.timeout || 120
|
9
10
|
@client.default_header['Content-Type'] = 'application/json'
|
10
11
|
end
|
11
12
|
|
@@ -31,9 +32,15 @@ METHOD
|
|
31
32
|
|
32
33
|
protected
|
33
34
|
|
34
|
-
def process(method, path, query={}, body=nil)
|
35
|
-
|
36
|
-
|
35
|
+
def process(method, path, query={}, body=nil, tries=5)
|
36
|
+
raise 'Firebase Connection Failed' if tries.zero?
|
37
|
+
begin
|
38
|
+
response = @client.request(method, "#{path}.json", body: body, query: prepare_options(query), follow_redirect: true)
|
39
|
+
Fire::Connection::Response.new(response)
|
40
|
+
rescue HTTPClient::ConnectTimeoutError
|
41
|
+
puts 'Firebase Connection Timed out.'
|
42
|
+
return process(method, path, query, body, tries-1)
|
43
|
+
end
|
37
44
|
end
|
38
45
|
|
39
46
|
def prepare_options(query_options)
|