polariscope 0.1.3 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca212ea26786fe08b35c20df001624cbf7d5ade85f4e886f134ec148cd56ebe8
4
- data.tar.gz: 749017d687096257534e62d7c6a1302ce999ed4cc5bb80010c78f60911927279
3
+ metadata.gz: bedcc2db6f82679631ccdd4d7d3b007beaa22421639347301ab37e43796cab9a
4
+ data.tar.gz: fb9904ba457696f0409c7b6162ad99843c8abae2d23d26dfc10391bc306bdd53
5
5
  SHA512:
6
- metadata.gz: 83af0de56791f4482451f46ad24f60cee32b8b406627d94ef6dc7c64356108db9dcf38dd37797422b3f9dac9e14b8eba72645932f338673b6553445178e692c0
7
- data.tar.gz: eadb0cd4ccd33997dae72b93017ec35571f9ea91426b330c433ab2bce45f2680a71531a765c2f233f9dd9e6cc1cff987d1cf857f68a84a8e77a5bfdd07bcae80
6
+ metadata.gz: 7c986b31f221691c6de5ffc81d354b07bbd96a2003b5537a8f59d2e74fd1733f39f348be129c6ec9d65b5491131aabda10ee14b8e6a27a55f73dfc7882210c09
7
+ data.tar.gz: 68377f2df1b43e99b9cd2ff88a2b9cfac558246dac6144ea77d011112bcf48b4e44f979a663499e2fdc21e751d1ac333a556dd99630d8073af4f9be6d5142dba
data/.rubocop.yml CHANGED
@@ -11,6 +11,18 @@ AllCops:
11
11
  RSpec/MultipleExpectations:
12
12
  Max: 5
13
13
 
14
+ RSpec/NestedGroups:
15
+ Max: 5
16
+
17
+ RSpec/MultipleMemoizedHelpers:
18
+ Enabled: false
19
+
14
20
  Style/FrozenStringLiteralComment:
15
21
  Exclude:
16
22
  - 'exe/polariscope'
23
+
24
+ Rails/TimeZone:
25
+ Enabled: false
26
+
27
+ Rails/Date:
28
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2024-08-23
4
+
5
+ - Check if audit database is missing or stale (older than 7 weeks) & update if true
6
+
3
7
  ## [0.1.3] - 2024-08-12
4
8
 
5
9
  - Remove color#hsl feature
@@ -17,7 +17,8 @@ module Polariscope
17
17
 
18
18
  begin
19
19
  GemfileHealthScore.new(gemfile_path: gemfile_file.path, gemfile_lock_content: gemfile_lock_content,
20
- bundler_audit_config_path: bundler_audit_config_file.path).health_score
20
+ bundler_audit_config_path: bundler_audit_config_file.path,
21
+ update_audit_database: update_audit_database?).health_score
21
22
  ensure
22
23
  gemfile_file.unlink
23
24
  bundler_audit_config_file.unlink
@@ -51,6 +52,18 @@ module Polariscope
51
52
  def blank?(value)
52
53
  value.nil? || value == ''
53
54
  end
55
+
56
+ def update_audit_database?
57
+ audit_db_missing? || audit_db_stale?
58
+ end
59
+
60
+ def audit_db_missing?
61
+ !Bundler::Audit::Database.exists?
62
+ end
63
+
64
+ def audit_db_stale?
65
+ ((Time.now - Bundler::Audit::Database.new.last_updated_at) / 86_400) > 7
66
+ end
54
67
  end
55
68
  end
56
69
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Polariscope
4
- VERSION = '0.1.3'
4
+ VERSION = '0.2.0'
5
5
  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.3
4
+ version: 0.2.0
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-12 00:00:00.000000000 Z
11
+ date: 2024-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler