px-service-client 2.0.5 → 2.0.6

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: 5fe327283cd95cc78f53452238c43c45331cc895
4
- data.tar.gz: 72aa5308880140e008a05f6964afc915f908a3d7
3
+ metadata.gz: 6dd6b2eca80f8716cdade8819b0108e113eb60e1
4
+ data.tar.gz: 295f01a5634dd62f02eefff91c3a2596ceb9c412
5
5
  SHA512:
6
- metadata.gz: c8913fd681f69b0b8fba6106e74b6cf764be7ce870d7e398a87d508fdea5078b911b39894822e2b91718b3fc0cad8376ec82e3ed3797c90a459a9fc35c214be9
7
- data.tar.gz: f6e2a50ec50658976761e5f503504de1d35ad4ec874ddee26c1b316b4c7c6f639ac71df653ad1f5ed3421d82930824c68f1fe29f023785801ade2938de818a73
6
+ metadata.gz: 91c9f30fc3415b1da55c1136a6782d9eca467148057d26d99d5674fd0ffd1f43389bd6a4af03cb87f34073204160ca2284b913df76e12f92c752137f050b8b73
7
+ data.tar.gz: 1a4e115b5c195750f99013b79f81420700e7d30ef537ba5e9755d131a3bbe2d5a8a4242c26b9b6a3cce9c0c10bda7a2048da84a38b33eedeb948c8be9a2a8752
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -15,11 +15,12 @@ module Px::Service::Client
15
15
 
16
16
  if block_given?
17
17
  Fiber.new do
18
- begin
19
- complete(yield)
18
+ value = begin
19
+ yield
20
20
  rescue Exception => ex
21
- complete(ex)
21
+ ex
22
22
  end
23
+ complete(value)
23
24
  end.resume
24
25
  end
25
26
  end
@@ -1,7 +1,7 @@
1
1
  module Px
2
2
  module Service
3
3
  module Client
4
- VERSION = "2.0.5"
4
+ VERSION = "2.0.6"
5
5
  end
6
6
  end
7
7
  end
@@ -7,8 +7,8 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "px-service-client"
8
8
  spec.version = Px::Service::Client::VERSION
9
9
  spec.summary = %q{Common service client behaviours for Ruby applications}
10
- spec.authors = ["Chris Micacchi"]
11
- spec.email = ["chris@500px.com"]
10
+ spec.authors = ["Chris Micacchi", "Zimu Liu"]
11
+ spec.email = ["cdmicacc@gmail.com", "zimu@500px.com"]
12
12
  spec.homepage = ""
13
13
  spec.license = "MIT"
14
14
 
@@ -226,4 +226,27 @@ describe Px::Service::Client::Future do
226
226
  end
227
227
  end
228
228
  end
229
+
230
+ describe '#initialize' do
231
+ context 'when a block is given' do
232
+ context 'when the block returns a value' do
233
+ let(:value) { rand }
234
+
235
+ subject { Px::Service::Client::Future.new { value } }
236
+
237
+ it 'passes the value to the pending call' do
238
+ expect(subject.value).to eq(value)
239
+ end
240
+ end
241
+
242
+ context 'when the block throws an error' do
243
+ let(:error) { RuntimeError.new('error') }
244
+ subject { Px::Service::Client::Future.new { raise error } }
245
+
246
+ it 'passes the error to the pending call' do
247
+ expect(subject.value).to eq(error)
248
+ end
249
+ end
250
+ end
251
+ end
229
252
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: px-service-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Micacchi
8
+ - Zimu Liu
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2016-06-20 00:00:00.000000000 Z
12
+ date: 2017-04-21 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: will_paginate
@@ -194,7 +195,8 @@ dependencies:
194
195
  version: '0.5'
195
196
  description:
196
197
  email:
197
- - chris@500px.com
198
+ - cdmicacc@gmail.com
199
+ - zimu@500px.com
198
200
  executables: []
199
201
  extensions: []
200
202
  extra_rdoc_files: []
@@ -259,7 +261,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
261
  version: '0'
260
262
  requirements: []
261
263
  rubyforge_project:
262
- rubygems_version: 2.4.6
264
+ rubygems_version: 2.6.8
263
265
  signing_key:
264
266
  specification_version: 4
265
267
  summary: Common service client behaviours for Ruby applications