package_cloud 0.2.35 → 0.2.36
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 +11 -6
- data/lib/package_cloud/repository.rb +5 -1
- data/lib/package_cloud/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 175b5452674b9c7dcb9fa7bbf95199d56d9f494a
|
4
|
+
data.tar.gz: 584cde339f46aab01a0eca5344df37452c9d329b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c58ff367b41a13ebc6f6798da6e25f4a8cca3f6e0061edc5f31ae0e3fa3df3daa6499f9345403562a249e99abccd4c1332ddbe7c2209aae8a8e2076cad5eddc1
|
7
|
+
data.tar.gz: 48ebc9b7d5996cdbf616eb1b5cb5f8707951a865404f0f7000f74d4669f09a21dd323317e6b5ab22ac5ab02b22f1e21f31634234d3ac0720a4fb7a7d513f4096
|
@@ -40,6 +40,7 @@ module PackageCloud
|
|
40
40
|
option "skip-file-ext-validation", :type => :boolean
|
41
41
|
option "yes", :type => :boolean
|
42
42
|
option "skip-errors", :type => :boolean
|
43
|
+
option "coordinates", :type => :string
|
43
44
|
def push(repo, package_file, *package_files)
|
44
45
|
total_time = Benchmark.measure do
|
45
46
|
ARGV.clear # otherwise gets explodes
|
@@ -55,6 +56,10 @@ module PackageCloud
|
|
55
56
|
!["gem", "deb", "rpm", "dsc", "gz", "bz2", "z", "tar", "egg-info", "zip", "whl", "egg", "jar"].include?(f.split(".").last.downcase)
|
56
57
|
end
|
57
58
|
|
59
|
+
if ["jar"].include?(exts.first.downcase) && options.has_key?("coordinates")
|
60
|
+
puts "Using coordinates #{options["coordinates"].color(:yellow)}"
|
61
|
+
end
|
62
|
+
|
58
63
|
if !options.has_key?("skip-file-ext-validation") && invalid_packages.any?
|
59
64
|
message = "I don't know how to push these packages:\n\n".color(:red)
|
60
65
|
invalid_packages.each do |p|
|
@@ -107,9 +112,9 @@ module PackageCloud
|
|
107
112
|
print "Pushing #{f}... "
|
108
113
|
measurement = Benchmark.measure do
|
109
114
|
if options.has_key?("skip-errors")
|
110
|
-
create_package_skip_errors(client_repo, f, dist_id, files, ext)
|
115
|
+
create_package_skip_errors(client_repo, f, dist_id, files, ext, options["coordinates"])
|
111
116
|
else
|
112
|
-
create_package(client_repo, f, dist_id, files, ext)
|
117
|
+
create_package(client_repo, f, dist_id, files, ext, options["coordinates"])
|
113
118
|
end
|
114
119
|
end
|
115
120
|
$logger.debug("create package request timing: #{measurement}")
|
@@ -131,9 +136,9 @@ module PackageCloud
|
|
131
136
|
end
|
132
137
|
end
|
133
138
|
|
134
|
-
def create_package_skip_errors(client_repo, f, dist_id, files, ext)
|
139
|
+
def create_package_skip_errors(client_repo, f, dist_id, files, ext, coordinates=nil)
|
135
140
|
begin
|
136
|
-
client_repo.create_package(f, dist_id, files, ext)
|
141
|
+
client_repo.create_package(f, dist_id, files, ext, coordinates=nil)
|
137
142
|
rescue RestClient::UnprocessableEntity => e
|
138
143
|
print "error (skipping):\n".color(:yellow)
|
139
144
|
json = JSON.parse(e.response)
|
@@ -144,9 +149,9 @@ module PackageCloud
|
|
144
149
|
end
|
145
150
|
end
|
146
151
|
|
147
|
-
def create_package(client_repo, f, dist_id, files, ext)
|
152
|
+
def create_package(client_repo, f, dist_id, files, ext, coordinates=nil)
|
148
153
|
begin
|
149
|
-
client_repo.create_package(f, dist_id, files, ext)
|
154
|
+
client_repo.create_package(f, dist_id, files, ext, coordinates)
|
150
155
|
rescue RestClient::UnprocessableEntity => e
|
151
156
|
print "error:\n".color(:red)
|
152
157
|
json = JSON.parse(e.response)
|
@@ -29,13 +29,17 @@ module PackageCloud
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def create_package(file_path, dist_id, files=nil, filetype=nil)
|
32
|
+
def create_package(file_path, dist_id, files=nil, filetype=nil, coordinates=nil)
|
33
33
|
file_data = File.new(file_path, 'rb')
|
34
34
|
base_url = @config.base_url
|
35
35
|
url = PackageCloud::Util.compute_url(base_url, paths["create_package"])
|
36
36
|
params = { :package_file => file_data,
|
37
37
|
:distro_version_id => dist_id }
|
38
38
|
|
39
|
+
if coordinates
|
40
|
+
params.merge!(:coordinates => coordinates)
|
41
|
+
end
|
42
|
+
|
39
43
|
if filetype == "dsc"
|
40
44
|
file_ios = files.inject([]) do |memo, f|
|
41
45
|
memo << File.new(f, 'rb')
|
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.2.
|
4
|
+
version: 0.2.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Damato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -160,9 +160,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.4.
|
163
|
+
rubygems_version: 2.4.8
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: https://packagecloud.io
|
167
167
|
test_files: []
|
168
|
-
has_rdoc:
|