solve 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +0,0 @@
1
- Dir["#{File.dirname(__FILE__)}/core_ext/*.rb"].sort.each do |path|
2
- require "solve/core_ext/#{File.basename(path, '.rb')}"
3
- end
@@ -1,33 +0,0 @@
1
- # From ActiveSupport: https://github.com/rails/rails/blob/c2c8ef57d6f00d1c22743dc43746f95704d67a95/activesupport/lib/active_support/core_ext/kernel/reporting.rb#L39
2
-
3
- require 'rbconfig'
4
-
5
- module Kernel
6
- # Silences any stream for the duration of the block.
7
- #
8
- # silence_stream(STDOUT) do
9
- # puts 'This will never be seen'
10
- # end
11
- #
12
- # puts 'But this will'
13
- def silence_stream(stream)
14
- old_stream = stream.dup
15
- stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
16
- stream.sync = true
17
- yield
18
- ensure
19
- stream.reopen(old_stream)
20
- end
21
-
22
- # Silences both STDOUT and STDERR, even for subprocesses.
23
- #
24
- # quietly { system 'bundle install' }
25
- #
26
- def quietly
27
- silence_stream(STDOUT) do
28
- silence_stream(STDERR) do
29
- yield
30
- end
31
- end
32
- end
33
- end