polariscope 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +0 -8
- data/lib/polariscope/version.rb +1 -1
- data/lib/polariscope.rb +0 -5
- metadata +2 -3
- data/lib/polariscope/color/hsl.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca212ea26786fe08b35c20df001624cbf7d5ade85f4e886f134ec148cd56ebe8
|
4
|
+
data.tar.gz: 749017d687096257534e62d7c6a1302ce999ed4cc5bb80010c78f60911927279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83af0de56791f4482451f46ad24f60cee32b8b406627d94ef6dc7c64356108db9dcf38dd37797422b3f9dac9e14b8eba72645932f338673b6553445178e692c0
|
7
|
+
data.tar.gz: eadb0cd4ccd33997dae72b93017ec35571f9ea91426b330c433ab2bce45f2680a71531a765c2f233f9dd9e6cc1cff987d1cf857f68a84a8e77a5bfdd07bcae80
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -55,14 +55,6 @@ The return value will indicate how healthy your project is on a scale from 0 to
|
|
55
55
|
|
56
56
|
#### Additional features
|
57
57
|
|
58
|
-
##### Score color
|
59
|
-
|
60
|
-
Get the score color for a score:
|
61
|
-
|
62
|
-
```ruby
|
63
|
-
Polariscope.score_color(60.75)
|
64
|
-
```
|
65
|
-
|
66
58
|
##### Gem versions
|
67
59
|
|
68
60
|
Get the released or latest version of gems with:
|
data/lib/polariscope/version.rb
CHANGED
data/lib/polariscope.rb
CHANGED
@@ -4,7 +4,6 @@ require_relative 'polariscope/version'
|
|
4
4
|
require_relative 'polariscope/scanner/codebase_health_score'
|
5
5
|
require_relative 'polariscope/scanner/gem_versions'
|
6
6
|
require_relative 'polariscope/file_content'
|
7
|
-
require_relative 'polariscope/color/hsl'
|
8
7
|
|
9
8
|
module Polariscope
|
10
9
|
Error = Class.new(StandardError)
|
@@ -18,10 +17,6 @@ module Polariscope
|
|
18
17
|
).health_score
|
19
18
|
end
|
20
19
|
|
21
|
-
def score_color(score)
|
22
|
-
Color::Hsl.for(score)
|
23
|
-
end
|
24
|
-
|
25
20
|
def gem_versions(dependency_names, spec_type: :released)
|
26
21
|
Scanner::GemVersions.new(dependency_names, spec_type: spec_type)
|
27
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polariscope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rails team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,7 +55,6 @@ files:
|
|
55
55
|
- Rakefile
|
56
56
|
- exe/polariscope
|
57
57
|
- lib/polariscope.rb
|
58
|
-
- lib/polariscope/color/hsl.rb
|
59
58
|
- lib/polariscope/file_content.rb
|
60
59
|
- lib/polariscope/scanner/codebase_health_score.rb
|
61
60
|
- lib/polariscope/scanner/gem_health_score.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Polariscope
|
4
|
-
module Color
|
5
|
-
class Hsl
|
6
|
-
MAX_HUE = 120
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def for(score)
|
10
|
-
new(score).hsl
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def initialize(score)
|
15
|
-
@score = score
|
16
|
-
end
|
17
|
-
|
18
|
-
def hsl
|
19
|
-
return '' unless score
|
20
|
-
|
21
|
-
"hsl(#{hue}, 100%, 45%)"
|
22
|
-
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
attr_reader :score
|
27
|
-
|
28
|
-
def hue
|
29
|
-
(MAX_HUE * (rounded_score / 100.0)).round
|
30
|
-
end
|
31
|
-
|
32
|
-
def rounded_score
|
33
|
-
(score / 5).round * 5
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|