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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '012182ad9b21b397a1b59d91c199bef8a751baa727c0a3d95703dd0df13ee3d2'
4
- data.tar.gz: fa12186f4461ba71e1a9d252c4115fd009f006e3abca2b0ab957bf9862140e89
3
+ metadata.gz: bbffdce0784ea9e04a8a70ce76826f2a4585509bdf458a993c7f8d433ef4c8cd
4
+ data.tar.gz: 5a8fd12fb706744204fd96052716df30b595bf636c2a33d795c48fbd76554286
5
5
  SHA512:
6
- metadata.gz: 8a25dd7a42b93ff2081b7042fbae6c3f65c769933ad1792f345913c84b9c7daafc735f2a92e0a8e1d5c6d79fe46f481b8e227dac3afcfc54034778ab04a7ac1f
7
- data.tar.gz: 4d9acf916ef3a6ffdc51dd234e3f5dded843d726103320eeddea02a8da7b828803bae605f1fc3cd8aa6331daf58aa8faf6a2e62bfc36185b0487b39d88d01352
6
+ metadata.gz: 6ac88021029fbe6c211fd361b4c08ba1bd7c15c8f3d18d6626d33db6f340c3f227a4420dd65a8eb88e0aae492e9b225065d77304b6ebf311d8e1f4fda2bea8eb
7
+ data.tar.gz: 3003407cde63e74bead70bb722482ee06da18f539e38cea0e900d2bde6e1f7d1aaf14166d7acaf3921b20248f79144e81afc1da94abfeaf71aeb0bf5a9a0e14c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.1] - 2024-08-08
4
+
5
+ - Make **spec_type** optional in `.gem_versions`
6
+ - Add readme
7
+
3
8
  ## [0.1.0] - 2024-08-07
4
9
 
5
10
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polariscope (0.1.0)
4
+ polariscope (0.1.1)
5
5
  bundler
6
6
  bundler-audit
7
7
 
data/README.md CHANGED
@@ -1,24 +1,81 @@
1
1
  # Polariscope
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
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
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/polariscope`. To experiment with that code, run `bin/console` for an interactive prompt.
5
+ ### Health Score Algorithm
6
6
 
7
- ## Installation
7
+ The health score calculation is based on the following mathematical formula:
8
+
9
+ ![Health Score Algorithm](docs/algorithm.png)
8
10
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
11
+ ## Installation
10
12
 
11
13
  Install the gem and add to the application's Gemfile by executing:
12
14
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
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 UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
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
- TODO: Write usage instructions here
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/[USERNAME]/polariscope.
88
+ Bug reports and pull requests are welcome on GitHub at https://github.com/infinum/polariscope.
32
89
 
33
90
  ## License
34
91
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polariscope
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
data/lib/polariscope.rb CHANGED
@@ -22,7 +22,7 @@ module Polariscope
22
22
  Color::Hsl.for(score)
23
23
  end
24
24
 
25
- def gem_versions(dependency_names, spec_type:)
25
+ def gem_versions(dependency_names, spec_type: :released)
26
26
  Scanner::GemVersions.new(dependency_names, spec_type: spec_type)
27
27
  end
28
28
  end
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 = 'Tool for determining the health of a project based on the state of dependencies'
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.0
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-07 00:00:00.000000000 Z
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: Tool for determining the health of a project based on the state of dependencies
95
+ summary: Calculate the health score of a Ruby application based on the state of its
96
+ dependencies
96
97
  test_files: []