metric_fu 4.11.0 → 4.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTlhNTUwYTY3MzMxNmZiZGM4YzM4YjI0YjM2ZmUwMTU4MzA2YTM5NQ==
4
+ NjRkYzc2YTUyMTE0NzdkNTIxNmVhMTlkMGUzNzQ5NTIzYjY5N2JhNw==
5
5
  data.tar.gz: !binary |-
6
- ZTNjOGQwNjIxOWRhYWYzYzE3ZWE4MTAzYjhlZmI0ZDAzNGU3Mjc3NQ==
6
+ YjYyYWU0YTk5NjE5ZDM4M2I1ZmVlNWY2ODM4NzM3Y2M4MTUwM2IxZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTkwMWM3ZjBkMjUwZDQzYzJiMmQ1YzZlZmNmMzMxNDVlNWM4NWRkZTE4MTEy
10
- MGM4YjI3YjBkYWQxNGJhZGE5NTFiNDgxMmUwMTU4YzY2OTY5NjYzYjdlYTg4
11
- YzFhYTVkZWRiYzU2ZDNiNzk3NWM3ZGNkMDBjYjI1NGZkMDI5OWI=
9
+ MjJmZjc0N2U3NmI1YTU3YTQwYmE3NjM2NTBhNDY0MmYzMmM2MTQyZjYxNmJj
10
+ OTM3ZmE1ODlmZjg1Yjg0MDZlYTNiZWNiZjAyMTM5MmQ0MThjNzJmMzkzODcy
11
+ YjcyZjA3YTYwNGE3ODQ0NzE5NjEwN2FiMWJlNTMyNjIyNjBkZWE=
12
12
  data.tar.gz: !binary |-
13
- ZjkyNGU5YmE2MGRjYmEwODJkMTdlY2JlNjc0OWM5Y2JmZTc5ZGI4YmQ3NzEw
14
- MDI0YWE1ZGYxMDVkYWM5MzNhY2VkZDlhYjc1NjkxYjE3ZTRjMGI2NjUyZDZj
15
- ZWY1NWI4NmJlNzE5ZGE4NTY5MTdiOTE4NWRmODI4OTVmNGFjNGQ=
13
+ YjA1NmJmMDZiYzc2ZDBkODVmNDliNWFkMDllZmQyMTk2NGNhN2YwNTFlNzcx
14
+ NzI3OGNkMDNmMGFhYjZjYWU5YTFjYmNkYTFlZDM0M2VkNGNlNmRmMmFmN2Iy
15
+ ZWVmNGRmNWQ2MmIxNDQ0MDg3MzFlZWM5MzM0MGVlZTYxNzM5MWQ=
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -32,6 +32,7 @@ Andy Gregorowicz
32
32
  Tarsoly András
33
33
  Benjamin Fleischer / Paul Swagerty
34
34
  unknown
35
+ Nick Veys
35
36
  Extrovert
36
37
  Ben Turner
37
38
  KAKUTANI Shintaro
@@ -56,18 +57,19 @@ saltracer
56
57
  benlovell
57
58
  ff-cviradiya
58
59
  khall
59
- Todd A. Jacobs
60
60
  Stefan Huber
61
- Hans Hasselberg
62
- Bitdeli Chef
61
+ Todd A. Jacobs
63
62
  jayzes
63
+ Bitdeli Chef
64
+ Hans Hasselberg
64
65
  Scyllinice
65
66
  Matthew Gordon
67
+ Guilherme Simões
66
68
  factorylabs
67
- Paul Elliott
68
- Joel Nimety
69
+ Greg Allen
69
70
  Chris Ian Fiel
71
+ Mike Szyndel
72
+ Joel Nimety
70
73
  René Föhring
74
+ Paul Elliott
71
75
  Mike Ball
72
- Greg Allen
73
- Guilherme Simões
data/DEV.md CHANGED
@@ -72,4 +72,5 @@ template.render_partial 'graph', {:graph_name => 'reek'}
72
72
  0. Run `rake usage_test` to make sure the examples are still valid
73
73
  1. Update lib/metric_fu/version.rb
74
74
  2. Update HISTORY.md
75
+ 3. Update CONTRIBUTORS and erd per README in etc
75
76
  3. `rake release`
data/HISTORY.md CHANGED
@@ -4,13 +4,18 @@ Each change should fall into categories that would affect whether the release is
4
4
 
5
5
  As such, a _Feature_ would map to either major (breaking change) or minor. A _bug fix_ to a patch. And _misc_ is either minor or patch, the difference being kind of fuzzy for the purposes of history. Adding tests would be patch level.
6
6
 
7
- ### Master [changes](https://github.com/metricfu/metric_fu/compare/v4.11.0...master)
7
+ ### Master [changes](https://github.com/metricfu/metric_fu/compare/v4.11.1...master)
8
8
 
9
9
  * Breaking Changes
10
10
  * Features
11
11
  * Fixes
12
12
  * Misc
13
13
 
14
+ ### [4.11.1](https://github.com/metricfu/metric_fu/compare/v4.11.0...v4.11.1)
15
+
16
+ * Fixes
17
+ * Captured shell-output now only includes STDOUT. Appending STDERR was breaking expectations. (Benjamin Fleischer, #230, fixes #229)
18
+
14
19
  ### [4.11.0](https://github.com/metricfu/metric_fu/compare/v4.10.0...v4.11.0)
15
20
 
16
21
  * Features
data/Rakefile CHANGED
@@ -2,9 +2,6 @@
2
2
  using_git = File.exist?(File.expand_path('../.git/', __FILE__))
3
3
  if using_git
4
4
  require 'bundler/setup'
5
- require 'bundler/gem_helper'
6
- Bundler::GemHelper.install_tasks
7
- # require 'appraisal'
8
5
  end
9
6
  require 'rake'
10
7
 
@@ -0,0 +1 @@
1
+ 5402db0fe4fb45627ce37d071b0d0d0ec4d173320cfffb251e3e0406556e828ac97fc416a4ddd9387b39aa9e374687ebf900f94cb0a578d771b12ae4af8506c6
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
2
  require 'rubygems'
3
3
  require 'digest/sha2'
4
+ # require 'bundler/gem_helper'
5
+ # Bundler::GemHelper.install_tasks
4
6
 
5
7
  # Based on https://github.com/bundler/bundler/blob/ec0621d/lib/bundler/gem_helpers.rb
6
8
  GEM_TASKS = Class.new(Rake::TaskLib) do
@@ -30,18 +30,19 @@ module MetricFu
30
30
  mf_debug "Running #{summary}"
31
31
  captured_output = ''
32
32
  captured_errors = ''
33
+ thread = ''
33
34
  Open3.popen3("#{library_name}", *arguments) do |stdin, stdout, stderr, wait_thr|
34
35
  captured_output << stdout.read.chomp
35
36
  captured_errors << stderr.read.chomp
37
+ thread = wait_thr
36
38
  end
37
- captured_output << "\nERRORS:\n#{captured_errors}"
38
39
  rescue StandardError => run_error
39
40
  handle_run_error(run_error)
40
41
  rescue SystemExit => system_exit
41
42
  handle_system_exit(system_exit)
42
43
  ensure
43
44
  print_errors
44
- return captured_output
45
+ return captured_output, captured_errors, thread.value
45
46
  end
46
47
 
47
48
  def handle_run_error(run_error)
@@ -55,7 +55,17 @@ module MetricFu
55
55
  # version: ,
56
56
  args: args,
57
57
  })
58
- runner.run
58
+ stdout, stderr, status = runner.run
59
+ # TODO: do something with the stderr
60
+ # for now, just acknowledge we got it
61
+ unless stderr.empty?
62
+ STDERR.puts "STDERR from #{gem_name}:\n#{stderr}"
63
+ end
64
+ # TODO: status.success? is not reliable for distinguishing
65
+ # between a successful run of the metric and problems
66
+ # found by the metric. Talk to other metrics about this.
67
+ MetricFu.logger.debug "#{gem_name} ran with #{status.success? ? 'success' : 'failure'} code #{status.exitstatus}"
68
+ stdout
59
69
  end
60
70
 
61
71
  def configured_run_options
@@ -16,17 +16,25 @@ module MetricFu
16
16
  end
17
17
 
18
18
  def to_h
19
+ {:flay => calculate_result(@matches)}
20
+ end
21
+
22
+ # TODO: move into analyze method
23
+ def calculate_result(matches)
24
+ total_score = matches.shift.first.split('=').last.strip
19
25
  target = []
20
- total_score = @matches.shift.first.split('=').last.strip
21
- @matches.each do |problem|
26
+ matches.each do |problem|
22
27
  reason = problem.shift.strip
23
28
  lines_info = problem.map do |full_line|
24
- name, line = full_line.split(":")
25
- {:name => name.strip, :line => line.strip}
29
+ name, line = full_line.split(":").map(&:strip)
30
+ {:name => name, :line => line}
26
31
  end
27
32
  target << [:reason => reason, :matches => lines_info]
28
33
  end
29
- {:flay => {:total_score => total_score, :matches => target.flatten}}
34
+ {
35
+ :total_score => total_score,
36
+ :matches => target.flatten
37
+ }
30
38
  end
31
39
 
32
40
  private
@@ -1,3 +1,3 @@
1
1
  module MetricFu
2
- VERSION = '4.11.0'
2
+ VERSION = '4.11.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metric_fu
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.11.0
4
+ version: 4.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Scruggs
@@ -49,7 +49,7 @@ cert_chain:
49
49
  dWphdUtxcjhoS0RMdTRLK3F1Q0dqWC82TEw2CldPTno5dlQ2aDA1M2tIWllN
50
50
  cmQ0R3MvTmRhQTR0SlN4cmhabFhkYWpBbS8wdkFPekxJcVVISFFrM1IwdGY3
51
51
  YVkKZC93PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
52
- date: 2014-05-04 00:00:00.000000000 Z
52
+ date: 2014-05-14 00:00:00.000000000 Z
53
53
  dependencies:
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: flay
@@ -356,6 +356,7 @@ files:
356
356
  - certs/bf4.pem
357
357
  - checksum/.gitkeep
358
358
  - checksum/metric_fu-4.10.0.gem.sha512
359
+ - checksum/metric_fu-4.11.0.gem.sha512
359
360
  - checksum/metric_fu-4.2.0.gem.sha512
360
361
  - checksum/metric_fu-4.2.1.gem.sha512
361
362
  - checksum/metric_fu-4.3.0.gem.sha512
metadata.gz.sig CHANGED
Binary file