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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65203fc48f1b59dc053e3a1fd9c644eeeb64fa3c
4
- data.tar.gz: 8ac11f7090972f18e29af3f053adb534521edad8
3
+ metadata.gz: eeeadf3f741c62914fe9dec55ab94e35051aea77
4
+ data.tar.gz: f0ce83cc0485c7da731d0415f8e2a1af98a0f747
5
5
  SHA512:
6
- metadata.gz: 2459a91fd0f9c59d2cf266f1c9f8c6956f57440e21bc834164d054ecbc2ee30db9f0ab820564a275c5435fc5144dcb4f55fefd56afcc60c0b5b8015801d40ea9
7
- data.tar.gz: f6263a5a8f4ebcf06e79a870924a16bafc9e05db557abb3abf13ed1837ffaf67558aae3f3b48a111f421921c937b4e7f53619ee6b6587fc56d867e1e84b73752
6
+ metadata.gz: d598e6c1435655359764f0da9694f0adfec08853d6f88ff9db3935053f405f4d066185c9f27037009f6bf1073b56562bdfeabba8c336ab48e0a2bf212fb2df02
7
+ data.tar.gz: 3d5342b8cbe8bf7584798654107643555a0f73245feeb523fa39fe007f85ba1b25640e214ddb21bcc5c60509a742a7989ad02720c120dc4a142b73c21db7cc81
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.14
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.14 ruby lib
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.14"
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"]
@@ -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
- response = @client.request(method, "#{path}.json", body: body, query: prepare_options(query), follow_redirect: true)
36
- Fire::Connection::Response.new(response)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fire-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitaly Tarasenko