rake-funnel 0.10.0.pre → 0.11.0.pre
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8136031a5dcf41921fe9ef6e60a00a2b330b7666
|
4
|
+
data.tar.gz: 7e042e981473b5e97bd791892086eb23f5963a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 074af6f609bab49ee4a6c98a761bf7cb1fb60574fa2b22d65e8fa550aac7c6ba47260babf4f944b2656654bc347df9e97760e75784709121860051238d5e5a52
|
7
|
+
data.tar.gz: 882b78b313bb24ff7b545c2790f7ed0e57944c06f4ebb25a6da33d2c58c29314e3cb46c509d9eaaeedad4aa13b06465d3757136292cb4fa07d0908557a008b3d
|
@@ -3,8 +3,15 @@ module Rake
|
|
3
3
|
module Integration
|
4
4
|
class SyncOutput
|
5
5
|
def initialize
|
6
|
-
$stdout
|
7
|
-
$stderr
|
6
|
+
sync($stdout)
|
7
|
+
sync($stderr)
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
def sync(stream)
|
12
|
+
stream.sync = true
|
13
|
+
rescue => e
|
14
|
+
Rake.rake_output_message "Failed to set up sync output #{e}"
|
8
15
|
end
|
9
16
|
end
|
10
17
|
end
|
data/lib/rake/funnel/version.rb
CHANGED
@@ -1,16 +1,37 @@
|
|
1
1
|
describe Rake::Funnel::Integration::SyncOutput do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
context 'stream supports sync mode' do
|
3
|
+
before {
|
4
|
+
allow($stdout).to receive(:sync=)
|
5
|
+
allow($stderr).to receive(:sync=)
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
expect(subject).to be
|
8
|
+
}
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
it 'should immediately flush $stdout' do
|
11
|
+
expect($stdout).to have_received(:sync=).with(true)
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should immediately flush $stderr' do
|
15
|
+
expect($stdout).to have_received(:sync=).with(true)
|
16
|
+
end
|
11
17
|
end
|
12
18
|
|
13
|
-
|
14
|
-
|
19
|
+
context 'stream does not support sync mode' do
|
20
|
+
before {
|
21
|
+
allow($stdout).to receive(:sync=).and_raise('$stdout.sync not supported')
|
22
|
+
allow($stderr).to receive(:sync=).and_raise('$stderr.sync not supported')
|
23
|
+
|
24
|
+
allow(Rake).to receive(:rake_output_message)
|
25
|
+
|
26
|
+
expect(subject).to be
|
27
|
+
}
|
28
|
+
|
29
|
+
it 'should log the error for $stdout' do
|
30
|
+
expect(Rake).to have_received(:rake_output_message).with(/Failed.*\$stdout/)
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should log the error for $stderr' do
|
34
|
+
expect(Rake).to have_received(:rake_output_message).with(/Failed.*\$stderr/)
|
35
|
+
end
|
15
36
|
end
|
16
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-funnel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Groß
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|