code_metric_fu 4.14.1 → 4.14.2

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: 2ea1686a37bd0b9c4dd00dd7915dff059bc8bf03
4
- data.tar.gz: fb6c50a2bacc9d14f9dcb82f0d07630c3bff6de7
3
+ metadata.gz: 76c4418ed136810a2c0ab406bedf3e681490ae89
4
+ data.tar.gz: 0db14f57209fc578e3ec13de6eeca0a149485aa9
5
5
  SHA512:
6
- metadata.gz: ac58e444bf9ca107a8922cdf6ed800aedf5d74f075b57ed2962ebe81bfc6697c70089bae19b20b30cfc486f5909b50b570b3e0ff3e85f093f843f52a2b855a80
7
- data.tar.gz: a106f91b6cc9c41eeec28f77470e9601c9f6c35501e56d71c8998d414e630820c8efcd5bbea8a4b453754b851ac9045bae0d1701fc859a991f4f3367c8a7d8c2
6
+ metadata.gz: 1e3efbb63877aa09122244d3ed87d0275b2523209d37deb060d0e74c8103966a9d38c7651da97c5ec72bc3f9f14577e5cd7fe17373ab82c48fd6b2457f219b3c
7
+ data.tar.gz: 766242337983416d7760677b04efc80dfd7cc05f3b211d4fe40a1eceed8a8eb25714857c81b6b536b8d40ac2c824cbcbdd18314cd1fb93e563695f6142a499aa
@@ -90,6 +90,21 @@ module MetricFu
90
90
  metric_config.run_external(args)
91
91
  end
92
92
 
93
+ # temporarily redirect stderr
94
+ # usage: silence_streams(STDERR) { STDERR.puts "something wrong" }
95
+ def silence_streams(*streams)
96
+ on_hold = streams.collect { |stream| stream.dup }
97
+ streams.each do |stream|
98
+ stream.reopen(RUBY_PLATFORM =~ /mswin/ ? 'NUL:' : '/dev/null')
99
+ stream.sync = true
100
+ end
101
+ yield
102
+ ensure
103
+ streams.each_with_index do |stream, i|
104
+ stream.reopen(on_hold[i])
105
+ end
106
+ end
107
+
93
108
  # Provides a template method to drive the production of a metric
94
109
  # from a concrete implementation of this class. Each concrete
95
110
  # class must implement the three methods that this template method
@@ -9,7 +9,9 @@ module MetricFu
9
9
  files = remove_excluded_files(files_to_analyze.flatten)
10
10
  config = options[:roodi_config] ? "-config=#{options[:roodi_config]}" : ""
11
11
  args = "#{config} #{files.join(' ')}"
12
- @output = run!(args)
12
+ silence_streams(STDERR) do
13
+ @output = run!(args)
14
+ end
13
15
  end
14
16
 
15
17
  def analyze
@@ -2,7 +2,7 @@ module MetricFu
2
2
  class Version
3
3
  MAJOR = "4"
4
4
  MINOR = "14"
5
- PATCH = "1"
5
+ PATCH = "2"
6
6
  PRE = ""
7
7
  end
8
8
  VERSION = [Version::MAJOR, Version::MINOR, Version::PATCH].join(".")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_metric_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.14.1
4
+ version: 4.14.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Scruggs
@@ -20,7 +20,7 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain:
22
22
  - certs/bf4.pem
23
- date: 2017-12-26 00:00:00.000000000 Z
23
+ date: 2017-12-27 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: flay