still_active 0.2.0 → 0.3.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 +4 -4
- data/.github/workflows/rspec.yml +5 -2
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -1
- data/README.md +4 -4
- data/lib/helpers/emoji_helper.rb +2 -2
- data/lib/helpers/markdown_helper.rb +1 -1
- data/lib/helpers/version_helper.rb +2 -0
- data/lib/still_active/cli.rb +3 -3
- data/lib/still_active/config.rb +2 -2
- data/lib/still_active/options.rb +4 -4
- data/lib/still_active/version.rb +1 -1
- data/lib/still_active/workflow.rb +13 -20
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a91d560fbfdb04addfdef550ffa1131936d75174f51a443c67d20f5750c58cdb
|
4
|
+
data.tar.gz: 4c1be4a9ef2e0e8bb78fc90d423bebb4fc1fa450fa07b33af3b4181b48602bad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c24f2064b40e98dd42b667d0f154340992a60ebeadebce648d04422dbef810291ee00840ee4f43599d989af5a4d7342c22f18d0b30f66a2379139fb5e353f0e
|
7
|
+
data.tar.gz: 20994aa61eae329055ab60a52b91e428c2933b81603cd0840ed7c7e7427eff3b01edb8655a9d77ad7f718564985f6589e2a40074504955db7f18dac21996b2a2
|
data/.github/workflows/rspec.yml
CHANGED
@@ -3,14 +3,17 @@ name: RSpec tests
|
|
3
3
|
on: [push,pull_request]
|
4
4
|
|
5
5
|
jobs:
|
6
|
-
|
6
|
+
test:
|
7
|
+
strategy:
|
8
|
+
matrix:
|
9
|
+
ruby: [2.6, 2.7, 3.0, head, jruby, jruby-head, truffleruby, truffleruby-head]
|
7
10
|
runs-on: ubuntu-latest
|
8
11
|
steps:
|
9
12
|
- uses: actions/checkout@v2
|
10
13
|
- name: Set up Ruby
|
11
14
|
uses: ruby/setup-ruby@v1
|
12
15
|
with:
|
13
|
-
ruby-version:
|
16
|
+
ruby-version: ${{ matrix.ruby }}
|
14
17
|
bundler-cache: true
|
15
18
|
- name: Execute the tests
|
16
19
|
run: bundle exec rspec
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## [0.3.0] - 2021-11-11
|
6
|
+
|
7
|
+
- Change `safe_range_end` to `no_warning_range_end`
|
8
|
+
- Fixes for Ruby 2.6 and 2.7
|
9
|
+
|
5
10
|
## [0.2.0] - 2021-11-11
|
6
11
|
|
7
12
|
- Add `simultaneous-requests` command line parameter (and config option) to specify the maximum number of simultaneous requests
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
still_active (0.
|
4
|
+
still_active (0.3.0)
|
5
5
|
activesupport
|
6
6
|
async
|
7
7
|
async-http
|
@@ -161,6 +161,8 @@ GEM
|
|
161
161
|
zeitwerk (2.5.1)
|
162
162
|
|
163
163
|
PLATFORMS
|
164
|
+
ruby
|
165
|
+
universal-java-11
|
164
166
|
x86_64-darwin-21
|
165
167
|
x86_64-linux
|
166
168
|
|
data/README.md
CHANGED
@@ -23,8 +23,8 @@ Usage: still_active [options]
|
|
23
23
|
--json Prints output in JSON format
|
24
24
|
--github-oauth-token=TOKEN GitHub OAuth token to make API calls
|
25
25
|
--simultaneous-requests=QTY Number of simultaneous requests made
|
26
|
-
--
|
27
|
-
--warning-range-end=YEARS maximum number of years since last activity to be
|
26
|
+
--no-warning-range-end=YEARS maximum number of years since last activity until which you do not want to be warned about
|
27
|
+
--warning-range-end=YEARS maximum number of years since last activity that you want to be warned about
|
28
28
|
--critical-warning-emoji=EMOJI
|
29
29
|
--futurist-emoji=EMOJI
|
30
30
|
--success-emoji=EMOJI
|
@@ -65,7 +65,7 @@ Outputs:
|
|
65
65
|
| | ✅ | [rubocop-performance](https://github.com/rubocop/rubocop-performance) | [1.12.0](https://rubygems.org/gems/rubocop-performance/versions/1.12.0) | 2021/10 | [1.12.0](https://rubygems.org/gems/rubocop-performance/versions/1.12.0) | 2021/10 | ❓ | ❓ | [2021/11](https://github.com/rubocop/rubocop-performance) |
|
66
66
|
| | ✅ | [rubocop-rspec](https://github.com/rubocop/rubocop-rspec) | [2.6.0](https://rubygems.org/gems/rubocop-rspec/versions/2.6.0) | 2021/11 | [2.6.0](https://rubygems.org/gems/rubocop-rspec/versions/2.6.0) | 2021/11 | [2.0.0.pre](https://rubygems.org/gems/rubocop-rspec/versions/2.0.0.pre) | 2020/10 | [2021/11](https://github.com/rubocop/rubocop-rspec) |
|
67
67
|
| | ✅ | [rubocop-shopify](https://github.com/Shopify/ruby-style-guide) | [2.3.0](https://rubygems.org/gems/rubocop-shopify/versions/2.3.0) | 2021/10 | [2.3.0](https://rubygems.org/gems/rubocop-shopify/versions/2.3.0) | 2021/10 | ❓ | ❓ | [2021/11](https://github.com/Shopify/ruby-style-guide) |
|
68
|
-
| | ✅ | [still_active](https://github.com/SeanLF/still_active) | [0.
|
68
|
+
| | ✅ | [still_active](https://github.com/SeanLF/still_active) | [0.2.0](https://rubygems.org/gems/still_active/versions/0.2.0) | 2021/11 | [0.2.0](https://rubygems.org/gems/still_active/versions/0.2.0) | 2021/11 | ❓ | ❓ | [2021/11](https://github.com/SeanLF/still_active) |
|
69
69
|
| | ✅ | [vcr](https://github.com/vcr/vcr) | [6.0.0](https://rubygems.org/gems/vcr/versions/6.0.0) | 2020/05 | [6.0.0](https://rubygems.org/gems/vcr/versions/6.0.0) | 2020/05 | [2.0.0.rc2](https://rubygems.org/gems/vcr/versions/2.0.0.rc2) | 2012/02 | [2021/10](https://github.com/vcr/vcr) |
|
70
70
|
| | ✅ | [webmock](https://github.com/bblimke/webmock) | [3.14.0](https://rubygems.org/gems/webmock/versions/3.14.0) | 2021/08 | [3.14.0](https://rubygems.org/gems/webmock/versions/3.14.0) | 2021/08 | [2.0.0.beta2](https://rubygems.org/gems/webmock/versions/2.0.0.beta2) | 2016/04 | [2021/09](https://github.com/bblimke/webmock) |
|
71
71
|
|
@@ -78,7 +78,7 @@ Outputs:
|
|
78
78
|
- `success_emoji` ✅
|
79
79
|
- `unsure_emoji` ❓
|
80
80
|
- `warning_emoji` ⚠️
|
81
|
-
- `
|
81
|
+
- `no_warning_range_end` 1 (considered safe if last activity is at most 1 year ago)
|
82
82
|
- `warning_range_end` 3 (warns if last activity is between 1 and 3 years ago)
|
83
83
|
|
84
84
|
## Development
|
data/lib/helpers/emoji_helper.rb
CHANGED
@@ -11,9 +11,9 @@ module StillActive
|
|
11
11
|
return StillActive.config.unsure_emoji if most_recent_activity.nil?
|
12
12
|
|
13
13
|
case most_recent_activity
|
14
|
-
when (StillActive.config.
|
14
|
+
when (StillActive.config.no_warning_range_end.years.ago)..(Time.now)
|
15
15
|
""
|
16
|
-
when (StillActive.config.warning_range_end.years.ago)..(StillActive.config.
|
16
|
+
when (StillActive.config.warning_range_end.years.ago)..(StillActive.config.no_warning_range_end.years.ago)
|
17
17
|
StillActive.config.warning_emoji
|
18
18
|
else
|
19
19
|
StillActive.config.critical_warning_emoji
|
@@ -36,7 +36,7 @@ module StillActive
|
|
36
36
|
last_commit_date = data.dig(:last_commit_date)
|
37
37
|
last_commit_url = repository_url
|
38
38
|
|
39
|
-
inactive_repository_emoji = data.dig(:
|
39
|
+
inactive_repository_emoji = data.dig(:last_activity_warning_emoj)
|
40
40
|
using_latest_version_emoji = data.dig(:up_to_date_emoji)
|
41
41
|
|
42
42
|
formatted_name = markdown_url(text: gem_name, url: repository_url)
|
data/lib/still_active/cli.rb
CHANGED
@@ -27,12 +27,12 @@ module StillActive
|
|
27
27
|
puts MarkdownHelper.markdown_table_header_line
|
28
28
|
result.keys.sort.each do |name|
|
29
29
|
result[name].merge!({
|
30
|
-
|
30
|
+
last_activity_warning_emoj: EmojiHelper.inactive_gem_emoji(result[name]),
|
31
31
|
up_to_date_emoji: EmojiHelper.using_latest_emoji(
|
32
|
-
using_last_release: up_to_date?(
|
32
|
+
using_last_release: VersionHelper.up_to_date?(
|
33
33
|
version_used: result[name].dig(:version_used), latest_version: result[name].dig(:latest_version)
|
34
34
|
),
|
35
|
-
using_last_pre_release: up_to_date?(
|
35
|
+
using_last_pre_release: VersionHelper.up_to_date?(
|
36
36
|
version_used: result[name].dig(:version_used), latest_version: result[name].dig(:latest_pre_release_version)
|
37
37
|
),
|
38
38
|
),
|
data/lib/still_active/config.rb
CHANGED
@@ -5,7 +5,7 @@ require "bundler"
|
|
5
5
|
module StillActive
|
6
6
|
class Config
|
7
7
|
attr_accessor :critical_warning_emoji, :futurist_emoji, :gemfile_path, :gems, :github_oauth_token, :output_format,
|
8
|
-
:parallelism, :
|
8
|
+
:parallelism, :no_warning_range_end, :success_emoji, :unsure_emoji, :warning_emoji, :warning_range_end
|
9
9
|
|
10
10
|
def initialize
|
11
11
|
@gemfile_path = Bundler.default_gemfile.to_s
|
@@ -21,7 +21,7 @@ module StillActive
|
|
21
21
|
@unsure_emoji = "❓"
|
22
22
|
@warning_emoji = "⚠️"
|
23
23
|
|
24
|
-
@
|
24
|
+
@no_warning_range_end = 1
|
25
25
|
@warning_range_end = 3
|
26
26
|
end
|
27
27
|
|
data/lib/still_active/options.rb
CHANGED
@@ -65,12 +65,12 @@ module StillActive
|
|
65
65
|
end
|
66
66
|
|
67
67
|
def add_range_options(opts)
|
68
|
-
opts.on("--
|
69
|
-
"maximum number of years since last activity to be
|
70
|
-
StillActive.config { |config| config.
|
68
|
+
opts.on("--no-warning-range-end=YEARS", Integer,
|
69
|
+
"maximum number of years since last activity until which you do not want to be warned about ") do |value|
|
70
|
+
StillActive.config { |config| config.no_warning_range_end = value }
|
71
71
|
end
|
72
72
|
opts.on("--warning-range-end=YEARS", Integer,
|
73
|
-
"maximum number of years since last activity to be
|
73
|
+
"maximum number of years since last activity that you want to be warned about") do |value|
|
74
74
|
StillActive.config { |config| config.warning_range_end = value }
|
75
75
|
end
|
76
76
|
end
|
data/lib/still_active/version.rb
CHANGED
@@ -39,14 +39,14 @@ module StillActive
|
|
39
39
|
repo_info = repository_info(gem_name: gem_name, versions: vs)
|
40
40
|
last_commit_date = last_commit_date(source: repo_info[:source], repository_owner: repo_info[:owner],
|
41
41
|
repository_name: repo_info[:name])
|
42
|
-
last_release = find_version(versions: vs, pre_release: false)
|
43
|
-
last_pre_release = find_version(versions: vs, pre_release: true)
|
42
|
+
last_release = VersionHelper.find_version(versions: vs, pre_release: false)
|
43
|
+
last_pre_release = VersionHelper.find_version(versions: vs, pre_release: true)
|
44
44
|
result_object[gem_name].merge!({
|
45
|
-
latest_version: gem_version(version_hash: last_release),
|
46
|
-
latest_version_release_date: release_date(version_hash: last_release),
|
45
|
+
latest_version: VersionHelper.gem_version(version_hash: last_release),
|
46
|
+
latest_version_release_date: VersionHelper.release_date(version_hash: last_release),
|
47
47
|
|
48
|
-
latest_pre_release_version: gem_version(version_hash: last_pre_release),
|
49
|
-
latest_pre_release_version_release_date: release_date(version_hash: last_pre_release),
|
48
|
+
latest_pre_release_version: VersionHelper.gem_version(version_hash: last_pre_release),
|
49
|
+
latest_pre_release_version_release_date: VersionHelper.release_date(version_hash: last_pre_release),
|
50
50
|
|
51
51
|
repository_url: repo_info[:url],
|
52
52
|
last_commit_date: last_commit_date,
|
@@ -57,17 +57,16 @@ module StillActive
|
|
57
57
|
end
|
58
58
|
|
59
59
|
if gem_version
|
60
|
-
version_used = find_version(versions: vs, version_string: gem_version)
|
60
|
+
version_used = VersionHelper.find_version(versions: vs, version_string: gem_version)
|
61
61
|
result_object[gem_name].merge!({
|
62
|
-
# global_warning: global_warning,
|
63
62
|
up_to_date:
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
63
|
+
VersionHelper.up_to_date?(
|
64
|
+
version_used: version_used,
|
65
|
+
latest_version: last_release,
|
66
|
+
latest_pre_release_version: last_pre_release
|
67
|
+
),
|
69
68
|
|
70
|
-
version_used_release_date: release_date(version_hash: version_used),
|
69
|
+
version_used_release_date: VersionHelper.release_date(version_hash: version_used),
|
71
70
|
})
|
72
71
|
end
|
73
72
|
rescue StandardError => e
|
@@ -82,7 +81,6 @@ module StillActive
|
|
82
81
|
end
|
83
82
|
|
84
83
|
def repository_info(gem_name:, versions:)
|
85
|
-
# binding.break # if gem_name == "still_active"
|
86
84
|
valid_repository_url =
|
87
85
|
installed_gem_urls(gem_name: gem_name).find { |url| Repository.valid?(url: url) } ||
|
88
86
|
rubygems_versions_repository_url(versions: versions).find { |url| Repository.valid?(url: url) } ||
|
@@ -90,7 +88,6 @@ module StillActive
|
|
90
88
|
Repository.url_with_owner_and_name(url: valid_repository_url)
|
91
89
|
end
|
92
90
|
|
93
|
-
# does not make network requests
|
94
91
|
def installed_gem_urls(gem_name:)
|
95
92
|
info = Gem::Dependency.new(gem_name).matching_specs.first
|
96
93
|
return [] if info.nil?
|
@@ -101,14 +98,12 @@ module StillActive
|
|
101
98
|
].compact.uniq
|
102
99
|
end
|
103
100
|
|
104
|
-
# does not make network requests
|
105
101
|
def rubygems_versions_repository_url(versions:)
|
106
102
|
versions
|
107
103
|
.filter_map { |version| version.dig("metadata", "source_code_uri") }
|
108
104
|
.uniq
|
109
105
|
end
|
110
106
|
|
111
|
-
# makes network request
|
112
107
|
def rubygems_gem_repository_url(gem_name:)
|
113
108
|
info = Gems.info(gem_name)
|
114
109
|
return [] if info.nil?
|
@@ -121,7 +116,6 @@ module StillActive
|
|
121
116
|
[]
|
122
117
|
end
|
123
118
|
|
124
|
-
# makes network request
|
125
119
|
def last_commit(source:, repository_owner:, repository_name:)
|
126
120
|
case source.to_sym
|
127
121
|
when :github
|
@@ -131,7 +125,6 @@ module StillActive
|
|
131
125
|
end
|
132
126
|
end
|
133
127
|
|
134
|
-
# makes network request
|
135
128
|
def last_commit_date(source:, repository_owner:, repository_name:)
|
136
129
|
commit = last_commit(source: source, repository_owner: repository_owner, repository_name: repository_name)
|
137
130
|
case source.to_sym
|