package_cloud 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/package_cloud/cli/entry.rb +3 -16
- data/lib/package_cloud/config_file.rb +15 -5
- data/lib/package_cloud/validator.rb +9 -3
- data/lib/package_cloud/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebf04b9bf18aac29f88bcd67e07322fe922359021c004a33975c9dbc110ceb75
|
4
|
+
data.tar.gz: 5e2be465b0f1823b6e1df58b8346f6fb627a3693414b7b7487db21f9bb116945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f0f0327922943e4b61848cf815c4fa0ad2352b920e58019f5c0223b4d896af876de7ebfbb570e4cae92a9db4147c7be933a4c1bc48307facf1dba98a092983f
|
7
|
+
data.tar.gz: 5dd52a13fa14a138516612b5adcf672a0feb804689f737f216aeee8e429b852e250cdd42014a9617743d5a9793ace0867d5ab8f3c3381150bf22902bd8f827e9
|
@@ -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", "
|
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.
|
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'
|
@@ -62,14 +62,24 @@ module PackageCloud
|
|
62
62
|
|
63
63
|
def login_from_console
|
64
64
|
e = ask("Email:")
|
65
|
+
puts "If you signed up via social login (Github, Bitbucket etc.), and/or do not have a password, input: NIL"
|
65
66
|
p = ask("Password:") { |q| q.echo = false }
|
66
67
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
if p == "NIL"
|
69
|
+
puts "Copy your API Token from https://packagecloud.io/api_token and input below."
|
70
|
+
puts "(Note: An incorrectly inputted token will require deletion of the incorrectly generated $HOME/.packagecloud config file before rerunning the last command.)"
|
71
|
+
api_token = ask("Your API Token:") { |q| q.echo = false }
|
72
|
+
else
|
73
|
+
begin
|
74
|
+
api_token = PackageCloud::Auth.get_token(base_url(e, p))
|
75
|
+
rescue RestClient::Unauthorized => e
|
76
|
+
puts "Sorry, but we couldn't find you. Give it another try."
|
77
|
+
puts "(Or skip the login? Go to https://packagecloud.io/api_token to see instructions on downloading your $HOME/.packagecloud config file.)"
|
78
|
+
login_from_console
|
79
|
+
end
|
72
80
|
end
|
81
|
+
|
82
|
+
return api_token
|
73
83
|
end
|
74
84
|
|
75
85
|
def write
|
@@ -4,11 +4,17 @@ module PackageCloud
|
|
4
4
|
@client = client
|
5
5
|
end
|
6
6
|
|
7
|
-
def
|
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
|
-
|
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)
|
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.12
|
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:
|
11
|
+
date: 2023-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -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,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
178
178
|
- !ruby/object:Gem::Version
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
|
-
rubygems_version: 3.2.
|
182
|
-
signing_key:
|
181
|
+
rubygems_version: 3.2.28
|
182
|
+
signing_key:
|
183
183
|
specification_version: 4
|
184
184
|
summary: The https://packagecloud.io CLI for uploading Node.js, Debian, RPM, RubyGem,
|
185
185
|
Python, and Java packages. Check our website or the RubyDoc documentation for detailed
|