storehouse_client 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -99,6 +99,7 @@ module StorehouseClient
99
99
 
100
100
  def post(path, data)
101
101
  begin
102
+ tries ||= 3
102
103
  result = @resource[path].post data.to_json, content_type: :json, accept: :json
103
104
  rescue RestClient::Unauthorized => @error
104
105
  return nil
@@ -106,12 +107,16 @@ module StorehouseClient
106
107
  return nil
107
108
  rescue RestClient::ResourceNotFound => @error
108
109
  return nil
110
+ rescue Errno::ECONNREFUSED => @error
111
+ sleep 2
112
+ retry unless (tries -= 1).zero?
109
113
  end
110
114
 
111
115
  parse_result result
112
116
  end
113
117
 
114
118
  def put(path, data)
119
+ tries ||= 3
115
120
  begin
116
121
  result = @resource[path].put data.to_json, content_type: :json, accept: :json
117
122
  rescue RestClient::Unauthorized => @error
@@ -120,18 +125,25 @@ module StorehouseClient
120
125
  return nil
121
126
  rescue RestClient::ResourceNotFound => @error
122
127
  return nil
128
+ rescue Errno::ECONNREFUSED => @error
129
+ sleep 2
130
+ retry unless (tries -= 1).zero?
123
131
  end
124
132
 
125
133
  parse_result result
126
134
  end
127
135
 
128
136
  def get(path)
137
+ tries ||= 3
129
138
  begin
130
139
  result = @resource[path].get content_type: :json, accept: :json
131
140
  rescue RestClient::Unauthorized => @error
132
141
  return nil
133
142
  rescue RestClient::ResourceNotFound => @error
134
143
  return nil
144
+ rescue Errno::ECONNREFUSED => @error
145
+ sleep 2
146
+ retry unless (tries -= 1).zero?
135
147
  end
136
148
 
137
149
  parse_result result
@@ -1,5 +1,5 @@
1
1
  module StorehouseClient
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  AUTHORS = ['Jon Gillies']
4
4
  EMAIL = %w(supercoder@gmail.com)
5
5
  DESCRIPTION = %q{This the API client to the Storehouse application.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: storehouse_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-11 00:00:00.000000000 Z
12
+ date: 2013-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70264738461980 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70264738461980
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: lorem
27
- requirement: &70264738461480 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *70264738461480
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: gemcutter
38
- requirement: &70264738460980 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ! '>='
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70264738460980
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: dnsruby
49
- requirement: &70264738460520 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ! '>='
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '0'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70264738460520
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: fog
60
- requirement: &70264738460040 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,10 +85,15 @@ dependencies:
65
85
  version: '0'
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70264738460040
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: rest-client
71
- requirement: &70264738459580 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
72
97
  none: false
73
98
  requirements:
74
99
  - - ! '>='
@@ -76,10 +101,15 @@ dependencies:
76
101
  version: '0'
77
102
  type: :runtime
78
103
  prerelease: false
79
- version_requirements: *70264738459580
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
80
110
  - !ruby/object:Gem::Dependency
81
111
  name: crack
82
- requirement: &70264738459140 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
83
113
  none: false
84
114
  requirements:
85
115
  - - ! '>='
@@ -87,7 +117,12 @@ dependencies:
87
117
  version: '0'
88
118
  type: :runtime
89
119
  prerelease: false
90
- version_requirements: *70264738459140
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
91
126
  description: This the API client to the Storehouse application.
92
127
  email:
93
128
  - supercoder@gmail.com
@@ -124,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
159
  version: '0'
125
160
  requirements: []
126
161
  rubyforge_project:
127
- rubygems_version: 1.8.15
162
+ rubygems_version: 1.8.23
128
163
  signing_key:
129
164
  specification_version: 3
130
165
  summary: API client to the Storehouse