package_cloud 0.3.09 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/package_cloud/cli/entry.rb +19 -14
- data/lib/package_cloud/validator.rb +7 -0
- data/lib/package_cloud/version.rb +1 -1
- 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: 742e3bad6322b16c1174addee4ee290a0eb880bc3f1150deb5367a0733c49a33
|
4
|
+
data.tar.gz: e3aae0a0e065b9880548d035a835a26eba3b46827a5ac6f579ac5cdc160a4364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a3e4cbea1c841372a448cbb87947449410d2b5bbba384239ed14d006b8ee39c055e58003db21a23024607c6703eeb473631c2766021b2899976e0d3aa21297a
|
7
|
+
data.tar.gz: f694739c61f3a63f1c84abb45246c7ae638a3affbb01868c3bb4e2c1aa1a95203e2178ef9d355b78cf38243bc19f014c460f377afbc3352778800e8e7d5bffcf
|
@@ -3,8 +3,9 @@ module PackageCloud
|
|
3
3
|
JAVA_EXTS = ["jar", "aar", "war"]
|
4
4
|
PY_EXTS = ["gz", "bz2", "z", "tar", "egg-info", "zip", "whl", "egg"]
|
5
5
|
ANYFILE_EXTS = ["asc"]
|
6
|
-
NODE_EXTS = [
|
7
|
-
|
6
|
+
NODE_EXTS = []
|
7
|
+
AMBIGUOUS_EXTS = ["tgz", "apk"]
|
8
|
+
SUPPORTED_EXTS = JAVA_EXTS + PY_EXTS + ANYFILE_EXTS + AMBIGUOUS_EXTS + ["gem", "deb", "rpm", "dsc"]
|
8
9
|
|
9
10
|
class Entry < Base
|
10
11
|
desc "repository SUBCMD ...ARGS", "manage repositories"
|
@@ -106,12 +107,13 @@ module PackageCloud
|
|
106
107
|
:desc => "Specify the exact maven coordinates to use for a JAR. Useful for JARs without coordinates, 'fat JARs', and WARs."
|
107
108
|
|
108
109
|
def push(repo, package_file, *package_files)
|
110
|
+
puts "################### push- repo: #{repo.inspect}"
|
109
111
|
total_time = Benchmark.measure do
|
110
112
|
ARGV.clear # otherwise gets explodes
|
111
113
|
package_files << package_file
|
112
114
|
|
113
115
|
exts = package_files.map { |f| f.split(".").last }.uniq
|
114
|
-
exts = handle_special_exts(repo, exts)
|
116
|
+
#### exts = handle_special_exts(repo, exts)
|
115
117
|
|
116
118
|
if package_files.length > 1 && exts.length > 1
|
117
119
|
abort("You can't push multiple packages of different types at the same time.\nFor example, use *.deb to push all your debs at once.".color(:red))
|
@@ -130,7 +132,8 @@ module PackageCloud
|
|
130
132
|
invalid_packages.each do |p|
|
131
133
|
message << " #{p}\n"
|
132
134
|
end
|
133
|
-
message << "\npackage_cloud only supports node.js, deb, gem, java, python,
|
135
|
+
message << "\npackage_cloud only supports node.js, deb, gem, java, python, "\
|
136
|
+
"rpm, alpine, helm, anyfile (.zip, .asc) packages".color(:red)
|
134
137
|
abort(message)
|
135
138
|
end
|
136
139
|
|
@@ -154,6 +157,8 @@ module PackageCloud
|
|
154
157
|
elsif JAVA_EXTS.include?(exts.first.downcase)
|
155
158
|
abort_if_snapshot!(package_files)
|
156
159
|
dist_id = validator.distribution_id(repo, package_files, 'jar')
|
160
|
+
elsif AMBIGUOUS_EXTS.include?(exts.first.downcase)
|
161
|
+
dist_id = validator.distribution_id_from_url(repo, package_files)
|
157
162
|
else
|
158
163
|
dist_id = validator.distribution_id(repo, package_files, exts.first)
|
159
164
|
end
|
@@ -199,16 +204,16 @@ module PackageCloud
|
|
199
204
|
end
|
200
205
|
|
201
206
|
private
|
202
|
-
def handle_special_exts(repo, exts)
|
203
|
-
exts.map do |elem|
|
204
|
-
case elem
|
205
|
-
when 'apk'
|
206
|
-
elem = repo.include?("alpine") ? "alpine" : elem
|
207
|
-
else
|
208
|
-
elem
|
209
|
-
end
|
210
|
-
end
|
211
|
-
end
|
207
|
+
#### def handle_special_exts(repo, exts)
|
208
|
+
#### exts.map do |elem|
|
209
|
+
#### case elem
|
210
|
+
#### when 'apk'
|
211
|
+
#### elem = repo.include?("alpine") ? "alpine" : elem
|
212
|
+
#### else
|
213
|
+
#### elem
|
214
|
+
#### end
|
215
|
+
#### end
|
216
|
+
#### end
|
212
217
|
|
213
218
|
def expand_dist_shortcut(dist)
|
214
219
|
case dist
|
@@ -4,6 +4,13 @@ module PackageCloud
|
|
4
4
|
@client = client
|
5
5
|
end
|
6
6
|
|
7
|
+
def distribution_id_from_url(repo, filenames)
|
8
|
+
_,_,dist_sel,ver_sel = repo.split("/")
|
9
|
+
package_type = dist_sel
|
10
|
+
puts "ambiguous extensions, so using repo url to deduce package_type, package_type: #{package_type}"
|
11
|
+
distribution_id(repo, filenames, package_type)
|
12
|
+
end
|
13
|
+
|
7
14
|
def distribution_id(repo, filenames, package_type)
|
8
15
|
if distributions[package_type]
|
9
16
|
_,_,dist_sel,ver_sel = repo.split("/")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: package_cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Damato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|