rubygems-ghq 0.1.0 → 0.1.2
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/lib/rubygems_plugin.rb +1 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34e17aece0137a2beea13bc8d7b0aecd72699b80d1d10efc61027c6ff91f54d8
|
4
|
+
data.tar.gz: ffa3a08ff82b6d2b2526a70938c50edf8f3037b346cd118b54e4b133350134d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f79e39da785c803fa0b556b2f2fc3c0a409c610fa682142aeebbd660a7338367fc5cf67fa5fba686090ee96719f1f95fd8aa2d58203ba3c79a8b09104ac379b
|
7
|
+
data.tar.gz: 8ba326c48870be819e62b4822873670cab17bf00b286a32a2ca889294c787fb29cb80aef4e320b3958de2dc2c8dbb0d3d197f229918fbab19893123a9ed2a46e
|
data/lib/rubygems_plugin.rb
CHANGED
@@ -1,25 +1,20 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
|
-
# Define common functionality as a method
|
4
3
|
def clone_gem_repository(spec)
|
5
4
|
return unless spec
|
6
5
|
|
7
|
-
# Get git repository URL from homepage and source_code_uri
|
8
6
|
urls = [spec.homepage, spec.metadata["source_code_uri"]].compact
|
9
7
|
|
10
|
-
# Filter URLs (non-empty, GitHub/GitLab only, no "/tree" paths)
|
11
8
|
git_urls = urls.select do |url|
|
12
9
|
url && !url.empty? && url.match?(/github\.com|gitlab\.org/) && !url.match?(/\/tree/)
|
13
10
|
end.uniq
|
14
11
|
|
15
|
-
# Clone each found repository using ghq
|
16
12
|
git_urls.each do |git_url|
|
17
|
-
puts "
|
13
|
+
puts "#{spec.name}: #{git_url}"
|
18
14
|
system("ghq get #{git_url}")
|
19
15
|
end
|
20
16
|
end
|
21
17
|
|
22
|
-
# Register hook to be called after gem installation
|
23
18
|
Gem.post_install do |installer|
|
24
19
|
clone_gem_repository(installer.spec)
|
25
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-ghq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SHIBATA Hiroshi
|
@@ -36,7 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
|
-
rubygems_version: 3.
|
39
|
+
rubygems_version: 3.6.2
|
40
40
|
specification_version: 4
|
41
41
|
summary: Clone git repositories of installed gems with ghq
|
42
42
|
test_files: []
|