wolfpack 1.0.3 → 1.0.4

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: 5c5de1d3dc34da00b055dd50a18cbf875a7f1fd6
4
- data.tar.gz: ba2ec4a59e63226ca76161171c9fa419cd4ef638
3
+ metadata.gz: af5095b20971b9865d429a28388e3686ff658be8
4
+ data.tar.gz: fdc140072db1bbbccc3ce4760db8128891fc09c9
5
5
  SHA512:
6
- metadata.gz: ce6ce7f8fabad337fb84f0b8410ca402400d9529c9d965d37c519e65170a2c8f1fc89d8feb8fc54282991dfed6be05f503a69a97ed3c59ada4bb82ce8242c260
7
- data.tar.gz: 3d07b16417bd20d8e587aaacdf65bf629c951fd9e368c3d81727f9223a0001236662021d6792a50ffc0a75a1af9ce3bafa425f0ca8742d9d9ccedf76dab9d5ac
6
+ metadata.gz: 3c236e6822e97d0bd5874613aacdf5d5d769516156450fc696c6d2e96abe1babd9208b6d2622e7a00a668c0ad51236092cd8e3f8b874dd05646b6b7ce8b43773
7
+ data.tar.gz: 902656ff26d463d9fb2f0e50f21ed4edf367746d51c1c5febc294bd36e030a72a98a15903520fd4a571d3578b931ad43bf21ecd4605619d5b8fd9a76584b2db5
@@ -14,7 +14,7 @@ after_fork do |n, args|
14
14
 
15
15
  # We'll feed in a list of specs that we want to run from stdin,
16
16
  # concat with a space, and output into an ENV var that rspec will pick up.
17
- ENV['SPEC_FILES'] = args.join(' ')
17
+ ENV['SPEC_FILES'] = args.map(&:chomp).join(" ")
18
18
 
19
19
  # And whatever else you need to deal with...
20
20
  end
@@ -23,7 +23,7 @@ __END__
23
23
 
24
24
  Now you're ready to run this! Try something like this on your CLI:
25
25
 
26
- $ bundle exec wolfpack exec "rake db:setup rake db:schema:load; rspec $SPEC_FILES;"
26
+ $ bundle exec wolfpack exec "rake db:setup db:schema:load; rspec $SPEC_FILES;"
27
27
 
28
28
  and you're off to the races! In practice its probably not that easy though because
29
- specs are generally not developed initially with concurrency in mind.
29
+ specs are generally not developed initially with concurrency in mind.
data/lib/wolfpack.rb CHANGED
@@ -55,10 +55,12 @@ module Wolfpack
55
55
  partions = args ? partition(args, processes) : Array.new(processes){[]}
56
56
 
57
57
  # Now run the command with the processes.
58
- Parallel.each_with_index(partions, :in_processes => processes) do |args, n|
58
+ successes = Parallel.map_with_index(partions, :in_processes => processes) do |args, n|
59
59
  after_fork.call(n, args) if after_fork
60
60
  system @command
61
61
  end
62
+
63
+ successes.all?
62
64
  end
63
65
 
64
66
  # Configures the runner's by reading a configuration file and eval-ing
@@ -85,12 +87,16 @@ module Wolfpack
85
87
  method_options %w( config -c ) => :string
86
88
  method_options %w( processes -n ) => :integer
87
89
  method_options %w( args -a ) => :array
90
+
91
+ RETURN_CODE_SUCCESS = 0
92
+ RETURN_CODE_FAILURE = 1
88
93
  def exec(command)
89
94
  # Parse out an integer for the # of processors the user specifies since
90
95
  # thor doesn't return an integer for its params.
91
96
  processes = options[:processes].to_i if options[:processes]
92
97
 
93
- Wolfpack::Runner.new(command, options[:args], options[:config]).run(processes)
98
+ success = Wolfpack::Runner.new(command, options[:args], options[:config]).run(processes)
99
+ exit(success ? RETURN_CODE_SUCCESS : RETURN_CODE_FAILURE)
94
100
  end
95
101
 
96
102
  desc "version", "Wolfpack version"
@@ -1,3 +1,3 @@
1
1
  module Wolfpack
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolfpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -122,10 +122,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  requirements: []
124
124
  rubyforge_project:
125
- rubygems_version: 2.4.5
125
+ rubygems_version: 2.2.3
126
126
  signing_key:
127
127
  specification_version: 4
128
128
  summary: Run ruby tasks in parallel
129
129
  test_files:
130
130
  - spec/lib/wolfpack.rb
131
131
  - spec/spec_helper.rb
132
+ has_rdoc: