attractor-javascript 0.3.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/.gitignore +3 -1
- data/.standard.yml +2 -0
- data/Rakefile +3 -3
- data/attractor-javascript.gemspec +26 -26
- data/dist/calculator.bundle.js +1 -1
- data/lib/attractor/calculators/js_calculator.rb +7 -4
- data/lib/attractor/detectors/js_detector.rb +2 -2
- data/lib/attractor/javascript/version.rb +1 -1
- metadata +6 -8
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
module Attractor
|
|
4
4
|
class JsCalculator < BaseCalculator
|
|
5
|
-
def initialize(file_prefix:
|
|
6
|
-
super(file_prefix: file_prefix, ignores: ignores, file_extension:
|
|
5
|
+
def initialize(file_prefix: "", ignores: "", minimum_churn_count: 3, start_ago: 365 * 5, verbose: false, files: nil)
|
|
6
|
+
super(file_prefix: file_prefix, ignores: ignores, file_extension: "(js|jsx)", minimum_churn_count: minimum_churn_count, start_ago: start_ago, verbose: verbose, files: files)
|
|
7
7
|
@type = "JavaScript"
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def calculate
|
|
11
11
|
super do |change|
|
|
12
|
-
|
|
12
|
+
file_path = File.expand_path(change[:file_path])
|
|
13
|
+
output = `node #{__dir__}/../../../dist/calculator.bundle.js #{file_path}`
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
complexity, details, symbols = JSON.parse(output)
|
|
16
|
+
|
|
17
|
+
[complexity, details, symbols]
|
|
15
18
|
end
|
|
16
19
|
end
|
|
17
20
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: attractor-javascript
|
|
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
|
|
@@ -86,14 +85,14 @@ dependencies:
|
|
|
86
85
|
requirements:
|
|
87
86
|
- - "~>"
|
|
88
87
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '
|
|
88
|
+
version: '13.0'
|
|
90
89
|
type: :development
|
|
91
90
|
prerelease: false
|
|
92
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
92
|
requirements:
|
|
94
93
|
- - "~>"
|
|
95
94
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
95
|
+
version: '13.0'
|
|
97
96
|
- !ruby/object:Gem::Dependency
|
|
98
97
|
name: rspec
|
|
99
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -144,6 +143,7 @@ extensions: []
|
|
|
144
143
|
extra_rdoc_files: []
|
|
145
144
|
files:
|
|
146
145
|
- ".gitignore"
|
|
146
|
+
- ".standard.yml"
|
|
147
147
|
- ".tool-versions"
|
|
148
148
|
- Gemfile
|
|
149
149
|
- README.md
|
|
@@ -164,7 +164,6 @@ metadata:
|
|
|
164
164
|
source_code_uri: https://github.com/julianrubisch/attractor-javascript
|
|
165
165
|
bug_tracker_uri: https://github.com/julianrubisch/attractor-javascript/issues
|
|
166
166
|
changelog_uri: https://github.com/julianrubisch/attractor-javascript/CHANGELOG.md
|
|
167
|
-
post_install_message:
|
|
168
167
|
rdoc_options: []
|
|
169
168
|
require_paths:
|
|
170
169
|
- lib
|
|
@@ -179,8 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
179
178
|
- !ruby/object:Gem::Version
|
|
180
179
|
version: '0'
|
|
181
180
|
requirements: []
|
|
182
|
-
rubygems_version: 3.
|
|
183
|
-
signing_key:
|
|
181
|
+
rubygems_version: 3.6.2
|
|
184
182
|
specification_version: 4
|
|
185
183
|
summary: Attractor plugin for the Ruby programming language and its ecosystem
|
|
186
184
|
test_files: []
|