brite-api 0.0.2 → 0.0.3
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/lib/brite-api/contact.rb +15 -6
- data/lib/brite-api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1acf3e74ce42f8709b58066c6e105068efac6f7a
|
4
|
+
data.tar.gz: 67e41782e45e8b2e435dc217a88faba3f753fc8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ff8a394d81ccca6f501229420b0ec43823df41ef5b16552934f76d5bd8f2032a6ec02f4165cbc541b10a84f618c5155cf6f4a008dac7ae420a4e7b827c8ef0
|
7
|
+
data.tar.gz: 6e052c721ce40278e7120966f2bc8d471a6e9531dcad5dc1c756bf77e4f1948bd5467cc5ac22f5f3f2ddb04e46b7b6ea70fb90d2c208284e250eaffe46f5f7f3
|
data/lib/brite-api/contact.rb
CHANGED
@@ -31,17 +31,26 @@ module BriteAPI
|
|
31
31
|
|
32
32
|
data = @data.select{ |_, v| v != nil }
|
33
33
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
threads << Thread.new(key, value) do |k, v|
|
34
|
+
if data.size == 1
|
35
|
+
# optimization for single-threaded requests
|
36
|
+
data.each do |k, v|
|
39
37
|
klass = BriteAPI.const_get(k.to_s.capitalize + "APIClient")
|
40
38
|
@response[k] = klass.new(@api_key, @options).verify(v)
|
41
39
|
end
|
40
|
+
else
|
41
|
+
# send async requests
|
42
|
+
threads = []
|
43
|
+
data.each do |key, value|
|
44
|
+
|
45
|
+
threads << Thread.new(key, value) do |k, v|
|
46
|
+
klass = BriteAPI.const_get(k.to_s.capitalize + "APIClient")
|
47
|
+
@response[k] = klass.new(@api_key, @options).verify(v)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
threads.each { |thr| thr.join }
|
42
52
|
end
|
43
53
|
|
44
|
-
threads.each { |thr| thr.join }
|
45
54
|
|
46
55
|
self
|
47
56
|
end
|
data/lib/brite-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brite-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Shapiotko
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
version: 1.3.6
|
135
135
|
requirements: []
|
136
136
|
rubyforge_project:
|
137
|
-
rubygems_version: 2.0.
|
137
|
+
rubygems_version: 2.0.5
|
138
138
|
signing_key:
|
139
139
|
specification_version: 4
|
140
140
|
summary: Ruby client for BriteVerify API
|