triglav-client 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01e910aa582540480c64224ed218898530fe32bb
4
- data.tar.gz: e4c7c133738561cfcece8d284f579c67629dc1c3
3
+ metadata.gz: 84618d5362c94e2a5901caa06faa32873efaf8f5
4
+ data.tar.gz: 3dc1c426ea6c63822e57295e8bc7b202b415d9b5
5
5
  SHA512:
6
- metadata.gz: 7ef626eccb314aa7f5ee91d3bb3bd57253277b33d86a1bd7ee7e8aec6d20642f14394b4dc29522c5c43c62b01d27db0a1141cc5bc1f92b0cfd8101535db41650
7
- data.tar.gz: fb721cc27b0fc9d3e32e87cdbccaca2d1b6453ef971b5874d8fe6600447f3057f85aacb8191423b711c25891cce63e7757ec83b731cbc7b03c81b028cdade9ad
6
+ metadata.gz: c0f651b23f3e937feb59c41005c337b2c0f6eb00b022d8fa62979e7fd9b14c93dc7fb2f12b9ba879a5aa950086dffd1d18efc484b4bf49533ab3a07d8a46a2d6
7
+ data.tar.gz: dc511c694af9e897f72b18f0a63a33edeb98df43d1485ddcf7f5757269db5e7f512525755a911237812acd8cec5bd621661e54d75715a8c3c28cfcca3cc3bbc6
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  module Triglav
2
2
  class Client
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
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: :post, path: '/api/%s/%s' },
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.json',
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.json',
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.json',
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.3
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-02-26 00:00:00.000000000 Z
11
+ date: 2013-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec