gem-src 0.10.1 → 0.10.2

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: a93c64e073dd8c85650a46788d4b76d85ee40efd455a19d507c0bed311fccbf3
4
- data.tar.gz: c4a8915c1a6374551a581709b9fd6946968cd23257f384e05acbcf002a950592
3
+ metadata.gz: 77510a0146875262a43f19d7913785fe0ae48089500103cd0a6699806d09636c
4
+ data.tar.gz: 14b7367a438983e7044d06b34b2688267fe4404c99ba9560077955ad223790d7
5
5
  SHA512:
6
- metadata.gz: 1928ae1489a5240ca0769fa4c14749d9af7ebb1c25f19686ee6f283685ffeee20982c6a4abf270a5602251582473b9c2dfd16b5e6774f76ba3153654ed4fbb97
7
- data.tar.gz: d6229ad675d2e53bef4d44bdbba1e20f70d1b2b07748a5eb671f23b9bd226bcfe3e622edc9482ea4cc1640d6e207ebb6af19e8e9319650fe368513e6d7bceb96
6
+ metadata.gz: 0c935fe193662417a1fce06b63a327d2642387b3fd6a52d38fe82ba86479f0625e649d1e26958bc69db1b607e7afdf6fd53e90d41a665ad04aa9b3c0ed68cec9
7
+ data.tar.gz: 1ef94554f0fa4d5dad3ef23d13ac6a9752aa2e2754ef76cd36cbd3985206af73ee210162327391a243aa085690c953154eb40552526a52670dd6bd1132cc6401
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = "gem-src"
7
- gem.version = '0.10.1'
7
+ gem.version = '0.10.2'
8
8
  gem.authors = ["Akira Matsuda"]
9
9
  gem.email = ["ronnie@dio.jp"]
10
10
  gem.description = 'Gem.post_install { `git clone gem_source src` }'
@@ -34,13 +34,23 @@ module Gem
34
34
  return git_clone IRREGULAR_REPOSITORIES[@spec.name]
35
35
  end
36
36
 
37
- result = git_clone(source_code_uri_from_metadata) ||
37
+ result =
38
+ git_clone_if_github(github_url(source_code_uri_from_metadata)) ||
39
+ git_clone_if_github(source_code_uri_from_metadata) ||
40
+ git_clone_if_github(github_url(@spec.homepage)) ||
41
+ git_clone_if_github(@spec.homepage) ||
42
+ git_clone_if_github(github_url(source_code_uri)) ||
43
+ git_clone_if_github(source_code_uri) ||
44
+ git_clone_if_github(github_url(homepage_uri)) ||
45
+ git_clone_if_github(homepage_uri) ||
38
46
  git_clone(github_url(source_code_uri_from_metadata)) ||
39
- git_clone(@spec.homepage) ||
47
+ git_clone(source_code_uri_from_metadata) ||
40
48
  git_clone(github_url(@spec.homepage)) ||
49
+ git_clone(@spec.homepage) ||
50
+ git_clone(github_url(source_code_uri)) ||
41
51
  git_clone(source_code_uri) ||
42
- git_clone(homepage_uri) ||
43
52
  git_clone(github_url(homepage_uri)) ||
53
+ git_clone(homepage_uri) ||
44
54
  git_clone(github_organization_uri(@spec.name))
45
55
 
46
56
  if verbose?
@@ -120,7 +130,7 @@ module Gem
120
130
  end
121
131
 
122
132
  def source_code_uri_from_metadata
123
- @spec.metadata['source_code_uri']
133
+ @source_code_uri_from_metadata ||= @spec.metadata['source_code_uri']
124
134
  end
125
135
 
126
136
  def api
@@ -131,11 +141,11 @@ module Gem
131
141
  end
132
142
 
133
143
  def source_code_uri
134
- api_uri_for('source_code')
144
+ @source_code_uri ||= api_uri_for('source_code')
135
145
  end
136
146
 
137
147
  def homepage_uri
138
- api_uri_for('homepage')
148
+ @homepage_uri ||= api_uri_for('homepage')
139
149
  end
140
150
 
141
151
  def github_organization_uri(name)
@@ -158,6 +168,13 @@ module Gem
158
168
  end
159
169
  end
160
170
 
171
+ def git_clone_if_github(repository)
172
+ return if repository.nil? || repository.empty?
173
+ return unless github?(repository)
174
+
175
+ git_clone repository
176
+ end
177
+
161
178
  def use_ghq?
162
179
  ENV['GEMSRC_USE_GHQ'] || Gem.configuration[:gemsrc_use_ghq]
163
180
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-src
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akira Matsuda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-02 00:00:00.000000000 Z
11
+ date: 2020-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec