attractor-ruby 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.standard.yml +2 -0
- data/Rakefile +1 -1
- data/attractor-ruby.gemspec +26 -26
- data/lib/attractor/calculators/ruby_calculator.rb +16 -4
- data/lib/attractor/detectors/ruby_detector.rb +2 -2
- data/lib/attractor/ruby/version.rb +1 -1
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97f3e2a1667fd04ac05699170d07b20d17e3b3afe63b1752959db1b20e4bb7eb
|
|
4
|
+
data.tar.gz: 76f899375589d07d23ee633faedfd345a3137c0d2bced0879196957f3cbc3904
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e939c4973d1cdc0b1da61071eedddc3e187ffd56f99f5744ed8b553689fa96dd364ec2963857678f99a5a5e376841038b997d216b83a44e40a09051470ac7f5
|
|
7
|
+
data.tar.gz: 690415f46126802ff3da0c03063488c83aef2dce2f8863375e1805be1be6206aba05ffec56e4e54f5b2945987f1bb1ad595242db142bec7975ccde08330fde6d
|
data/.standard.yml
ADDED
data/Rakefile
CHANGED
data/attractor-ruby.gemspec
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
lib = File.expand_path(
|
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require
|
|
5
|
+
require "attractor/ruby/version"
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name
|
|
9
|
-
spec.version
|
|
10
|
-
spec.authors
|
|
11
|
-
spec.email
|
|
8
|
+
spec.name = "attractor-ruby"
|
|
9
|
+
spec.version = Attractor::Ruby::VERSION
|
|
10
|
+
spec.authors = ["Julian Rubisch"]
|
|
11
|
+
spec.email = ["julian@julianrubisch.at"]
|
|
12
12
|
|
|
13
|
-
spec.summary
|
|
14
|
-
spec.description
|
|
13
|
+
spec.summary = "Attractor plugin for the Ruby programming language and its ecosystem"
|
|
14
|
+
spec.description = <<-DESCRIPTION
|
|
15
15
|
Attractor plugin for the Ruby programming language and its ecosystem
|
|
16
16
|
DESCRIPTION
|
|
17
|
-
spec.homepage =
|
|
18
|
-
spec.licenses = [
|
|
17
|
+
spec.homepage = "https://github.com/julianrubisch/attractor-ruby"
|
|
18
|
+
spec.licenses = ["MIT"]
|
|
19
19
|
|
|
20
|
-
spec.metadata[
|
|
21
|
-
spec.metadata[
|
|
22
|
-
spec.metadata[
|
|
23
|
-
spec.metadata[
|
|
20
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
21
|
+
spec.metadata["source_code_uri"] = "https://github.com/julianrubisch/attractor-ruby"
|
|
22
|
+
spec.metadata["bug_tracker_uri"] = "#{spec.homepage}/issues"
|
|
23
|
+
spec.metadata["changelog_uri"] = "https://github.com/julianrubisch/attractor-ruby/CHANGELOG.md"
|
|
24
24
|
|
|
25
25
|
# Specify which files should be added to the gem when it is released.
|
|
26
26
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -30,18 +30,18 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
%w[.all-contributorsrc .rspec .rspec_status .travis.yml].include?(f)
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
-
spec.bindir
|
|
34
|
-
spec.executables
|
|
35
|
-
spec.require_paths = [
|
|
33
|
+
spec.bindir = "exe"
|
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
|
+
spec.require_paths = ["lib"]
|
|
36
36
|
|
|
37
|
-
spec.add_dependency
|
|
37
|
+
spec.add_dependency "attractor", "~> 2.0"
|
|
38
38
|
|
|
39
|
-
spec.add_development_dependency
|
|
40
|
-
spec.add_development_dependency
|
|
41
|
-
spec.add_development_dependency
|
|
42
|
-
spec.add_development_dependency
|
|
43
|
-
spec.add_development_dependency
|
|
44
|
-
spec.add_development_dependency
|
|
45
|
-
spec.add_development_dependency
|
|
46
|
-
spec.add_development_dependency
|
|
39
|
+
spec.add_development_dependency "aruba"
|
|
40
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
|
41
|
+
spec.add_development_dependency "cucumber"
|
|
42
|
+
spec.add_development_dependency "pry"
|
|
43
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
44
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
45
|
+
spec.add_development_dependency "standard"
|
|
46
|
+
spec.add_development_dependency "structured_changelog"
|
|
47
47
|
end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require "flog"
|
|
4
4
|
|
|
5
5
|
module Attractor
|
|
6
6
|
class RubyCalculator < BaseCalculator
|
|
7
|
-
def initialize(file_prefix:
|
|
8
|
-
super(file_prefix: file_prefix, ignores: ignores, file_extension:
|
|
7
|
+
def initialize(file_prefix: "", ignores: "", minimum_churn_count: 3, start_ago: 365 * 5, verbose: false)
|
|
8
|
+
super(file_prefix: file_prefix, ignores: ignores, file_extension: "rb", minimum_churn_count: minimum_churn_count, start_ago: start_ago, verbose: verbose)
|
|
9
9
|
@type = "Ruby"
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -14,9 +14,21 @@ module Attractor
|
|
|
14
14
|
flogger = Flog.new(all: true)
|
|
15
15
|
flogger.flog(change[:file_path])
|
|
16
16
|
complexity = flogger.total_score
|
|
17
|
-
details = flogger.totals
|
|
17
|
+
details = build_details(flogger.totals, flogger.method_locations)
|
|
18
18
|
[complexity, details]
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
|
+
|
|
22
|
+
private
|
|
23
|
+
|
|
24
|
+
def build_details(totals, method_locations)
|
|
25
|
+
totals.to_h do |signature, score|
|
|
26
|
+
detail = {"score" => score}
|
|
27
|
+
if (location = method_locations[signature])
|
|
28
|
+
detail["line"], detail["end_line"] = location[/:(.+)/, 1].split("-").map(&:to_i)
|
|
29
|
+
end
|
|
30
|
+
[signature, detail]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
21
33
|
end
|
|
22
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: attractor-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julian Rubisch
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2026-09-18 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: attractor
|
|
@@ -144,6 +143,7 @@ extensions: []
|
|
|
144
143
|
extra_rdoc_files: []
|
|
145
144
|
files:
|
|
146
145
|
- ".gitignore"
|
|
146
|
+
- ".standard.yml"
|
|
147
147
|
- Gemfile
|
|
148
148
|
- README.md
|
|
149
149
|
- Rakefile
|
|
@@ -162,7 +162,6 @@ metadata:
|
|
|
162
162
|
source_code_uri: https://github.com/julianrubisch/attractor-ruby
|
|
163
163
|
bug_tracker_uri: https://github.com/julianrubisch/attractor-ruby/issues
|
|
164
164
|
changelog_uri: https://github.com/julianrubisch/attractor-ruby/CHANGELOG.md
|
|
165
|
-
post_install_message:
|
|
166
165
|
rdoc_options: []
|
|
167
166
|
require_paths:
|
|
168
167
|
- lib
|
|
@@ -177,8 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
177
176
|
- !ruby/object:Gem::Version
|
|
178
177
|
version: '0'
|
|
179
178
|
requirements: []
|
|
180
|
-
rubygems_version: 3.2
|
|
181
|
-
signing_key:
|
|
179
|
+
rubygems_version: 3.6.2
|
|
182
180
|
specification_version: 4
|
|
183
181
|
summary: Attractor plugin for the Ruby programming language and its ecosystem
|
|
184
182
|
test_files: []
|