aptlyapi 0.0.3 → 0.0.4
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/repo.rb +16 -0
- data/lib/server.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5456b94b89a64151dcd550411b69cad8af09a2c0
|
4
|
+
data.tar.gz: ae2e4d099694a34906786112ca9ac68b93571ae9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad8f6a91525e71bf92e196f5e5c8bbb3083c8a40ca90278eac516c13879186201935c2783541fff7cefe36bea26c4ef903e88a5f7d707c54f92431d48c8fee1
|
7
|
+
data.tar.gz: 843cbae05f2c5cf6684a0522219d8052dc2cc558803864c7f7d6fc3e97d8449a5a7d064a5199ebc01768fbaa8d676a9f28b7ee6285a14506d052c0eae359dfc1
|
data/lib/repo.rb
CHANGED
@@ -25,6 +25,12 @@ module AptlyAPI
|
|
25
25
|
hpost("/api/repos/#{@name}/file/#{directory}", options)
|
26
26
|
end
|
27
27
|
|
28
|
+
##
|
29
|
+
# Edit repo +properties+
|
30
|
+
def edit(properties)
|
31
|
+
hput("/api/repos/#{@name}", properties)
|
32
|
+
end
|
33
|
+
|
28
34
|
attr_reader :name, :comment, :distribution, :component
|
29
35
|
|
30
36
|
protected
|
@@ -49,6 +55,16 @@ module AptlyAPI
|
|
49
55
|
return response.code.to_i
|
50
56
|
end
|
51
57
|
|
58
|
+
##
|
59
|
+
# Put +data+ hash to +path+ as JSON
|
60
|
+
def hput(path, data)
|
61
|
+
request = Net::HTTP::Put.new("#{@server.path}#{path}")
|
62
|
+
request.add_field('Content-Type', 'application/json')
|
63
|
+
request.body = data.to_json
|
64
|
+
response = @http.request(request)
|
65
|
+
return response.code.to_i
|
66
|
+
end
|
67
|
+
|
52
68
|
##
|
53
69
|
# Sends HTTP delete call to +path+
|
54
70
|
def hdelete(path)
|
data/lib/server.rb
CHANGED