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: 31d63ccc013d1d0d30b8ffdadf10ca032863a551
4
- data.tar.gz: 289eaa803667f90ac64813689ba365652528ff4c
3
+ metadata.gz: 8136031a5dcf41921fe9ef6e60a00a2b330b7666
4
+ data.tar.gz: 7e042e981473b5e97bd791892086eb23f5963a04
5
5
  SHA512:
6
- metadata.gz: 0c732f352b946d9ac6ad642e89f0898763e34a63b0ad4acef6e8c40eb4fe1a90a8f9403c5ba0821b5881bd6782058ccf74956144d81bd1906eddd6ee2fbbacf6
7
- data.tar.gz: 1d51ff492ae68c9e0aa17336d421520b444bdba2818d67c92c4f2a84092fe010441d4294146ba8d009caa2da851c7628b93c24b7dddf5a2b3aa66e521e1f6098
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.sync = true
7
- $stderr.sync = true
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
@@ -1,5 +1,5 @@
1
1
  module Rake
2
2
  module Funnel
3
- VERSION = '0.10.0.pre'
3
+ VERSION = '0.11.0.pre'
4
4
  end
5
5
  end
@@ -1,16 +1,37 @@
1
1
  describe Rake::Funnel::Integration::SyncOutput do
2
- before {
3
- allow($stdout).to receive(:sync=)
4
- allow($stderr).to receive(:sync=)
2
+ context 'stream supports sync mode' do
3
+ before {
4
+ allow($stdout).to receive(:sync=)
5
+ allow($stderr).to receive(:sync=)
5
6
 
6
- expect(subject).to be
7
- }
7
+ expect(subject).to be
8
+ }
8
9
 
9
- it 'should immediately flush stdout' do
10
- expect($stdout).to have_received(:sync=).with(true)
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
- it 'should immediately flush stderr' do
14
- expect($stdout).to have_received(:sync=).with(true)
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.10.0.pre
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-04-01 00:00:00.000000000 Z
11
+ date: 2015-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake