childlabor 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/child_labor.rb +6 -4
- metadata +3 -7
data/lib/child_labor.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
module ChildLabor
|
2
|
-
VERSION = '0.0.2'
|
3
|
-
|
4
2
|
def self.subprocess(cmd)
|
5
3
|
t = Task.new(cmd)
|
6
4
|
t.launch
|
@@ -18,7 +16,7 @@ module ChildLabor
|
|
18
16
|
end
|
19
17
|
|
20
18
|
class Task
|
21
|
-
attr_reader :cmd
|
19
|
+
attr_reader :cmd, :stdout, :stderr, :stdin
|
22
20
|
|
23
21
|
def initialize(cmd)
|
24
22
|
@cmd = cmd
|
@@ -62,7 +60,7 @@ module ChildLabor
|
|
62
60
|
end
|
63
61
|
|
64
62
|
def terminated?
|
65
|
-
!running?
|
63
|
+
launched? && !running?
|
66
64
|
end
|
67
65
|
|
68
66
|
def exit_status
|
@@ -90,6 +88,10 @@ module ChildLabor
|
|
90
88
|
@stdout.read(length, buffer)
|
91
89
|
end
|
92
90
|
|
91
|
+
def readline
|
92
|
+
@stdout.readline
|
93
|
+
end
|
94
|
+
|
93
95
|
def read_stderr(length = nil, buffer = nil)
|
94
96
|
@stderr.read(length, buffer)
|
95
97
|
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childlabor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 27
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 3
|
9
|
+
version: 0.0.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Carl Lerche
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-10-05 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -59,7 +57,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
57
|
requirements:
|
60
58
|
- - ">="
|
61
59
|
- !ruby/object:Gem::Version
|
62
|
-
hash: 3
|
63
60
|
segments:
|
64
61
|
- 0
|
65
62
|
version: "0"
|
@@ -68,7 +65,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
65
|
requirements:
|
69
66
|
- - ">="
|
70
67
|
- !ruby/object:Gem::Version
|
71
|
-
hash: 23
|
72
68
|
segments:
|
73
69
|
- 1
|
74
70
|
- 3
|