wolfpack 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/wolfpack/version.rb +1 -1
  2. data/lib/wolfpack.rb +14 -5
  3. metadata +27 -15
  4. checksums.yaml +0 -7
@@ -1,3 +1,3 @@
1
1
  module Wolfpack
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/wolfpack.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  require "wolfpack/version"
2
2
  require "thor"
3
3
  require "parallel"
4
+ require "timeout"
4
5
 
5
6
  module Wolfpack
6
7
  # Gets the number of "processors" on the current machine. This does not map
7
- # directly to physical cores. For example, a hyperthreaded Intel chip may
8
+ # directly to physical cores. For example, a hyperthreaded Intel chip may
8
9
  # have 2 physical cores but show up as 4 cores.
9
10
  def self.processor_count
10
11
  @processor_count ||= Parallel.processor_count
@@ -20,7 +21,7 @@ module Wolfpack
20
21
  instance_eval(File.read(config_path), config_path)
21
22
  end
22
23
 
23
- # Replace the instances after_fork hook with after_fork
24
+ # Replace the instances after_fork hook with after_fork
24
25
  # from the configuration file.
25
26
  #
26
27
  # @example
@@ -93,13 +94,21 @@ module Wolfpack
93
94
  else
94
95
  # Read from the pipe
95
96
  buffer = ""
96
- until $stdin.eof? do
97
- buffer << $stdin.read
97
+
98
+ begin
99
+ ::Timeout::timeout(2) do
100
+ until $stdin.eof? do
101
+ buffer << $stdin.read
102
+ end
103
+ end
104
+ rescue ::Timeout::Error
105
+ puts "Timeout reading from STDIN. Continuing..."
98
106
  end
107
+
99
108
  buffer.lines
100
109
  end
101
110
 
102
- # If args are passed in, read those and split, otherwise read stdin
111
+ # If args are passed in, read those and split, otherwise read stdin
103
112
  # from a pipe and split by lines.
104
113
 
105
114
  Wolfpack::Runner.new(command, args, options[:config]).run(processes)
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolfpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Brad Gessler
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-06-05 00:00:00.000000000 Z
12
+ date: 2013-07-17 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,57 +30,65 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: '0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: guard-rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - '>='
51
+ - - ! '>='
46
52
  - !ruby/object:Gem::Version
47
53
  version: '0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - '>='
59
+ - - ! '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: thor
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :runtime
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: parallel
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: '0'
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: '0'
83
94
  description: Run stuff in parallel
@@ -105,26 +116,27 @@ files:
105
116
  homepage: https://github.com/polleverywhere/wolfpack
106
117
  licenses:
107
118
  - MIT
108
- metadata: {}
109
119
  post_install_message:
110
120
  rdoc_options: []
111
121
  require_paths:
112
122
  - lib
113
123
  required_ruby_version: !ruby/object:Gem::Requirement
124
+ none: false
114
125
  requirements:
115
- - - '>='
126
+ - - ! '>='
116
127
  - !ruby/object:Gem::Version
117
128
  version: '0'
118
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
+ none: false
119
131
  requirements:
120
- - - '>='
132
+ - - ! '>='
121
133
  - !ruby/object:Gem::Version
122
134
  version: '0'
123
135
  requirements: []
124
136
  rubyforge_project:
125
- rubygems_version: 2.0.3
137
+ rubygems_version: 1.8.23
126
138
  signing_key:
127
- specification_version: 4
139
+ specification_version: 3
128
140
  summary: Run ruby tasks in parallel
129
141
  test_files:
130
142
  - spec/lib/wolfpack.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 931aae52e2cabdbbc6f1e861eabb13477ce114a1
4
- data.tar.gz: 2aa1c44933e7fc4735c32707a55f4d5db1ad956e
5
- SHA512:
6
- metadata.gz: 1fb21574f5ea8a345c1803cafb2535c1b4baf2b64c6c1f83a210fa21ce81ace162887a222ad14b459cd775fddc51ee0012008f445c61ebd712947d85739e67cf
7
- data.tar.gz: 9912bf0f401922b0d00d7f9bf40feb98bc7f8efa02b95e23ea1e4daf42bb54aa40b5eee5a827dcd32931248bf962d20c934e5ee1b94e5e8ca4874b919cbfac36