still_active 0.1.1 → 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 +4 -4
- data/.github/workflows/codeql-analysis.yml +70 -0
- data/.github/workflows/{main.yml → rspec.yml} +3 -3
- data/.github/workflows/rubocop-analysis.yml +47 -0
- data/.rspec +0 -1
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +19 -1
- data/Gemfile +4 -3
- data/Gemfile.lock +23 -2
- data/README.md +16 -10
- data/bin/console +0 -2
- data/fixtures/vcr_cassettes/gems.yml +2697 -0
- data/lib/still_active/cli.rb +0 -1
- data/lib/still_active/config.rb +3 -1
- data/lib/still_active/options.rb +7 -0
- data/lib/still_active/repository.rb +4 -1
- data/lib/still_active/version.rb +1 -1
- data/lib/still_active/workflow.rb +6 -7
- data/still_active.gemspec +3 -1
- metadata +39 -8
data/lib/still_active/cli.rb
CHANGED
data/lib/still_active/config.rb
CHANGED
@@ -5,12 +5,14 @@ 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
|
-
:safe_range_end, :success_emoji, :unsure_emoji, :warning_emoji, :warning_range_end
|
8
|
+
:parallelism, :safe_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
|
12
12
|
@gems = []
|
13
13
|
|
14
|
+
@parallelism = 10
|
15
|
+
|
14
16
|
@output_format = :markdown
|
15
17
|
|
16
18
|
@critical_warning_emoji = "🚩"
|
data/lib/still_active/options.rb
CHANGED
@@ -15,6 +15,7 @@ module StillActive
|
|
15
15
|
add_gems_option(opts)
|
16
16
|
add_output_options(opts)
|
17
17
|
add_token_options(opts)
|
18
|
+
add_parallelism_options(opts)
|
18
19
|
add_range_options(opts)
|
19
20
|
add_emoji_options(opts)
|
20
21
|
end
|
@@ -57,6 +58,12 @@ module StillActive
|
|
57
58
|
end
|
58
59
|
end
|
59
60
|
|
61
|
+
def add_parallelism_options(opts)
|
62
|
+
opts.on("--simultaneous-requests=QTY", Integer, "Number of simultaneous requests made") do |value|
|
63
|
+
StillActive.config { |config| config.parallelism = value }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
60
67
|
def add_range_options(opts)
|
61
68
|
opts.on("--safe-range-end=YEARS", Integer,
|
62
69
|
"maximum number of years since last activity to be considered safe") do |value|
|
@@ -5,6 +5,9 @@ module StillActive
|
|
5
5
|
GITHUB_REGEX = %r{(http(?:s)?://(?:www\.)?(github)\.com/((?:\w|_|-)+)/((?:\w|_|-)+))}i
|
6
6
|
GITLAB_REGEX = %r{(http(?:s)?://(?:www\.)?(gitlab)\.com/((?:\w|_|-)+)/((?:\w|_|-)+))}i
|
7
7
|
|
8
|
+
HASH_KEYS = [:url, :source, :owner, :name]
|
9
|
+
private_constant :HASH_KEYS
|
10
|
+
|
8
11
|
extend self
|
9
12
|
|
10
13
|
def valid?(url:)
|
@@ -18,7 +21,7 @@ module StillActive
|
|
18
21
|
values = url&.scan(regex)&.first
|
19
22
|
next if values.nil? || values.empty?
|
20
23
|
|
21
|
-
return
|
24
|
+
return HASH_KEYS.zip(values).to_h
|
22
25
|
end
|
23
26
|
{ source: :unhandled, owner: nil, name: nil }
|
24
27
|
end
|
data/lib/still_active/version.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative "repository"
|
|
4
4
|
require_relative "../helpers/version_helper"
|
5
5
|
require "async"
|
6
6
|
require "async/barrier"
|
7
|
+
require "async/semaphore"
|
7
8
|
require "gems"
|
8
9
|
require "github_api"
|
9
10
|
|
@@ -15,9 +16,10 @@ module StillActive
|
|
15
16
|
def call
|
16
17
|
task = Async do
|
17
18
|
barrier = Async::Barrier.new
|
19
|
+
semaphore = Async::Semaphore.new(StillActive.config.parallelism, parent: barrier)
|
18
20
|
result_object = {}
|
19
21
|
StillActive.config.gems.each_with_object(result_object) do |gem, hash|
|
20
|
-
|
22
|
+
semaphore.async do
|
21
23
|
gem_info(gem_name: gem[:name], result_object: hash, gem_version: gem.dig(:version))
|
22
24
|
end
|
23
25
|
end
|
@@ -31,9 +33,7 @@ module StillActive
|
|
31
33
|
|
32
34
|
def gem_info(gem_name:, result_object:, gem_version: nil)
|
33
35
|
result_object[gem_name] = {}
|
34
|
-
result_object[gem_name]
|
35
|
-
version_used: gem_version,
|
36
|
-
}) if gem_version
|
36
|
+
result_object[gem_name][:version_used] = gem_version if gem_version
|
37
37
|
|
38
38
|
vs = versions(gem_name: gem_name)
|
39
39
|
repo_info = repository_info(gem_name: gem_name, versions: vs)
|
@@ -53,7 +53,7 @@ module StillActive
|
|
53
53
|
})
|
54
54
|
|
55
55
|
unless vs.empty?
|
56
|
-
result_object[gem_name]
|
56
|
+
result_object[gem_name][:ruby_gems_url] = "https://rubygems.org/gems/#{gem_name}"
|
57
57
|
end
|
58
58
|
|
59
59
|
if gem_version
|
@@ -104,8 +104,7 @@ module StillActive
|
|
104
104
|
# does not make network requests
|
105
105
|
def rubygems_versions_repository_url(versions:)
|
106
106
|
versions
|
107
|
-
.
|
108
|
-
.compact
|
107
|
+
.filter_map { |version| version.dig("metadata", "source_code_uri") }
|
109
108
|
.uniq
|
110
109
|
end
|
111
110
|
|
data/still_active.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
|
11
11
|
spec.summary = "Check if gems are under active development."
|
12
12
|
spec.description = "Obtain last release, pre-release, and last commit date to determine if a gem is still under active development."
|
13
|
-
spec.homepage = "https://github.com/SeanLF/still_active
|
13
|
+
spec.homepage = "https://github.com/SeanLF/still_active"
|
14
14
|
spec.license = "MIT"
|
15
15
|
spec.required_ruby_version = ">= 2.6.0"
|
16
16
|
|
@@ -35,6 +35,8 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency("debug")
|
36
36
|
spec.add_development_dependency("faker")
|
37
37
|
spec.add_development_dependency("rubocop")
|
38
|
+
spec.add_development_dependency("rubocop-performance")
|
39
|
+
spec.add_development_dependency("rubocop-rspec")
|
38
40
|
spec.add_development_dependency("rubocop-shopify")
|
39
41
|
|
40
42
|
spec.add_runtime_dependency("activesupport")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: still_active
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Floyd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dead_end
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-performance
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop-rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: rubocop-shopify
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,7 +187,9 @@ executables:
|
|
159
187
|
extensions: []
|
160
188
|
extra_rdoc_files: []
|
161
189
|
files:
|
162
|
-
- ".github/workflows/
|
190
|
+
- ".github/workflows/codeql-analysis.yml"
|
191
|
+
- ".github/workflows/rspec.yml"
|
192
|
+
- ".github/workflows/rubocop-analysis.yml"
|
163
193
|
- ".gitignore"
|
164
194
|
- ".rspec"
|
165
195
|
- ".rubocop.yml"
|
@@ -172,6 +202,7 @@ files:
|
|
172
202
|
- bin/console
|
173
203
|
- bin/setup
|
174
204
|
- bin/still_active
|
205
|
+
- fixtures/vcr_cassettes/gems.yml
|
175
206
|
- lib/helpers/bundler_helper.rb
|
176
207
|
- lib/helpers/emoji_helper.rb
|
177
208
|
- lib/helpers/markdown_helper.rb
|
@@ -185,13 +216,13 @@ files:
|
|
185
216
|
- lib/still_active/version.rb
|
186
217
|
- lib/still_active/workflow.rb
|
187
218
|
- still_active.gemspec
|
188
|
-
homepage: https://github.com/SeanLF/still_active
|
219
|
+
homepage: https://github.com/SeanLF/still_active
|
189
220
|
licenses:
|
190
221
|
- MIT
|
191
222
|
metadata:
|
192
|
-
homepage_uri: https://github.com/SeanLF/still_active
|
193
|
-
source_code_uri: https://github.com/SeanLF/still_active
|
194
|
-
changelog_uri: https://github.com/SeanLF/still_active
|
223
|
+
homepage_uri: https://github.com/SeanLF/still_active
|
224
|
+
source_code_uri: https://github.com/SeanLF/still_active
|
225
|
+
changelog_uri: https://github.com/SeanLF/still_active/blob/main/CHANGELOG.md
|
195
226
|
post_install_message:
|
196
227
|
rdoc_options: []
|
197
228
|
require_paths:
|
@@ -207,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
238
|
- !ruby/object:Gem::Version
|
208
239
|
version: '0'
|
209
240
|
requirements: []
|
210
|
-
rubygems_version: 3.2.
|
241
|
+
rubygems_version: 3.2.31
|
211
242
|
signing_key:
|
212
243
|
specification_version: 4
|
213
244
|
summary: Check if gems are under active development.
|