futuroscope 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/futuroscope/future.rb +8 -0
- data/lib/futuroscope/pool.rb +1 -0
- data/lib/futuroscope/version.rb +1 -1
- data/spec/futuroscope/future_spec.rb +8 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef137acb5fd8708b3c63a81a1e9c96c3f7dbaeb
|
4
|
+
data.tar.gz: 7f47c7f63fd968b294b36fabfb16682778021188
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dbe628ed0f35068dffd023b3e2cac9a00d4dc9bbe615924751ebc152e080691f5f5d225ffe7c611613e717ccf7d38e4f06c816442cf1ea92c63174d2b7482d0
|
7
|
+
data.tar.gz: 4a91dbb0b276262cc77d76a55f847c5a25424d2882beadf6c4c20578e4cd17eee4db3da7a177a6d29636f9e44675d2fd5ace47b55bb18f48a3ccf45a4ae2826e
|
data/lib/futuroscope/future.rb
CHANGED
@@ -51,6 +51,14 @@ module Futuroscope
|
|
51
51
|
resolved[:value]
|
52
52
|
end
|
53
53
|
|
54
|
+
def marshal_dump
|
55
|
+
resolved_future_value
|
56
|
+
end
|
57
|
+
|
58
|
+
def __setobj__ obj
|
59
|
+
@resolved_future = obj
|
60
|
+
end
|
61
|
+
|
54
62
|
def_delegators :__getobj__, :class, :kind_of?, :is_a?, :clone
|
55
63
|
|
56
64
|
alias_method :future_value, :__getobj__
|
data/lib/futuroscope/pool.rb
CHANGED
data/lib/futuroscope/version.rb
CHANGED
@@ -51,5 +51,13 @@ module Futuroscope
|
|
51
51
|
|
52
52
|
expect(future.future_value.object_id === object.object_id).to eq(true)
|
53
53
|
end
|
54
|
+
|
55
|
+
it "marshals a future object by serializing the result value" do
|
56
|
+
object = [1, 2, 3]
|
57
|
+
future = Future.new{object}
|
58
|
+
dumped = Marshal.dump(future)
|
59
|
+
expect(Marshal.load(dumped).future_value).to eq(object)
|
60
|
+
end
|
61
|
+
|
54
62
|
end
|
55
63
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: futuroscope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep Jaume Rey Peroy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -133,3 +133,4 @@ test_files:
|
|
133
133
|
- spec/futuroscope/worker_spec.rb
|
134
134
|
- spec/futuroscope_spec.rb
|
135
135
|
- spec/spec_helper.rb
|
136
|
+
has_rdoc:
|