iprocess 5.0.2 → 5.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,8 @@
1
1
  # This file is for Travis (travis-ci.org).
2
+ group :default, :development do
3
+ gem 'yard'
4
+ gem 'redcarpet'
5
+ gem 'rake'
6
+ end
2
7
  source :rubygems
3
8
  gemspec
data/README.md CHANGED
@@ -26,9 +26,11 @@ In this example three subprocesses are spawned. The return value of the block,
26
26
  even though executed in a subprocess, is returned to the parent process as long
27
27
  as it may be serialized by Marshal(or the serializer of your choice, this is
28
28
  configurable):
29
-
30
- messages = IProcess.spawn(3) { {msg: "hello"} }
31
- p messages # => [{msg: "hello"}, {msg: "hello"}, {msg: "hello"}]
29
+
30
+ ```ruby
31
+ messages = IProcess.spawn(3) { {msg: "hello"} }
32
+ p messages # => [{msg: "hello"}, {msg: "hello"}, {msg: "hello"}]
33
+ ```
32
34
 
33
35
  __2.__
34
36
 
@@ -36,40 +38,44 @@ You can spawn a subprocess with a block or with any object that responds to
36
38
  `#call`. If you had a worker that was too complicated as a block you could
37
39
  try this:
38
40
 
39
- class Worker
40
- def initialize
41
- @num = 1
42
- end
43
-
44
- def call
45
- @num + 1
46
- end
47
- end
48
- IProcess.spawn 5, Worker.new # => [2, 2, 2, 2, 2]
49
-
41
+ ```ruby
42
+ class Worker
43
+ def initialize
44
+ @num = 1
45
+ end
46
+
47
+ def call
48
+ @num + 1
49
+ end
50
+ end
51
+ IProcess.spawn 5, Worker.new # => [2, 2, 2, 2, 2]
52
+ ```
50
53
  __3.__
51
54
 
52
55
  A demo of how you would spawn two subprocesses asynchronously.
53
- Note that although the subprocesses are spawned asynchrounsly you can still
54
- communicate by using an API tailored to asynchrounous programming.
55
-
56
- class Inbox
57
- def initialize() @msgs = [] end
58
- @msgs = []
59
- end
60
-
61
- def msgs
62
- @msgs
63
- end
64
-
65
- def recv(msg)
66
- @msgs << msg
67
- end
68
- end
69
- inbox = Inbox.new
70
- IProcess.spawn!(2, Inbox.new) { Process.pid }
71
- sleep 0.1
72
- p inbox.msgs
56
+ Although the subprocesses are spawned asynchrounsly you can still
57
+ communicate by using an API tailored to asynchrounous programming. The example
58
+ may not be the best, though:
59
+
60
+ ```ruby
61
+ class Inbox
62
+ def initialize
63
+ @msgs = []
64
+ end
65
+
66
+ def msgs
67
+ @msgs
68
+ end
69
+
70
+ def recv(msg)
71
+ @msgs << msg
72
+ end
73
+ end
74
+ inbox = Inbox.new
75
+ IProcess.spawn!(2, Inbox.new) { Process.pid }
76
+ sleep 0.1
77
+ p inbox.msgs
78
+ ```
73
79
 
74
80
  __SERIALIZERS__
75
81
 
data/iprocess.gemspec CHANGED
@@ -21,8 +21,4 @@ Gem::Specification.new do |s|
21
21
  s.required_ruby_version = '>= 1.9.2'
22
22
 
23
23
  s.add_runtime_dependency 'ichannel', '~> 1.0.0'
24
- s.add_development_dependency 'yard' , '~> 0.7'
25
- s.add_development_dependency 'minitest', '~> 2.6'
26
- s.add_development_dependency 'rake', '~> 0.9.2'
27
- s.add_development_dependency 'kramdown'
28
24
  end
@@ -1,3 +1,3 @@
1
1
  class IProcess
2
- VERSION = '5.0.2'
2
+ VERSION = '5.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iprocess
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.2
4
+ version: 5.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ichannel
@@ -27,70 +27,6 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.0.0
30
- - !ruby/object:Gem::Dependency
31
- name: yard
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: '0.7'
38
- type: :development
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '0.7'
46
- - !ruby/object:Gem::Dependency
47
- name: minitest
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ~>
52
- - !ruby/object:Gem::Version
53
- version: '2.6'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: '2.6'
62
- - !ruby/object:Gem::Dependency
63
- name: rake
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ~>
68
- - !ruby/object:Gem::Version
69
- version: 0.9.2
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: 0.9.2
78
- - !ruby/object:Gem::Dependency
79
- name: kramdown
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :development
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
30
  description: A number of abstractions on top of spawning subprocesses and interprocess
95
31
  communication.
96
32
  email: rob@flowof.info