package_cloud 0.3.10 → 0.3.11

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: 742e3bad6322b16c1174addee4ee290a0eb880bc3f1150deb5367a0733c49a33
4
- data.tar.gz: e3aae0a0e065b9880548d035a835a26eba3b46827a5ac6f579ac5cdc160a4364
3
+ metadata.gz: 6b5523eccf8d9b23c5a3b222818a680bd585560c2e898bee15a88a7c35b969f0
4
+ data.tar.gz: ab27f540c2bd98e2a312ad0b8ed34ff036a78b3ef440355d0b65a0812fb2b6a9
5
5
  SHA512:
6
- metadata.gz: 4a3e4cbea1c841372a448cbb87947449410d2b5bbba384239ed14d006b8ee39c055e58003db21a23024607c6703eeb473631c2766021b2899976e0d3aa21297a
7
- data.tar.gz: f694739c61f3a63f1c84abb45246c7ae638a3affbb01868c3bb4e2c1aa1a95203e2178ef9d355b78cf38243bc19f014c460f377afbc3352778800e8e7d5bffcf
6
+ metadata.gz: 7b7f861f0cebb2a24d4ed81c1119656198638b7b574f2d72fdc07efb68564b42b5b4a850b8980483fcca18cac817ea7c9302803ba439dd755f36e5dfe622269b
7
+ data.tar.gz: 9034cef17e319ab4e4d962e55e8488d6e3a31df096f38f371bc40c71adbe02f1476401eac44f812e2ebf761be1c41efa95a3c98b20f068d02de782dfa2a61d0c
@@ -1,10 +1,10 @@
1
1
  module PackageCloud
2
2
  module CLI
3
3
  JAVA_EXTS = ["jar", "aar", "war"]
4
- PY_EXTS = ["gz", "bz2", "z", "tar", "egg-info", "zip", "whl", "egg"]
4
+ PY_EXTS = ["gz", "bz2", "z", "tar", "egg-info", "whl", "egg"]
5
5
  ANYFILE_EXTS = ["asc"]
6
6
  NODE_EXTS = []
7
- AMBIGUOUS_EXTS = ["tgz", "apk"]
7
+ AMBIGUOUS_EXTS = ["tgz", "apk", "zip"]
8
8
  SUPPORTED_EXTS = JAVA_EXTS + PY_EXTS + ANYFILE_EXTS + AMBIGUOUS_EXTS + ["gem", "deb", "rpm", "dsc"]
9
9
 
10
10
  class Entry < Base
@@ -107,13 +107,11 @@ module PackageCloud
107
107
  :desc => "Specify the exact maven coordinates to use for a JAR. Useful for JARs without coordinates, 'fat JARs', and WARs."
108
108
 
109
109
  def push(repo, package_file, *package_files)
110
- puts "################### push- repo: #{repo.inspect}"
111
110
  total_time = Benchmark.measure do
112
111
  ARGV.clear # otherwise gets explodes
113
112
  package_files << package_file
114
113
 
115
114
  exts = package_files.map { |f| f.split(".").last }.uniq
116
- #### exts = handle_special_exts(repo, exts)
117
115
 
118
116
  if package_files.length > 1 && exts.length > 1
119
117
  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))
@@ -158,7 +156,7 @@ puts "################### push- repo: #{repo.inspect}"
158
156
  abort_if_snapshot!(package_files)
159
157
  dist_id = validator.distribution_id(repo, package_files, 'jar')
160
158
  elsif AMBIGUOUS_EXTS.include?(exts.first.downcase)
161
- dist_id = validator.distribution_id_from_url(repo, package_files)
159
+ dist_id = validator.distribution_id_from_repo_url(repo, package_files)
162
160
  else
163
161
  dist_id = validator.distribution_id(repo, package_files, exts.first)
164
162
  end
@@ -204,17 +202,6 @@ puts "################### push- repo: #{repo.inspect}"
204
202
  end
205
203
 
206
204
  private
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
217
-
218
205
  def expand_dist_shortcut(dist)
219
206
  case dist
220
207
  when 'java'
@@ -4,11 +4,17 @@ module PackageCloud
4
4
  @client = client
5
5
  end
6
6
 
7
- def distribution_id_from_url(repo, filenames)
7
+ def distribution_id_from_repo_url(repo, filenames)
8
8
  _,_,dist_sel,ver_sel = repo.split("/")
9
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)
10
+ puts "ambiguous extensions, so using repo url to deduce package_type, package_type: #{package_type}".color(:red)
11
+
12
+ # NOTE: The distributions pulled from API uses "py" (package_type) as key for "python"
13
+ # so we need to map "python" to "py"
14
+ # See PackageCloud::Validator#distributions
15
+ package_type = package_type == "python" ? "py": package_type
16
+
17
+ distribution_id(repo, filenames, package_type)
12
18
  end
13
19
 
14
20
  def distribution_id(repo, filenames, package_type)
@@ -1,7 +1,7 @@
1
1
  module PackageCloud
2
2
  MAJOR_VERSION = "0"
3
3
  MINOR_VERSION = "3"
4
- PATCH_VERSION = "10"
4
+ PATCH_VERSION = "11"
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.10
4
+ version: 0.3.11
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-09-01 00:00:00.000000000 Z
11
+ date: 2022-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor