wip-runner 0.4.0 → 0.4.1

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: 43076f87b14007f06ce003584c7cbe366170e629
4
- data.tar.gz: ea94ff0e8cd0384b234f6921411178d8bc781875
3
+ metadata.gz: 047cd5b865ce10967ae94f5ed4af552d8f48b998
4
+ data.tar.gz: 0aa1d25c90ed59fad266bb53fea8d5aa020930ad
5
5
  SHA512:
6
- metadata.gz: 64247802ae56cdd2c96294c402e8e6aaf7183362ef0a97fad35b5910b0640855005ad81e29d84e3c68d2345e9beb9f4d5c803b9b2d43de721381773366549b97
7
- data.tar.gz: bb3b9642aef06a98c988b32504e82ee03f9c79d9e66b8e41dce35a2fbe5525669e17d267452e861a8a40cf89d98a7157cd5441e7a09b8a6b961b03abe769567d
6
+ metadata.gz: f413e2b50014c575a31f1882747792ef59bfad5d5c0a876f2e2970cf639cb3860f59f5da5ef567af20ee875ec4af16eda5b70ff041f66b68458cef7f44002958
7
+ data.tar.gz: 7ad3f289cd5d7c45dfb9d11548ec343c32309938bf962a8bcd9c360d9ed960f6257e0b7474ef914aaef02cdb0c76679328f6a6b33bb8988b62579051bd99890c
@@ -7,6 +7,7 @@ module WIP
7
7
  class Base
8
8
  def initialize(content, &block)
9
9
  @content = clean(content)
10
+ @output = StringIO.new
10
11
  instance_exec(&block) if block_given?
11
12
  end
12
13
 
@@ -23,6 +24,10 @@ module WIP
23
24
  raise NotImplementedError
24
25
  end
25
26
 
27
+ def output
28
+ @output.string
29
+ end
30
+
26
31
  def type
27
32
  @type ||= self.class.name.split('::').last
28
33
  end
@@ -40,6 +40,7 @@ module WIP
40
40
  def simplex!(ui, env, &block)
41
41
  Open3.popen2e(env, "#{executable} #{arguments}") do |stdin, stdoe, thread|
42
42
  while line = stdoe.gets
43
+ @output.puts(line)
43
44
  block.call(line)
44
45
  end
45
46
 
@@ -59,6 +60,7 @@ module WIP
59
60
  end
60
61
 
61
62
  while line = stdoe.gets
63
+ @output.puts(line)
62
64
  block.call(line)
63
65
  end
64
66
 
@@ -118,8 +118,18 @@ module WIP
118
118
  @ui.newline
119
119
  end
120
120
 
121
- # TODO: raise instead of exit.
122
- exit 1 unless result.success?
121
+ unless result.success?
122
+ @ui.err {
123
+ @ui.newline
124
+ @ui.say "Failure (exit code #{result.exitstatus})"
125
+ output = shell.output
126
+ unless output.empty?
127
+ @ui.newline
128
+ @ui.say output
129
+ end
130
+ }
131
+ exit result.exitstatus
132
+ end
123
133
  else
124
134
  if block_given?
125
135
  block.call('> (skipped)')
@@ -1,5 +1,5 @@
1
1
  module WIP
2
2
  module Runner
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wip-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Innis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-20 00:00:00.000000000 Z
11
+ date: 2016-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline