polariscope 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +65 -8
- data/lib/polariscope/version.rb +1 -1
- data/lib/polariscope.rb +1 -1
- data/polariscope.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbffdce0784ea9e04a8a70ce76826f2a4585509bdf458a993c7f8d433ef4c8cd
|
4
|
+
data.tar.gz: 5a8fd12fb706744204fd96052716df30b595bf636c2a33d795c48fbd76554286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac88021029fbe6c211fd361b4c08ba1bd7c15c8f3d18d6626d33db6f340c3f227a4420dd65a8eb88e0aae492e9b225065d77304b6ebf311d8e1f4fda2bea8eb
|
7
|
+
data.tar.gz: 3003407cde63e74bead70bb722482ee06da18f539e38cea0e900d2bde6e1f7d1aaf14166d7acaf3921b20248f79144e81afc1da94abfeaf71aeb0bf5a9a0e14c
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,24 +1,81 @@
|
|
1
1
|
# Polariscope
|
2
2
|
|
3
|
-
|
3
|
+
Polariscope is a Ruby gem designed to evaluate the overall health of your Ruby application by analyzing its dependencies. It calculates a health score based on how many dependencies are outdated, meaning there are newer versions available. Keeping dependencies up-to-date is crucial for maintaining application security, performance, and compatibility. This gem provides a quick and easy way to gauge the state of your project's dependencies and take proactive measures to improve its health.
|
4
4
|
|
5
|
-
|
5
|
+
### Health Score Algorithm
|
6
6
|
|
7
|
-
|
7
|
+
The health score calculation is based on the following mathematical formula:
|
8
|
+
|
9
|
+
![Health Score Algorithm](docs/algorithm.png)
|
8
10
|
|
9
|
-
|
11
|
+
## Installation
|
10
12
|
|
11
13
|
Install the gem and add to the application's Gemfile by executing:
|
12
14
|
|
13
|
-
$ bundle add
|
15
|
+
$ bundle add polariscope
|
14
16
|
|
15
17
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
18
|
|
17
|
-
$ gem install
|
19
|
+
$ gem install polariscope
|
20
|
+
|
21
|
+
### Known issue
|
22
|
+
|
23
|
+
If your default Ruby version is 3.1.2, you might get this error when installing polariscope:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/rdoc-6.7.0/lib/rdoc/version.rb:8: warning: already initialized constant RDoc::VERSION
|
27
|
+
ERROR: While executing gem ... (NameError)
|
28
|
+
uninitialized constant RDoc::Markdown
|
29
|
+
|
30
|
+
'markdown' => RDoc::Markdown,
|
31
|
+
^^^^^^^^^^
|
32
|
+
```
|
33
|
+
|
34
|
+
You can ignore this error. It doesn't occur in other Ruby versions and it doesn't prevent you from using polariscope.
|
18
35
|
|
19
36
|
## Usage
|
20
37
|
|
21
|
-
|
38
|
+
Polariscope can be used in 2 ways.
|
39
|
+
|
40
|
+
### CLI
|
41
|
+
|
42
|
+
Position yourself in a Ruby application and run:
|
43
|
+
|
44
|
+
```bash
|
45
|
+
polariscope scan
|
46
|
+
```
|
47
|
+
|
48
|
+
### IRB / Rails
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
Polariscope.scan
|
52
|
+
```
|
53
|
+
|
54
|
+
The return value will indicate how healthy your project is on a scale from 0 to 100.
|
55
|
+
|
56
|
+
#### Additional features
|
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
|
+
##### Gem versions
|
67
|
+
|
68
|
+
Get the released or latest version of gems with:
|
69
|
+
|
70
|
+
```ruby
|
71
|
+
# released versions
|
72
|
+
gem_specs = Polariscope.gem_versions(['gem_name_1', 'gem_name_2'])
|
73
|
+
gem_specs.versions_for('gem_name_1') # => returns potentially many versions
|
74
|
+
|
75
|
+
# latest version
|
76
|
+
gem_specs = Polariscope.gem_versions(['gem_name_1', 'gem_name_2'], spec_type: :latest)
|
77
|
+
gem_specs.versions_for('gem_name_1') # => returns latest version
|
78
|
+
```
|
22
79
|
|
23
80
|
## Development
|
24
81
|
|
@@ -28,7 +85,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
28
85
|
|
29
86
|
## Contributing
|
30
87
|
|
31
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
88
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/infinum/polariscope.
|
32
89
|
|
33
90
|
## License
|
34
91
|
|
data/lib/polariscope/version.rb
CHANGED
data/lib/polariscope.rb
CHANGED
data/polariscope.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ['Rails team']
|
9
9
|
spec.email = ['team.rails@infinum.com']
|
10
10
|
|
11
|
-
spec.summary = '
|
11
|
+
spec.summary = 'Calculate the health score of a Ruby application based on the state of its dependencies'
|
12
12
|
spec.homepage = 'https://github.com/infinum/polariscope'
|
13
13
|
spec.license = 'MIT'
|
14
14
|
spec.required_ruby_version = '>= 3.0.0'
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
24
|
spec.files = Dir.chdir(__dir__) do
|
25
25
|
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
-
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|sig)/|\.(?:git|circleci)|appveyor)})
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features|sig|docs)/|\.(?:git|circleci)|appveyor)})
|
27
27
|
end + Dir['exe/polariscope'] + Dir['lib/**/*']
|
28
28
|
end
|
29
29
|
spec.bindir = 'exe'
|
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.1
|
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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,5 +92,6 @@ requirements: []
|
|
92
92
|
rubygems_version: 3.5.3
|
93
93
|
signing_key:
|
94
94
|
specification_version: 4
|
95
|
-
summary:
|
95
|
+
summary: Calculate the health score of a Ruby application based on the state of its
|
96
|
+
dependencies
|
96
97
|
test_files: []
|