package_cloud 0.2.37 → 0.2.38
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/repository.rb +3 -1
- data/lib/package_cloud/repository.rb +19 -2
- data/lib/package_cloud/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 766d7c9ea3818b1746f5dfb1971a734ff8c1f51b
|
4
|
+
data.tar.gz: d2fad59918f7b07dd55e61373da286b0642800d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d680c4370a337c0401370ea8921c8c9abfe0e5b8a82afe14d5116691d262a41940ff439dc4302f66fd0e50740247bb6fd2e4cdd5a72b601b2d7c5de013f54371
|
7
|
+
data.tar.gz: a831c57060ec01b18f7c2e6dfc8c9ebc25d45d08184aa2ec5ecf151f2d5e08c6b1962537f1a38af0c4e176942e85fbf5a3ef052d69c42d5c4a1b33bc24cc2388
|
@@ -42,8 +42,10 @@ module PackageCloud
|
|
42
42
|
print "Locating repository at #{repo}... "
|
43
43
|
repo = client.repository(repo)
|
44
44
|
print "success!\n"
|
45
|
-
|
45
|
+
script = repo.install_script(package_type)
|
46
|
+
pid = fork { exec("/bin/bash", script.path) }
|
46
47
|
Process.waitpid(pid)
|
48
|
+
script.unlink
|
47
49
|
end
|
48
50
|
end
|
49
51
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
|
1
3
|
module PackageCloud
|
2
4
|
class Repository < Object
|
3
5
|
def initialize(attrs, config)
|
@@ -56,8 +58,23 @@ module PackageCloud
|
|
56
58
|
|
57
59
|
def install_script(type)
|
58
60
|
url = urls["install_script"].gsub(/:package_type/, type)
|
59
|
-
|
60
|
-
|
61
|
+
|
62
|
+
# the URL we've obtained above already contains the correct tokens
|
63
|
+
# because the install script URL uses a master token for access, not
|
64
|
+
# your API token, so if we pass @config.base_url in to compute_url,
|
65
|
+
# we'll end up generating a URL like: https://token:@https://token:@...
|
66
|
+
# because @config.base_url has the url with the API token in it and url
|
67
|
+
# has the url (lol) with the master token in it.
|
68
|
+
#
|
69
|
+
# so just pass url in here.
|
70
|
+
url = PackageCloud::Util.compute_url(url, '')
|
71
|
+
script = RestClient.get(url)
|
72
|
+
|
73
|
+
# persist the script to a tempfile to make it easier to execute
|
74
|
+
file = Tempfile.new('foo')
|
75
|
+
file.write(script)
|
76
|
+
file.close
|
77
|
+
file
|
61
78
|
end
|
62
79
|
|
63
80
|
def master_tokens
|
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.38
|
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-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -165,3 +165,4 @@ signing_key:
|
|
165
165
|
specification_version: 4
|
166
166
|
summary: https://packagecloud.io
|
167
167
|
test_files: []
|
168
|
+
has_rdoc:
|