package_cloud 0.3.08 → 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
- SHA1:
3
- metadata.gz: 6e1fc0d6c0b52dce5f3eee51b11195bf9bd92cd3
4
- data.tar.gz: 64c4a8aa6956f450f97bfa21314e4ea2188c992e
2
+ SHA256:
3
+ metadata.gz: 6b5523eccf8d9b23c5a3b222818a680bd585560c2e898bee15a88a7c35b969f0
4
+ data.tar.gz: ab27f540c2bd98e2a312ad0b8ed34ff036a78b3ef440355d0b65a0812fb2b6a9
5
5
  SHA512:
6
- metadata.gz: 996714d5fa00f98de2f548d75747e31967c3246c0943b4083ea20d317419efb14edc8890b20bd710ac196840ea57023f6295dcff3808cd87ab6b55bd9ecdef5b
7
- data.tar.gz: 892b3eccf25a659292f7f66403ddea716444a547982758c2afb53a44dabd0d5ccaffc1cd1edf26ae41f45c4f26cdf17bda9cf6933d8d1486d99817726a92dc60
6
+ metadata.gz: 7b7f861f0cebb2a24d4ed81c1119656198638b7b574f2d72fdc07efb68564b42b5b4a850b8980483fcca18cac817ea7c9302803ba439dd755f36e5dfe622269b
7
+ data.tar.gz: 9034cef17e319ab4e4d962e55e8488d6e3a31df096f38f371bc40c71adbe02f1476401eac44f812e2ebf761be1c41efa95a3c98b20f068d02de782dfa2a61d0c
data/README.md CHANGED
@@ -164,6 +164,24 @@ repository owned by `example-user` as a RubyGem package.
164
164
  Note that unlike all other package types, RubyGems do not require any
165
165
  additional specification on upload.
166
166
 
167
+ #### Uploading a arbitrary file
168
+
169
+ NOTE:
170
+
171
+ Currently supported files:
172
+
173
+ * .asc (armored ascii signature file)
174
+
175
+ You can upload a Anyfile package found at the path `/tmp/example.asc` by
176
+ running:
177
+
178
+ ```
179
+ package_cloud push example-user/example-repository/anyfile /tmp/example.asc
180
+ ```
181
+
182
+ This command will upload `/tmp/example.asc` to the `example-repository`
183
+ repository owned by `example-user` as an Anyfile package.
184
+
167
185
  #### Uploading a Python package
168
186
 
169
187
  You can upload a Python package found at the path `/tmp/example.whl` by
@@ -1,10 +1,11 @@
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
- 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", "zip"]
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"
@@ -111,7 +112,6 @@ module PackageCloud
111
112
  package_files << package_file
112
113
 
113
114
  exts = package_files.map { |f| f.split(".").last }.uniq
114
- exts = handle_special_exts(repo, exts)
115
115
 
116
116
  if package_files.length > 1 && exts.length > 1
117
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))
@@ -130,7 +130,8 @@ module PackageCloud
130
130
  invalid_packages.each do |p|
131
131
  message << " #{p}\n"
132
132
  end
133
- message << "\npackage_cloud only supports node.js, deb, gem, java, python, or rpm packages".color(:red)
133
+ message << "\npackage_cloud only supports node.js, deb, gem, java, python, "\
134
+ "rpm, alpine, helm, anyfile (.zip, .asc) packages".color(:red)
134
135
  abort(message)
135
136
  end
136
137
 
@@ -154,6 +155,8 @@ module PackageCloud
154
155
  elsif JAVA_EXTS.include?(exts.first.downcase)
155
156
  abort_if_snapshot!(package_files)
156
157
  dist_id = validator.distribution_id(repo, package_files, 'jar')
158
+ elsif AMBIGUOUS_EXTS.include?(exts.first.downcase)
159
+ dist_id = validator.distribution_id_from_repo_url(repo, package_files)
157
160
  else
158
161
  dist_id = validator.distribution_id(repo, package_files, exts.first)
159
162
  end
@@ -199,17 +202,6 @@ module PackageCloud
199
202
  end
200
203
 
201
204
  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
212
-
213
205
  def expand_dist_shortcut(dist)
214
206
  case dist
215
207
  when 'java'
@@ -4,6 +4,19 @@ module PackageCloud
4
4
  @client = client
5
5
  end
6
6
 
7
+ def distribution_id_from_repo_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}".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)
18
+ end
19
+
7
20
  def distribution_id(repo, filenames, package_type)
8
21
  if distributions[package_type]
9
22
  _,_,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 = "08"
4
+ PATCH_VERSION = "11"
5
5
 
6
6
  VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
7
7
  end
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_runtime_dependency "thor", "~> 0.18"
23
- spec.add_runtime_dependency "highline", "1.6.20"
22
+ spec.add_runtime_dependency "thor", "~> 1.2"
23
+ spec.add_runtime_dependency "highline", "~> 2.0.0"
24
24
  spec.add_runtime_dependency "rest-client", "~> 2.0"
25
- spec.add_runtime_dependency "json_pure", "1.8.1"
25
+ spec.add_runtime_dependency "json_pure", "~> 2.3.0"
26
26
  spec.add_runtime_dependency "rainbow", "2.2.2"
27
27
 
28
28
  spec.add_development_dependency "bundler", "~> 1.3"
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.08
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Damato
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-30 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
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.18'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.18'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: highline
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.6.20
33
+ version: 2.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.6.20
40
+ version: 2.0.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rest-client
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -56,16 +56,16 @@ dependencies:
56
56
  name: json_pure
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 1.8.1
61
+ version: 2.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 1.8.1
68
+ version: 2.3.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rainbow
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -163,7 +163,7 @@ homepage: https://packagecloud.io
163
163
  licenses:
164
164
  - MIT
165
165
  metadata: {}
166
- post_install_message:
166
+ post_install_message:
167
167
  rdoc_options: []
168
168
  require_paths:
169
169
  - lib
@@ -178,9 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubyforge_project:
182
- rubygems_version: 2.5.2.3
183
- signing_key:
181
+ rubygems_version: 3.2.3
182
+ signing_key:
184
183
  specification_version: 4
185
184
  summary: The https://packagecloud.io CLI for uploading Node.js, Debian, RPM, RubyGem,
186
185
  Python, and Java packages. Check our website or the RubyDoc documentation for detailed