triglav-client 0.0.3 → 0.0.5
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/triglav/client.rb +2 -0
- data/lib/triglav/client/version.rb +1 -1
- data/lib/triglav/model.rb +1 -1
- data/spec/client_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84618d5362c94e2a5901caa06faa32873efaf8f5
|
4
|
+
data.tar.gz: 3dc1c426ea6c63822e57295e8bc7b202b415d9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0f651b23f3e937feb59c41005c337b2c0f6eb00b022d8fa62979e7fd9b14c93dc7fb2f12b9ba879a5aa950086dffd1d18efc484b4bf49533ab3a07d8a46a2d6
|
7
|
+
data.tar.gz: dc511c694af9e897f72b18f0a63a33edeb98df43d1485ddcf7f5757269db5e7f512525755a911237812acd8cec5bd621661e54d75715a8c3c28cfcca3cc3bbc6
|
data/lib/triglav/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'json'
|
2
2
|
require 'net/http'
|
3
3
|
|
4
|
+
require 'triglav/model'
|
4
5
|
require 'triglav/client/version'
|
5
6
|
|
6
7
|
module Triglav
|
@@ -143,6 +144,7 @@ module Triglav
|
|
143
144
|
req = case method
|
144
145
|
when :get; Net::HTTP::Get.new(path)
|
145
146
|
when :post; req = Net::HTTP::Post.new(path); req.set_form_data(params); req
|
147
|
+
when :put; req = Net::HTTP::Put.new(path); req.set_form_data(params); req
|
146
148
|
when :delete; Net::HTTP::Delete.new(path)
|
147
149
|
end
|
148
150
|
|
data/lib/triglav/model.rb
CHANGED
@@ -14,7 +14,7 @@ module Triglav
|
|
14
14
|
API_ENDPOINT_MAP = {
|
15
15
|
create: { method: :post, path: '/api/%s' },
|
16
16
|
show: { method: :get, path: '/api/%s/%s' },
|
17
|
-
update: { method: :
|
17
|
+
update: { method: :put, path: '/api/%s/%s' },
|
18
18
|
destroy: { method: :delete, path: '/api/%s/%s' },
|
19
19
|
revert: { method: :get, path: '/api/%s/%s/revert' },
|
20
20
|
}
|
data/spec/client_spec.rb
CHANGED
@@ -36,7 +36,7 @@ describe Triglav::Client do
|
|
36
36
|
it {
|
37
37
|
expect(subject.endpoint_for(:services)).to be == {
|
38
38
|
method: :get,
|
39
|
-
path: '/api/services
|
39
|
+
path: '/api/services',
|
40
40
|
}
|
41
41
|
}
|
42
42
|
end
|
@@ -47,7 +47,7 @@ describe Triglav::Client do
|
|
47
47
|
it {
|
48
48
|
expect(subject.endpoint_for(:roles_in, 'triglav')).to be == {
|
49
49
|
method: :get,
|
50
|
-
path: '/api/services/triglav/roles
|
50
|
+
path: '/api/services/triglav/roles',
|
51
51
|
}
|
52
52
|
}
|
53
53
|
end
|
@@ -58,7 +58,7 @@ describe Triglav::Client do
|
|
58
58
|
it {
|
59
59
|
expect(subject.endpoint_for(:hosts_in, 'triglav', 'app')).to be == {
|
60
60
|
method: :get,
|
61
|
-
path: '/api/services/triglav/roles/app/hosts
|
61
|
+
path: '/api/services/triglav/roles/app/hosts',
|
62
62
|
}
|
63
63
|
}
|
64
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: triglav-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaro Kuribayashi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|