metric_fu 4.11.1 → 4.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +6 -0
- data/.rubocop.yml +15 -0
- data/.rubocop_todo.yml +69 -0
- data/.simplecov +35 -3
- data/.travis.yml +6 -10
- data/CONTRIBUTORS +12 -11
- data/Gemfile +48 -29
- data/Guardfile +9 -9
- data/HISTORY.md +47 -1
- data/README.md +70 -57
- data/Rakefile +1 -15
- data/appveyor.yml +34 -0
- data/certs/bf4.pem +20 -20
- data/checksum/metric_fu-4.11.1.gem.sha512 +1 -0
- data/checksum/metric_fu-4.11.2.gem.sha512 +1 -0
- data/checksum/metric_fu-4.11.3.gem.sha512 +1 -0
- data/checksum/metric_fu-4.11.4.gem.sha512 +1 -0
- data/checksum/metric_fu-4.12.0.gem.sha512 +1 -0
- data/checksum/metric_fu-4.13.0.gem.sha512 +1 -0
- data/config/rubocop.yml +269 -0
- data/gem_tasks/build.rake +1 -0
- data/gem_tasks/rubocop.rake +10 -0
- data/gem_tasks/yard.rake +24 -0
- data/lib/metric_fu.rb +20 -9
- data/lib/metric_fu/calculate.rb +0 -1
- data/lib/metric_fu/cli/client.rb +6 -6
- data/lib/metric_fu/cli/helper.rb +22 -13
- data/lib/metric_fu/cli/parser.rb +14 -18
- data/lib/metric_fu/configuration.rb +7 -11
- data/lib/metric_fu/constantize.rb +4 -4
- data/lib/metric_fu/data_structures/line_numbers.rb +10 -11
- data/lib/metric_fu/data_structures/location.rb +12 -14
- data/lib/metric_fu/data_structures/sexp_node.rb +31 -13
- data/lib/metric_fu/environment.rb +29 -31
- data/lib/metric_fu/formatter.rb +4 -6
- data/lib/metric_fu/formatter/html.rb +13 -13
- data/lib/metric_fu/formatter/syntax.rb +5 -7
- data/lib/metric_fu/formatter/yaml.rb +1 -1
- data/lib/metric_fu/gem_run.rb +13 -15
- data/lib/metric_fu/gem_version.rb +10 -12
- data/lib/metric_fu/generator.rb +6 -9
- data/lib/metric_fu/io.rb +13 -15
- data/lib/metric_fu/loader.rb +17 -18
- data/lib/metric_fu/logger.rb +15 -18
- data/lib/metric_fu/logging/mf_debugger.rb +4 -4
- data/lib/metric_fu/metric.rb +11 -12
- data/lib/metric_fu/metrics/cane/generator.rb +10 -9
- data/lib/metric_fu/metrics/cane/grapher.rb +5 -7
- data/lib/metric_fu/metrics/cane/metric.rb +6 -8
- data/lib/metric_fu/metrics/cane/report.html.erb +3 -3
- data/lib/metric_fu/metrics/cane/violations.rb +6 -6
- data/lib/metric_fu/metrics/churn/generator.rb +2 -6
- data/lib/metric_fu/metrics/churn/hotspot.rb +1 -3
- data/lib/metric_fu/metrics/churn/metric.rb +5 -7
- data/lib/metric_fu/metrics/flay/generator.rb +7 -11
- data/lib/metric_fu/metrics/flay/grapher.rb +5 -6
- data/lib/metric_fu/metrics/flay/hotspot.rb +5 -7
- data/lib/metric_fu/metrics/flay/metric.rb +5 -7
- data/lib/metric_fu/metrics/flog/generator.rb +35 -24
- data/lib/metric_fu/metrics/flog/grapher.rb +11 -11
- data/lib/metric_fu/metrics/flog/hotspot.rb +3 -5
- data/lib/metric_fu/metrics/flog/metric.rb +3 -5
- data/lib/metric_fu/metrics/hotspots/analysis/analyzed_problems.rb +0 -1
- data/lib/metric_fu/metrics/hotspots/analysis/analyzer_tables.rb +19 -18
- data/lib/metric_fu/metrics/hotspots/analysis/grouping.rb +0 -2
- data/lib/metric_fu/metrics/hotspots/analysis/groupings.rb +1 -3
- data/lib/metric_fu/metrics/hotspots/analysis/problems.rb +4 -6
- data/lib/metric_fu/metrics/hotspots/analysis/ranked_problem_location.rb +14 -17
- data/lib/metric_fu/metrics/hotspots/analysis/ranking.rb +4 -5
- data/lib/metric_fu/metrics/hotspots/analysis/rankings.rb +1 -3
- data/lib/metric_fu/metrics/hotspots/analysis/record.rb +3 -5
- data/lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb +0 -2
- data/lib/metric_fu/metrics/hotspots/analysis/table.rb +3 -4
- data/lib/metric_fu/metrics/hotspots/generator.rb +3 -6
- data/lib/metric_fu/metrics/hotspots/hotspot.rb +13 -13
- data/lib/metric_fu/metrics/hotspots/hotspot_analyzer.rb +5 -8
- data/lib/metric_fu/metrics/hotspots/metric.rb +1 -3
- data/lib/metric_fu/metrics/hotspots/report.html.erb +1 -1
- data/lib/metric_fu/metrics/rails_best_practices/generator.rb +14 -12
- data/lib/metric_fu/metrics/rails_best_practices/grapher.rb +5 -6
- data/lib/metric_fu/metrics/rails_best_practices/metric.rb +5 -4
- data/lib/metric_fu/metrics/rcov/external_client.rb +1 -3
- data/lib/metric_fu/metrics/rcov/generator.rb +13 -15
- data/lib/metric_fu/metrics/rcov/grapher.rb +6 -7
- data/lib/metric_fu/metrics/rcov/hotspot.rb +5 -7
- data/lib/metric_fu/metrics/rcov/metric.rb +5 -7
- data/lib/metric_fu/metrics/rcov/rcov_format_coverage.rb +16 -55
- data/lib/metric_fu/metrics/rcov/rcov_line.rb +48 -0
- data/lib/metric_fu/metrics/rcov/report.html.erb +2 -2
- data/lib/metric_fu/metrics/rcov/simplecov_formatter.rb +10 -11
- data/lib/metric_fu/metrics/reek/generator.rb +36 -82
- data/lib/metric_fu/metrics/reek/grapher.rb +5 -6
- data/lib/metric_fu/metrics/reek/hotspot.rb +5 -7
- data/lib/metric_fu/metrics/reek/metric.rb +2 -4
- data/lib/metric_fu/metrics/roodi/generator.rb +9 -10
- data/lib/metric_fu/metrics/roodi/grapher.rb +5 -6
- data/lib/metric_fu/metrics/roodi/hotspot.rb +1 -3
- data/lib/metric_fu/metrics/roodi/metric.rb +2 -4
- data/lib/metric_fu/metrics/saikuro/generator.rb +23 -27
- data/lib/metric_fu/metrics/saikuro/hotspot.rb +1 -3
- data/lib/metric_fu/metrics/saikuro/metric.rb +7 -8
- data/lib/metric_fu/metrics/saikuro/parsing_element.rb +6 -8
- data/lib/metric_fu/metrics/saikuro/report.html.erb +1 -1
- data/lib/metric_fu/metrics/saikuro/scratch_file.rb +24 -29
- data/lib/metric_fu/metrics/stats/generator.rb +9 -12
- data/lib/metric_fu/metrics/stats/grapher.rb +8 -9
- data/lib/metric_fu/metrics/stats/hotspot.rb +1 -3
- data/lib/metric_fu/metrics/stats/metric.rb +3 -5
- data/lib/metric_fu/reporter.rb +1 -1
- data/lib/metric_fu/reporting/graphs/graph.rb +8 -12
- data/lib/metric_fu/reporting/graphs/grapher.rb +7 -9
- data/lib/metric_fu/reporting/result.rb +0 -3
- data/lib/metric_fu/run.rb +12 -3
- data/lib/metric_fu/tasks/metric_fu.rake +8 -8
- data/lib/metric_fu/templates/configuration.rb +2 -5
- data/lib/metric_fu/templates/metrics_template.rb +45 -32
- data/lib/metric_fu/templates/report.rb +5 -8
- data/lib/metric_fu/templates/template.rb +20 -24
- data/lib/metric_fu/utility.rb +15 -8
- data/lib/metric_fu/version.rb +7 -1
- data/metric_fu.gemspec +29 -32
- data/spec/capture_warnings.rb +29 -22
- data/spec/cli/helper_spec.rb +9 -16
- data/spec/dummy/lib/bad_encoding.rb +1 -1
- data/spec/fixtures/coverage-153.rb +2 -2
- data/spec/fixtures/coverage.rb +2 -2
- data/spec/metric_fu/calculate_spec.rb +3 -3
- data/spec/metric_fu/configuration_spec.rb +71 -83
- data/spec/metric_fu/data_structures/line_numbers_spec.rb +3 -5
- data/spec/metric_fu/data_structures/location_spec.rb +13 -31
- data/spec/metric_fu/formatter/configuration_spec.rb +18 -20
- data/spec/metric_fu/formatter/html_spec.rb +21 -28
- data/spec/metric_fu/formatter/yaml_spec.rb +9 -17
- data/spec/metric_fu/formatter_spec.rb +16 -16
- data/spec/metric_fu/gem_version_spec.rb +4 -6
- data/spec/metric_fu/generator_spec.rb +33 -43
- data/spec/metric_fu/loader_spec.rb +5 -4
- data/spec/metric_fu/metric_spec.rb +21 -25
- data/spec/metric_fu/metrics/cane/configuration_spec.rb +14 -14
- data/spec/metric_fu/metrics/cane/generator_spec.rb +26 -29
- data/spec/metric_fu/metrics/churn/configuration_spec.rb +7 -9
- data/spec/metric_fu/metrics/churn/generator_spec.rb +6 -11
- data/spec/metric_fu/metrics/flay/configuration_spec.rb +7 -9
- data/spec/metric_fu/metrics/flay/generator_spec.rb +36 -37
- data/spec/metric_fu/metrics/flay/grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/flog/configuration_spec.rb +12 -14
- data/spec/metric_fu/metrics/flog/generator_spec.rb +31 -32
- data/spec/metric_fu/metrics/flog/grapher_spec.rb +8 -10
- data/spec/metric_fu/metrics/hotspots/analysis/analyzed_problems_spec.rb +18 -24
- data/spec/metric_fu/metrics/hotspots/analysis/analyzer_tables_spec.rb +12 -17
- data/spec/metric_fu/metrics/hotspots/analysis/ranking_spec.rb +2 -6
- data/spec/metric_fu/metrics/hotspots/analysis/rankings_spec.rb +5 -14
- data/spec/metric_fu/metrics/hotspots/analysis/table_spec.rb +1 -3
- data/spec/metric_fu/metrics/hotspots/generator_spec.rb +6 -8
- data/spec/metric_fu/metrics/hotspots/hotspot_analyzer_spec.rb +1 -3
- data/spec/metric_fu/metrics/hotspots/hotspot_spec.rb +4 -5
- data/spec/metric_fu/metrics/rails_best_practices/configuration_spec.rb +25 -17
- data/spec/metric_fu/metrics/rails_best_practices/generator_spec.rb +2 -3
- data/spec/metric_fu/metrics/rails_best_practices/grapher_spec.rb +3 -3
- data/spec/metric_fu/metrics/rcov/configuration_spec.rb +21 -23
- data/spec/metric_fu/metrics/rcov/generator_spec.rb +6 -10
- data/spec/metric_fu/metrics/rcov/grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/rcov/hotspot_spec.rb +8 -8
- data/spec/metric_fu/metrics/rcov/rcov_line_spec.rb +89 -0
- data/spec/metric_fu/metrics/rcov/simplecov_formatter_spec.rb +31 -33
- data/spec/metric_fu/metrics/reek/configuration_spec.rb +7 -7
- data/spec/metric_fu/metrics/reek/generator_spec.rb +131 -111
- data/spec/metric_fu/metrics/reek/grapher_spec.rb +4 -4
- data/spec/metric_fu/metrics/roodi/configuration_spec.rb +8 -10
- data/spec/metric_fu/metrics/roodi/generator_spec.rb +3 -3
- data/spec/metric_fu/metrics/roodi/grapher_spec.rb +2 -2
- data/spec/metric_fu/metrics/saikuro/configuration_spec.rb +22 -23
- data/spec/metric_fu/metrics/saikuro/generator_spec.rb +7 -7
- data/spec/metric_fu/metrics/stats/generator_spec.rb +10 -10
- data/spec/metric_fu/metrics/stats/grapher_spec.rb +2 -2
- data/spec/metric_fu/reporter_spec.rb +8 -9
- data/spec/metric_fu/reporting/graphs/graph_spec.rb +1 -4
- data/spec/metric_fu/reporting/graphs/grapher_spec.rb +5 -5
- data/spec/metric_fu/reporting/result_spec.rb +12 -14
- data/spec/metric_fu/run_spec.rb +19 -33
- data/spec/metric_fu/templates/configuration_spec.rb +34 -40
- data/spec/metric_fu/templates/metrics_template_spec.rb +11 -0
- data/spec/metric_fu/templates/report_spec.rb +4 -4
- data/spec/metric_fu/templates/template_spec.rb +78 -64
- data/spec/metric_fu/utility_spec.rb +3 -3
- data/spec/metric_fu_spec.rb +23 -6
- data/spec/quality_spec.rb +43 -15
- data/spec/shared/configured.rb +9 -11
- data/spec/shared/test_coverage.rb +5 -9
- data/spec/spec_helper.rb +13 -31
- data/spec/{dummy → support}/.metrics +0 -0
- data/spec/support/deferred_garbaged_collection.rb +1 -2
- data/spec/support/matcher_create_file.rb +6 -4
- data/spec/support/matcher_create_files.rb +6 -4
- data/spec/support/samples/reek/alfa.rb +1 -0
- data/spec/support/suite.rb +3 -3
- data/spec/support/test_fixtures.rb +5 -7
- data/spec/support/timeout.rb +1 -1
- data/spec/support/usage_test.rb +24 -25
- data/spec/usage_test_spec.rb +30 -32
- metadata +104 -103
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/gemfiles/Gemfile.travis +0 -10
- metadata.gz.sig +0 -0
data/README.md
CHANGED
@@ -1,9 +1,15 @@
|
|
1
|
-
# MetricFu [![Gem Version](https://badge.fury.io/rb/metric_fu.
|
1
|
+
# MetricFu [![Gem Version](https://badge.fury.io/rb/metric_fu.svg)](http://badge.fury.io/rb/metric_fu) [![Build Status](https://travis-ci.org/metricfu/metric_fu.svg?branch=master)](http://travis-ci.org/metricfu/metric_fu)
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Join the chat at https://gitter.im/metricfu/metric_fu](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/metricfu/metric_fu?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
|
+
|
5
|
+
[![Code Climate](https://codeclimate.com/github/metricfu/metric_fu.svg)](https://codeclimate.com/github/metricfu/metric_fu) [![Inline docs](http://inch-ci.org/github/metricfu/metric_fu.svg)](http://inch-ci.org/github/metricfu/metric_fu)
|
4
6
|
|
5
7
|
[Rdoc](http://rdoc.info/github/metricfu/metric_fu/)
|
6
8
|
|
9
|
+
## Maintenance
|
10
|
+
|
11
|
+
MetricFu needs maintainers. If you are up for helping out, please left a note in [issue 280]( https://github.com/metricfu/metric_fu/issues/280). MetricFu is free and open source code that belongs to everyone. Benjamin (@bf4) hasn't been working on MetricFu for a while, which is a great opportunity for you to step up!
|
12
|
+
|
7
13
|
## Installation
|
8
14
|
|
9
15
|
gem install metric_fu
|
@@ -47,7 +53,6 @@ See:
|
|
47
53
|
|
48
54
|
## Documentation
|
49
55
|
|
50
|
-
|
51
56
|
MetricFu will attempt to load configuration data from a
|
52
57
|
`.metrics` file, if present in your repository root.
|
53
58
|
|
@@ -87,9 +92,67 @@ MetricFu.configuration.configure_metrics.each do |metric|
|
|
87
92
|
end
|
88
93
|
```
|
89
94
|
|
90
|
-
|
95
|
+
### Rails Best Practices
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
MetricFu::Configuration.run do |config|
|
99
|
+
config.configure_metric(:rails_best_practices) do |rbp|
|
100
|
+
rbp.silent = true
|
101
|
+
rbp.exclude = ["config/chef"]
|
102
|
+
end
|
103
|
+
end
|
104
|
+
```
|
105
|
+
|
106
|
+
### Coverage Metrics
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
MetricFu::Configuration.run do |config|
|
110
|
+
config.configure_metric(:rcov) do |rcov|
|
111
|
+
rcov.coverage_file = MetricFu.run_path.join("coverage/rcov/rcov.txt")
|
112
|
+
rcov.enable
|
113
|
+
rcov.activate
|
114
|
+
end
|
115
|
+
end
|
116
|
+
```
|
117
|
+
|
118
|
+
If you want metric_fu to actually run rcov itself (1.8 only), don't specify an external file to read from
|
119
|
+
|
120
|
+
#### Rcov metrics with Ruby 1.8
|
121
|
+
|
122
|
+
To generate the same metrics metric_fu has been generating run from the root of your project before running metric_fu
|
123
|
+
|
124
|
+
```shell
|
125
|
+
RAILS_ENV=test rcov $(ruby -e "puts Dir['{spec,test}/**/*_{spec,test}.rb'].join(' ')") --sort coverage --no-html --text-coverage --no-color --profile --exclude-only '.*' --include-file "\Aapp,\Alib" -Ispec > coverage/rcov/rcov.txt
|
126
|
+
```
|
127
|
+
|
128
|
+
#### Simplecov metrics with Ruby 1.9 and 2.0
|
129
|
+
|
130
|
+
Add to your Gemfile or otherwise install
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
gem 'simplecov'
|
134
|
+
```
|
135
|
+
|
136
|
+
Modify your [spec_helper](https://github.com/metricfu/metric_fu/blob/master/spec/spec_helper.rb) as per the SimpleCov docs and run your tests before running metric_fu
|
137
|
+
|
138
|
+
```ruby
|
139
|
+
#in your spec_helper
|
140
|
+
require 'simplecov'
|
141
|
+
require 'metric_fu/metrics/rcov/simplecov_formatter'
|
142
|
+
SimpleCov.formatter = SimpleCov::Formatter::MetricFu
|
143
|
+
# or
|
144
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
145
|
+
SimpleCov::Formatter::HTMLFormatter,
|
146
|
+
SimpleCov::Formatter::MetricFu
|
147
|
+
]
|
148
|
+
SimpleCov.start
|
149
|
+
```
|
150
|
+
|
151
|
+
Additionally, the `coverage_file` path must be specified as above and must exist.
|
91
152
|
|
92
|
-
###
|
153
|
+
### Formatters
|
154
|
+
|
155
|
+
#### Built-in Formatters
|
93
156
|
|
94
157
|
By default, metric_fu will use the built-in html formatter to generate HTML reports for each metric with pretty graphs.
|
95
158
|
|
@@ -125,7 +188,7 @@ MetricFu::Configuration.run do |config|
|
|
125
188
|
end
|
126
189
|
```
|
127
190
|
|
128
|
-
|
191
|
+
#### Custom Formatters
|
129
192
|
|
130
193
|
You can customize metric_fu's output format with a custom formatter.
|
131
194
|
|
@@ -161,7 +224,7 @@ your .metrics configuration file.
|
|
161
224
|
|
162
225
|
For instance, to require a formatter in your app's lib directory `require './lib/my_custom_formatter.rb'`
|
163
226
|
|
164
|
-
|
227
|
+
### Configure Graph Engine
|
165
228
|
|
166
229
|
By default, MetricFu uses the Bluff (JavaScript) graph engine.
|
167
230
|
|
@@ -178,56 +241,6 @@ MetricFu.configuration.configure_graph_engine(:highcharts)
|
|
178
241
|
Notice: There was previously a :gchart option.
|
179
242
|
It was not properly deprecated in the 4.x series.
|
180
243
|
|
181
|
-
### Using Coverage Metrics
|
182
|
-
|
183
|
-
in your .metrics file add the below to run pre-generated metrics
|
184
|
-
|
185
|
-
```ruby
|
186
|
-
MetricFu::Configuration.run do |config|
|
187
|
-
config.configure_metric(:rcov) do |rcov|
|
188
|
-
rcov.coverage_file = MetricFu.run_path.join("coverage/rcov/rcov.txt")
|
189
|
-
rcov.enable
|
190
|
-
rcov.activate
|
191
|
-
end
|
192
|
-
end
|
193
|
-
```
|
194
|
-
|
195
|
-
If you want metric_fu to actually run rcov itself (1.8 only), don't specify an external file to read from
|
196
|
-
|
197
|
-
#### Rcov metrics with Ruby 1.8
|
198
|
-
|
199
|
-
To generate the same metrics metric_fu has been generating run from the root of your project before running metric_fu
|
200
|
-
|
201
|
-
```shell
|
202
|
-
RAILS_ENV=test rcov $(ruby -e "puts Dir['{spec,test}/**/*_{spec,test}.rb'].join(' ')") --sort coverage --no-html --text-coverage --no-color --profile --exclude-only '.*' --include-file "\Aapp,\Alib" -Ispec > coverage/rcov/rcov.txt
|
203
|
-
```
|
204
|
-
|
205
|
-
#### Simplecov metrics with Ruby 1.9 and 2.0
|
206
|
-
|
207
|
-
Add to your Gemfile or otherwise install
|
208
|
-
|
209
|
-
```ruby
|
210
|
-
gem 'simplecov'
|
211
|
-
```
|
212
|
-
|
213
|
-
Modify your [spec_helper](https://github.com/metricfu/metric_fu/blob/master/spec/spec_helper.rb) as per the SimpleCov docs and run your tests before running metric_fu
|
214
|
-
|
215
|
-
```ruby
|
216
|
-
#in your spec_helper
|
217
|
-
require 'simplecov'
|
218
|
-
require 'metric_fu/metrics/rcov/simplecov_formatter'
|
219
|
-
SimpleCov.formatter = SimpleCov::Formatter::MetricFu
|
220
|
-
# or
|
221
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
222
|
-
SimpleCov::Formatter::HTMLFormatter,
|
223
|
-
SimpleCov::Formatter::MetricFu
|
224
|
-
]
|
225
|
-
SimpleCov.start
|
226
|
-
```
|
227
|
-
|
228
|
-
Additionally, the `coverage_file` path must be specified as above
|
229
|
-
and must exist.
|
230
|
-
|
231
244
|
## Common problems / debugging
|
232
245
|
|
233
246
|
- ['ArgumentError; message invalid byte sequence in US-ASCII'](https://github.com/metricfu/metric_fu/issues/215) may be caused by having a default external encoding that is not UTF-8. You can see this in the output of `metric_fu --debug`
|
data/Rakefile
CHANGED
@@ -4,6 +4,7 @@ if using_git
|
|
4
4
|
require 'bundler/setup'
|
5
5
|
end
|
6
6
|
require 'rake'
|
7
|
+
require 'simplecov'
|
7
8
|
|
8
9
|
Dir['./gem_tasks/*.rake'].each do |task|
|
9
10
|
import(task)
|
@@ -23,19 +24,4 @@ end
|
|
23
24
|
|
24
25
|
require File.expand_path File.join(File.dirname(__FILE__),'lib/metric_fu')
|
25
26
|
|
26
|
-
# Borrowed from vcr
|
27
|
-
desc "Checks the spec coverage and fails if it is less than 100%"
|
28
|
-
task :check_code_coverage do
|
29
|
-
if RUBY_VERSION.to_f < 1.9 || RUBY_ENGINE != 'ruby'
|
30
|
-
puts "Cannot check code coverage--simplecov is not supported on this platform"
|
31
|
-
else
|
32
|
-
percent = Float(File.read("./coverage/coverage_percent.txt"))
|
33
|
-
if percent < 98.0
|
34
|
-
abort "Spec coverage was not high enough: #{percent.round(2)}%"
|
35
|
-
else
|
36
|
-
puts "Nice job! Spec coverage is still above 98%"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
27
|
task :default => :spec
|
data/appveyor.yml
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
version: '{build}'
|
2
|
+
image:
|
3
|
+
- Visual Studio 2019
|
4
|
+
|
5
|
+
skip_tags: true
|
6
|
+
|
7
|
+
environment:
|
8
|
+
matrix:
|
9
|
+
- RUBY_VERSION: 25
|
10
|
+
- RUBY_VERSION: 25-x64
|
11
|
+
- RUBY_VERSION: 26
|
12
|
+
- RUBY_VERSION: 26-x64
|
13
|
+
- RUBY_VERSION: 27
|
14
|
+
- RUBY_VERSION: 27-x64
|
15
|
+
|
16
|
+
install:
|
17
|
+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
18
|
+
- gem install bundler
|
19
|
+
- bundle config force_ruby_platform true
|
20
|
+
- bundle install --path=vendor/bundle --retry=3 --jobs=3
|
21
|
+
|
22
|
+
cache:
|
23
|
+
- vendor/bundle
|
24
|
+
|
25
|
+
build: off
|
26
|
+
|
27
|
+
before_test:
|
28
|
+
- ruby -v
|
29
|
+
- gem -v
|
30
|
+
- bundle -v
|
31
|
+
|
32
|
+
test_script:
|
33
|
+
- bundle exec rspec
|
34
|
+
- bundle exec ruby -Ilib bin/metric_fu --no-open
|
data/certs/bf4.pem
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
2
|
+
MIIDmjCCAoKgAwIBAgIBATANBgkqhkiG9w0BAQUFADBJMQ8wDQYDVQQDDAZnaXRo
|
3
|
+
dWIxITAfBgoJkiaJk/IsZAEZFhFiZW5qYW1pbmZsZWlzY2hlcjETMBEGCgmSJomT
|
4
|
+
8ixkARkWA2NvbTAeFw0xNTAxMjIxMzAyNTNaFw0xNjAxMjIxMzAyNTNaMEkxDzAN
|
5
|
+
BgNVBAMMBmdpdGh1YjEhMB8GCgmSJomT8ixkARkWEWJlbmphbWluZmxlaXNjaGVy
|
6
|
+
MRMwEQYKCZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
|
7
|
+
CgKCAQEA7V1VZBU7Aft01XAoK8I8tdClfv3H/NIauiV0jfyNtXtZEWwaZ6ooZNLk
|
8
|
+
8kmIUsO2xI7I/B3es6w7le9q9xdEowlYjiR/X/yazNvufu5kpM4f6Ri1AKN8xvPk
|
9
|
+
LFlR8aOAd9LptcusYDfE+BjhmAvnLTgMGODcDLJIaJzLJaRywTLUuFv4digpFwCm
|
10
|
+
Zps9VheJnL4hkgI5BDn6DVjxHSCMRnccQM/kX9L34lbP9KkHXXEtQgkQYpElHbnd
|
11
|
+
MtR753aPeLfOBxSGzsso+6Lhe+fz8huD05mzgWaEZN40e6M7dA9FRSsEzL32ZOad
|
12
|
+
0z13MZWj3Yg5srV/cZvzCDCdVvRphwIDAQABo4GMMIGJMAkGA1UdEwQCMAAwCwYD
|
13
|
+
VR0PBAQDAgSwMB0GA1UdDgQWBBQvUrPExdvmdz0Vau0dH3hRh1YQfDAnBgNVHREE
|
14
|
+
IDAegRxnaXRodWJAYmVuamFtaW5mbGVpc2NoZXIuY29tMCcGA1UdEgQgMB6BHGdp
|
15
|
+
dGh1YkBiZW5qYW1pbmZsZWlzY2hlci5jb20wDQYJKoZIhvcNAQEFBQADggEBAEWo
|
16
|
+
g1soMaRTT/OfFklTuP+odV0w+2qJSfJhOY5bIebDjqxb9BN7hZJ9L6WXhcXCvl6r
|
17
|
+
kuXjpcC05TIv1DoWWaSjGK2ADmEBDNVhaFepYidAYuUQN4+ZjVH/gS9V9OkBcE8h
|
18
|
+
3ZwRv+9RkXM0uY1FwuGI6jgbgPeR1AkkfJnhOPohkG+VN5bFo9aK/Stw8Nwhuuiz
|
19
|
+
axCPD3cmaJBguufRXSMC852SDiBT7AtI4Gl2Fyr+0M5TzXHKbQ9xRBxwfE1bWDd6
|
20
|
+
lEs7ndJ1/vd/Hy0zQ1tIRWyql+ITLhqMi161Pw5flsYpQvPlRLR5pGJ4eD0/JdKE
|
21
|
+
ZG9WSFH7QcGLY65mEYc=
|
22
22
|
-----END CERTIFICATE-----
|
@@ -0,0 +1 @@
|
|
1
|
+
2d38eac5067748ee4417ab7088302a9e6c465e5163712cef9a1998bcb7048bf74c1b5c1facaccd8af042d2362693e4774de5b8c2bc6dbae5613eb91920ec58aa
|
@@ -0,0 +1 @@
|
|
1
|
+
c31f9343f44972b7b614d97cf33d457ad11518b408fb5e8e009eff8ee3c88353bd1dab14ac143a313433b7920b96f89d34753a0cd910364a70396ead3dc39980
|
@@ -0,0 +1 @@
|
|
1
|
+
2290ac18a8467b1ec187273cd94afdb3c2cb187dcf1c58152b99acf54e4249746512ef55604a8b4dc348ad106b7b25ea4a5f225fd2e9659367d20340407578d5
|
@@ -0,0 +1 @@
|
|
1
|
+
9a74861bf6d89f703786e562cdff96eea727aac874e0d9615d4ac8af57b2c97d15e2121de8d978b7097b56bd72b40744c9a27be9d3d12f9ecf75b66ac565e3ef
|
@@ -0,0 +1 @@
|
|
1
|
+
5af713f345549aa574af94d5790ec5360d61aa9ff9dce867da339f5a86e1d2d39c23d025434dd98fc04e0912b6a6da64f271663242a5aa75cbf15cac1c9c73e1
|
@@ -0,0 +1 @@
|
|
1
|
+
e57d3944216f0d2f9ff06ddabae68cc240510df5a3b346739d866c9dc9e86d5bc7e341efd13f5bc34f5d06bdb90cf455a4491dfc65d2f197bc0ca616ea911f7c
|
data/config/rubocop.yml
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
# Originally from https://github.com/thoughtbot/hound/blob/master/config/style_guides/ruby.yml
|
2
|
+
# also see
|
3
|
+
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
|
4
|
+
# https://github.com/rom-rb/devtools/blob/master/config/rubocop.yml
|
5
|
+
# https://github.com/rom-rb/devtools/blob/master/default/config/rubocop.yml
|
6
|
+
AllCops:
|
7
|
+
Exclude:
|
8
|
+
- db/schema.rb
|
9
|
+
|
10
|
+
Style/Blocks:
|
11
|
+
Description: 'Allow Jim Weirch-style blocks, i.e. use `{}` for blocks whose return value we use, else `do/end`'
|
12
|
+
StyleGuide: 'http://devblog.avdi.org/2011/07/26/the-procedurefunction-block-convention-in-ruby/'
|
13
|
+
Enabled: false
|
14
|
+
|
15
|
+
AccessorMethodName:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
ActionFilter:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Alias:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
ArrayJoin:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
AsciiComments:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
AsciiIdentifiers:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Attr:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
BlockNesting:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
CaseEquality:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
CharacterLiteral:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
ClassAndModuleChildren:
|
46
|
+
Enabled: false
|
47
|
+
|
48
|
+
ClassLength:
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
ClassVars:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
CollectionMethods:
|
55
|
+
PreferredMethods:
|
56
|
+
find: detect
|
57
|
+
reduce: inject
|
58
|
+
collect: map
|
59
|
+
find_all: select
|
60
|
+
|
61
|
+
ColonMethodCall:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
CommentAnnotation:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
CyclomaticComplexity:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Delegate:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
DeprecatedHashMethods:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
Documentation:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
DotPosition:
|
80
|
+
EnforcedStyle: trailing
|
81
|
+
|
82
|
+
DoubleNegation:
|
83
|
+
Enabled: false
|
84
|
+
|
85
|
+
EachWithObject:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
EmptyLiteral:
|
89
|
+
Enabled: false
|
90
|
+
|
91
|
+
Encoding:
|
92
|
+
Enabled: false
|
93
|
+
|
94
|
+
EvenOdd:
|
95
|
+
Enabled: false
|
96
|
+
|
97
|
+
FileName:
|
98
|
+
Enabled: false
|
99
|
+
|
100
|
+
FlipFlop:
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
FormatString:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
GlobalVars:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
GuardClause:
|
110
|
+
Enabled: false
|
111
|
+
|
112
|
+
IfUnlessModifier:
|
113
|
+
Enabled: false
|
114
|
+
|
115
|
+
IfWithSemicolon:
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
InlineComment:
|
119
|
+
Enabled: false
|
120
|
+
|
121
|
+
Lambda:
|
122
|
+
Enabled: false
|
123
|
+
|
124
|
+
LambdaCall:
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
LineEndConcatenation:
|
128
|
+
Enabled: false
|
129
|
+
|
130
|
+
LineLength:
|
131
|
+
Max: 80
|
132
|
+
|
133
|
+
MethodLength:
|
134
|
+
Enabled: false
|
135
|
+
|
136
|
+
ModuleFunction:
|
137
|
+
Enabled: false
|
138
|
+
|
139
|
+
NegatedIf:
|
140
|
+
Enabled: false
|
141
|
+
|
142
|
+
NegatedWhile:
|
143
|
+
Enabled: false
|
144
|
+
|
145
|
+
Next:
|
146
|
+
Enabled: false
|
147
|
+
|
148
|
+
NilComparison:
|
149
|
+
Enabled: false
|
150
|
+
|
151
|
+
Not:
|
152
|
+
Enabled: false
|
153
|
+
|
154
|
+
NumericLiterals:
|
155
|
+
Enabled: false
|
156
|
+
|
157
|
+
OneLineConditional:
|
158
|
+
Enabled: false
|
159
|
+
|
160
|
+
OpMethod:
|
161
|
+
Enabled: false
|
162
|
+
|
163
|
+
ParameterLists:
|
164
|
+
Enabled: false
|
165
|
+
|
166
|
+
PercentLiteralDelimiters:
|
167
|
+
Enabled: false
|
168
|
+
|
169
|
+
PerlBackrefs:
|
170
|
+
Enabled: false
|
171
|
+
|
172
|
+
PredicateName:
|
173
|
+
NamePrefixBlacklist:
|
174
|
+
- is_
|
175
|
+
|
176
|
+
Proc:
|
177
|
+
Enabled: false
|
178
|
+
|
179
|
+
RaiseArgs:
|
180
|
+
Enabled: false
|
181
|
+
|
182
|
+
RegexpLiteral:
|
183
|
+
Enabled: false
|
184
|
+
|
185
|
+
SelfAssignment:
|
186
|
+
Enabled: false
|
187
|
+
|
188
|
+
SingleLineBlockParams:
|
189
|
+
Enabled: false
|
190
|
+
|
191
|
+
SingleLineMethods:
|
192
|
+
Enabled: false
|
193
|
+
|
194
|
+
SignalException:
|
195
|
+
Enabled: false
|
196
|
+
|
197
|
+
SpecialGlobalVars:
|
198
|
+
Enabled: false
|
199
|
+
|
200
|
+
StringLiterals:
|
201
|
+
EnforcedStyle: double_quotes
|
202
|
+
|
203
|
+
VariableInterpolation:
|
204
|
+
Enabled: false
|
205
|
+
|
206
|
+
TrailingComma:
|
207
|
+
Enabled: false
|
208
|
+
|
209
|
+
TrivialAccessors:
|
210
|
+
Enabled: false
|
211
|
+
|
212
|
+
VariableInterpolation:
|
213
|
+
Enabled: false
|
214
|
+
|
215
|
+
WhenThen:
|
216
|
+
Enabled: false
|
217
|
+
|
218
|
+
WhileUntilModifier:
|
219
|
+
Enabled: false
|
220
|
+
|
221
|
+
WordArray:
|
222
|
+
Enabled: false
|
223
|
+
|
224
|
+
# Lint
|
225
|
+
|
226
|
+
AmbiguousOperator:
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
AmbiguousRegexpLiteral:
|
230
|
+
Enabled: false
|
231
|
+
|
232
|
+
AssignmentInCondition:
|
233
|
+
Enabled: false
|
234
|
+
|
235
|
+
ConditionPosition:
|
236
|
+
Enabled: false
|
237
|
+
|
238
|
+
DeprecatedClassMethods:
|
239
|
+
Enabled: false
|
240
|
+
|
241
|
+
ElseLayout:
|
242
|
+
Enabled: false
|
243
|
+
|
244
|
+
HandleExceptions:
|
245
|
+
Enabled: false
|
246
|
+
|
247
|
+
InvalidCharacterLiteral:
|
248
|
+
Enabled: false
|
249
|
+
|
250
|
+
LiteralInCondition:
|
251
|
+
Enabled: false
|
252
|
+
|
253
|
+
LiteralInInterpolation:
|
254
|
+
Enabled: false
|
255
|
+
|
256
|
+
Loop:
|
257
|
+
Enabled: false
|
258
|
+
|
259
|
+
ParenthesesAsGroupedExpression:
|
260
|
+
Enabled: false
|
261
|
+
|
262
|
+
RequireParentheses:
|
263
|
+
Enabled: false
|
264
|
+
|
265
|
+
UnderscorePrefixedVariableName:
|
266
|
+
Enabled: false
|
267
|
+
|
268
|
+
Void:
|
269
|
+
Enabled: false
|