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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: daf750e4a6aa1a63d92cdee1044a691509e66a5b
4
- data.tar.gz: 10fba900462e7d30740a187942e8e21795479325
3
+ metadata.gz: 1ef137acb5fd8708b3c63a81a1e9c96c3f7dbaeb
4
+ data.tar.gz: 7f47c7f63fd968b294b36fabfb16682778021188
5
5
  SHA512:
6
- metadata.gz: 318c21b3179feb0f053da879342c9e36957cf44ddae43de4a96265ef602cddaf60db0187b74e449f72302c6d005f5da86b40faccdeeccd32ee1f4590cda2678a
7
- data.tar.gz: c103d17e6394815b9603d5a54765ad357c49862f33536a59c392c9f5bfdc4d119e139bb33c903cc4baf59b48d650277dce1029ed668670750537796bb3d56b68
6
+ metadata.gz: 7dbe628ed0f35068dffd023b3e2cac9a00d4dc9bbe615924751ebc152e080691f5f5d225ffe7c611613e717ccf7d38e4f06c816442cf1ea92c63174d2b7482d0
7
+ data.tar.gz: 4a91dbb0b276262cc77d76a55f847c5a25424d2882beadf6c4c20578e4cd17eee4db3da7a177a6d29636f9e44675d2fd5ace47b55bb18f48a3ccf45a4ae2826e
@@ -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__
@@ -1,3 +1,4 @@
1
+ require 'set'
1
2
  require 'thread'
2
3
  require 'futuroscope/worker'
3
4
 
@@ -1,3 +1,3 @@
1
1
  module Futuroscope
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -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.5
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-08-25 00:00:00.000000000 Z
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: