aptly-api 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/aptly-api.gemspec +1 -0
- data/lib/aptly/configuration.rb +3 -0
- data/lib/aptly/connection.rb +18 -3
- data/lib/aptly/version.rb +1 -1
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3870aafea88cba83edd67d8157b2ad16bd4a3cd
|
4
|
+
data.tar.gz: 056eb4dc7da48eea7291c28a97599ad6b03c7094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59c37196c8fab2ed18055eba1243a90caca9e3daa46c87ebcae99c5c2876a1e3d532761fe85b31ff71d07fcb4e32244216526da2200fd989828b826df30f9d38
|
7
|
+
data.tar.gz: 6723cb060bfb7483de86c39a2c8222281a88c4162516b6ccabaa3cf4962b04f6092294816d6c8213c30dd1d1b42bf6ccb1964be35f0a6b05d186049b6b463ae9
|
data/aptly-api.gemspec
CHANGED
data/lib/aptly/configuration.rb
CHANGED
@@ -6,6 +6,8 @@ module Aptly
|
|
6
6
|
extend Gem::Deprecate
|
7
7
|
|
8
8
|
# @!attribute uri
|
9
|
+
# Generally any suitable URI is allowed. This can also be a Unix domain
|
10
|
+
# socket which needs to be used in the notation unix:/tmp/sock.
|
9
11
|
# @return [URI] the base URI for the API (http://localhost by default)
|
10
12
|
attr_accessor :uri
|
11
13
|
|
@@ -18,6 +20,7 @@ module Aptly
|
|
18
20
|
port: 80,
|
19
21
|
path: '/'),
|
20
22
|
host: nil, port: nil, path: nil)
|
23
|
+
@uri = nil
|
21
24
|
@uri = uri unless host || port || path
|
22
25
|
return if @uri
|
23
26
|
@uri = fallback_uri(host, port, path)
|
data/lib/aptly/connection.rb
CHANGED
@@ -24,12 +24,13 @@ module Aptly
|
|
24
24
|
|
25
25
|
def initialize(**kwords)
|
26
26
|
@query = kwords.fetch(:query, DEFAULT_QUERY)
|
27
|
+
@base_uri = kwords.delete(:uri) { ::Aptly.configuration.uri.clone }
|
27
28
|
|
28
|
-
|
29
|
-
@connection = Faraday.new(uri
|
29
|
+
raise if uri.nil?
|
30
|
+
@connection = Faraday.new(uri) do |c|
|
30
31
|
c.request :multipart
|
31
32
|
c.request :url_encoded
|
32
|
-
c.adapter :
|
33
|
+
c.adapter :excon, @adapter_options
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
@@ -45,6 +46,20 @@ module Aptly
|
|
45
46
|
|
46
47
|
private
|
47
48
|
|
49
|
+
def uri
|
50
|
+
@adapter_options ||= {}
|
51
|
+
@uri ||= begin
|
52
|
+
uri = @base_uri.clone
|
53
|
+
return uri unless uri.scheme == 'unix'
|
54
|
+
# For Unix domain sockets we need to divide the bits apart as Excon
|
55
|
+
# expects the path URI without a socket path and the socket path as
|
56
|
+
# option.
|
57
|
+
@adapter_options[:socket] = uri.path
|
58
|
+
uri.host = nil
|
59
|
+
uri
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
48
63
|
def build_query(kwords)
|
49
64
|
query = @query.merge(kwords.delete(:query) { {} })
|
50
65
|
if kwords.delete(:query_mangle) { true }
|
data/lib/aptly/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aptly-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harald Sitter
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -137,6 +137,20 @@ dependencies:
|
|
137
137
|
- - "~>"
|
138
138
|
- !ruby/object:Gem::Version
|
139
139
|
version: '0.9'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: excon
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0.54'
|
147
|
+
type: :runtime
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0.54'
|
140
154
|
description: REST client for the Aptly API
|
141
155
|
email:
|
142
156
|
- sitter@kde.org
|
@@ -187,9 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
201
|
version: '0'
|
188
202
|
requirements: []
|
189
203
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.6.10
|
191
205
|
signing_key:
|
192
206
|
specification_version: 4
|
193
207
|
summary: REST client for the Aptly API
|
194
208
|
test_files: []
|
195
|
-
has_rdoc:
|