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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 826f31e8a6707526bd6f82609c43677b162464688596785a338be6f7a35acf44
4
- data.tar.gz: '096e57c694454dda57219d8ca2b79e63b58d46ce4711176e745518c33ed62d7d'
3
+ metadata.gz: 742e3bad6322b16c1174addee4ee290a0eb880bc3f1150deb5367a0733c49a33
4
+ data.tar.gz: e3aae0a0e065b9880548d035a835a26eba3b46827a5ac6f579ac5cdc160a4364
5
5
  SHA512:
6
- metadata.gz: bb785da285b810f8b6bebe17354a9f782ec5afa4c36acc32a74628908ef332003b07af77cef3db5a4c550a939bce529bc4320dcc98dc28beb4af4ef4fec8a442
7
- data.tar.gz: 1aa70e22f8d994b0f0a5a2324d534a7c25f02d60e76d8298b4eb0307ecd915a4a72fb45ce0c7e6d4350c68b9db4b7c4eb20b87fc0142b11446beac2c5c5c6265
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 = ["tgz"]
7
- SUPPORTED_EXTS = JAVA_EXTS + PY_EXTS + ANYFILE_EXTS + NODE_EXTS + ["gem", "deb", "rpm", "dsc", "apk"]
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, or rpm packages".color(:red)
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("/")
@@ -1,7 +1,7 @@
1
1
  module PackageCloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "3"
4
- PATCH_VERSION = "09"
4
+ PATCH_VERSION = "10"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
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.09
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-07-15 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor