attractor 1.0.2 → 2.0.1

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.
@@ -1,25 +0,0 @@
1
- name: Ruby
2
-
3
- on: [push]
4
-
5
- jobs:
6
- build:
7
-
8
- runs-on: ubuntu-latest
9
-
10
- strategy:
11
- matrix:
12
- ruby-version: [2.4.x, 2.5.x, 2.6.x]
13
-
14
- steps:
15
- - uses: actions/checkout@v1
16
- - name: Set up Ruby ${{ matrix.ruby-version }}
17
- uses: actions/setup-ruby@v1
18
- with:
19
- ruby-version: ${{ matrix.ruby-version }}
20
- - name: Build and test with Rake
21
- run: |
22
- gem install bundler
23
- bundle install --jobs 4 --retry 3
24
- bundle exec rspec spec
25
- bundle exec cucumber features
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.travis.yml DELETED
@@ -1,10 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.3
7
- before_install: gem install bundler -v 2.0.2
8
- script:
9
- - bundle exec cucumber features
10
- - bundle exec rspec spec
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Attractor
4
- class JsCalculator < BaseCalculator
5
- def initialize(file_prefix: '', minimum_churn_count: 3)
6
- super(file_prefix: file_prefix, file_extension: '(js|jsx)', minimum_churn_count: minimum_churn_count)
7
- end
8
-
9
- def calculate
10
- super do |change|
11
- complexity, details = JSON.parse(`node #{__dir__}/../../../dist/calculator.bundle.js #{Dir.pwd}/#{change[:file_path]}`)
12
-
13
- [complexity, details]
14
- end
15
- end
16
- end
17
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'flog'
4
-
5
- module Attractor
6
- class RubyCalculator < BaseCalculator
7
- def initialize(file_prefix: '', minimum_churn_count: 3)
8
- super(file_prefix: file_prefix, file_extension: 'rb', minimum_churn_count: minimum_churn_count)
9
- end
10
-
11
- def calculate
12
- super do |change|
13
- flogger = Flog.new(all: true)
14
- flogger.flog(change[:file_path])
15
- complexity = flogger.total_score
16
- details = flogger.totals
17
- [complexity, details]
18
- end
19
- end
20
- end
21
- end