brite-api 0.0.2 → 0.0.3

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: ca64f3e25faa0daca60ba21b6f9e5157cb5ac233
4
- data.tar.gz: 3c7952590be9b3b447e76f205ef9fadc9ba73a20
3
+ metadata.gz: 1acf3e74ce42f8709b58066c6e105068efac6f7a
4
+ data.tar.gz: 67e41782e45e8b2e435dc217a88faba3f753fc8d
5
5
  SHA512:
6
- metadata.gz: e036a814c627332c4fd8bffb6f5b53f6408ddc133ca2569b61635e86bac5146627272fc8c5287fcbb4a607ce41b2979f1c46e1701123ca6992a0184ef17f69b0
7
- data.tar.gz: 6ed26407e6f1cad5ad1d417ecd9dee97f2eb0de09c1cbf036212c0f2f237acfb01917753f8d403a71b512782fe1ad524f078f6c6946f217a88a93f03f8ed89dd
6
+ metadata.gz: 80ff8a394d81ccca6f501229420b0ec43823df41ef5b16552934f76d5bd8f2032a6ec02f4165cbc541b10a84f618c5155cf6f4a008dac7ae420a4e7b827c8ef0
7
+ data.tar.gz: 6e052c721ce40278e7120966f2bc8d471a6e9531dcad5dc1c756bf77e4f1948bd5467cc5ac22f5f3f2ddb04e46b7b6ea70fb90d2c208284e250eaffe46f5f7f3
@@ -31,17 +31,26 @@ module BriteAPI
31
31
 
32
32
  data = @data.select{ |_, v| v != nil }
33
33
 
34
- # send async requests
35
- threads = []
36
- data.each do |key, value|
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
@@ -1,3 +1,3 @@
1
1
  module BriteAPI
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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-01 00:00:00.000000000 Z
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.0
137
+ rubygems_version: 2.0.5
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Ruby client for BriteVerify API