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 +4 -4
- data/lib/metric_fu/generator.rb +15 -0
- data/lib/metric_fu/metrics/roodi/generator.rb +3 -1
- data/lib/metric_fu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76c4418ed136810a2c0ab406bedf3e681490ae89
|
4
|
+
data.tar.gz: 0db14f57209fc578e3ec13de6eeca0a149485aa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e3efbb63877aa09122244d3ed87d0275b2523209d37deb060d0e74c8103966a9d38c7651da97c5ec72bc3f9f14577e5cd7fe17373ab82c48fd6b2457f219b3c
|
7
|
+
data.tar.gz: 766242337983416d7760677b04efc80dfd7cc05f3b211d4fe40a1eceed8a8eb25714857c81b6b536b8d40ac2c824cbcbdd18314cd1fb93e563695f6142a499aa
|
data/lib/metric_fu/generator.rb
CHANGED
@@ -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
|
-
|
12
|
+
silence_streams(STDERR) do
|
13
|
+
@output = run!(args)
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
def analyze
|
data/lib/metric_fu/version.rb
CHANGED
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.
|
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-
|
23
|
+
date: 2017-12-27 00:00:00.000000000 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: flay
|