barney 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,10 @@
1
+ 2011-04-23 Robert Gleeson <rob@flowof.info>
2
+
3
+ * lib/barney/share.rb:
4
+ Fix a bug where Barney::Share#share could return nil.
5
+ If there were no duplicates in @variables, `nil` would be returned.
6
+
7
+
1
8
  2011-04-21 Robert Gleeson <rob@flowof.info>
2
9
 
3
10
  * ChangeLog:
data/README.md CHANGED
@@ -60,12 +60,12 @@ I'm following the [Semantic Versioning](http://www.semver.org) policy.
60
60
  **API**
61
61
 
62
62
  * [master (git)](http://rubydoc.info/github/robgleeson/barney/master/)
63
+ * [0.9.1](http://rubydoc.info/gems/barney/0.9.1/)
63
64
  * [0.9.0](http://rubydoc.info/gems/barney/0.9.0/)
64
65
  * [0.8.1](http://rubydoc.info/gems/barney/0.8.1/)
65
66
  * [0.8.0](http://rubydoc.info/gems/barney/0.8.0/)
66
67
  * [0.7.0](http://rubydoc.info/gems/barney/0.7.0)
67
68
  * [0.6.0](http://rubydoc.info/gems/barney/0.6.0)
68
- * [0.5.0](http://rubydoc.info/gems/barney/0.5.0)
69
69
  * …
70
70
 
71
71
 
data/lib/barney/share.rb CHANGED
@@ -55,6 +55,7 @@ module Barney
55
55
  def share *variables
56
56
  @variables.push *variables.map(&:to_sym)
57
57
  @variables.uniq!
58
+ @variables
58
59
  end
59
60
 
60
61
  # Removes a variable or constant from being shared between two processes.
@@ -65,6 +66,7 @@ module Barney
65
66
  @streams.delete_if { |stream| stream.variable == variable }
66
67
  @variables.delete variable
67
68
  end
69
+
68
70
  @variables
69
71
  end
70
72
 
@@ -102,14 +104,16 @@ module Barney
102
104
  value = eval "#{stream.variable} = Barney::Share.value", @context
103
105
  @history.push HistoryItem.new(stream.variable, value)
104
106
  end
105
- @streams.clear
106
107
  end
108
+
109
+ @streams.clear
107
110
  end
108
111
  alias_method :sync, :synchronize
109
112
 
110
113
  private
111
114
 
112
115
  # Manages the creation of pipes used for cross-process communcation.
116
+ # @return [void]
113
117
  # @api private
114
118
  def spawn_pipes
115
119
  @variables.each do |variable|
data/lib/barney.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'barney/share'
2
2
 
3
3
  module Barney
4
- VERSION = '0.9.0'
4
+ VERSION = '0.9.1'
5
5
  end
6
6
 
@@ -31,7 +31,7 @@ describe Barney::Share do
31
31
  x = 5
32
32
  @instance.share :x
33
33
  @instance.fork { }
34
- assert true, @instance.instance_variable_get(:@streams).first.variable == :x
34
+ assert_equal :x, @instance.instance_variable_get(:@streams).first.variable
35
35
 
36
36
  @instance.unshare :x
37
37
  @instance.fork { }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: barney
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.0
5
+ version: 0.9.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Robert Gleeson
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-21 00:00:00 +01:00
13
+ date: 2011-04-23 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency