vertebrae 0.1.0 → 0.1.1
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/VERSION +1 -1
- data/lib/request.rb +31 -0
- data/lib/vertebrae.rb +1 -0
- data/spec/request_spec.rb +33 -0
- data/vertebrae.gemspec +3 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e395a1764189afd72762d812fc3ce99e29c10a0
|
4
|
+
data.tar.gz: 83ea2a91bace49b3be3f5930935732f97750d769
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8557a36874f15f00cd163f35a28d42e6cfa9e4259ca6c6db2f549213c6532c6cdd79b3afa8fc151eccfbd0d44293f89377cf29694c3a5eb956c379e1d3735681
|
7
|
+
data.tar.gz: 3eefb2271ccfd2767db259b714e91b618e017e58489680491f8510f2c27334a1094684933f7dac9df64c6f391d1a9e85e1619e9bbce0d646c55ca7da69a48f5e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/request.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module Vertebrae
|
2
|
+
module Request
|
3
|
+
|
4
|
+
METHODS = [:get, :post, :put, :delete, :patch]
|
5
|
+
METHODS_WITH_BODIES = [ :post, :put, :patch ]
|
6
|
+
|
7
|
+
def get_request(path, params={}, options={})
|
8
|
+
request(:get, path, params, options)
|
9
|
+
end
|
10
|
+
|
11
|
+
def patch_request(path, params={}, options={})
|
12
|
+
request(:patch, path, params, options)
|
13
|
+
end
|
14
|
+
|
15
|
+
def post_request(path, params={}, options={})
|
16
|
+
request(:post, path, params, options)
|
17
|
+
end
|
18
|
+
|
19
|
+
def put_request(path, params={}, options={})
|
20
|
+
request(:put, path, params, options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def delete_request(path, params={}, options={})
|
24
|
+
request(:delete, path, params, options)
|
25
|
+
end
|
26
|
+
|
27
|
+
def request(method, path, params, options)
|
28
|
+
raise 'implement me'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/vertebrae.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Vertebrae::Request do
|
4
|
+
let(:vb) { Vertebrae::API.new }
|
5
|
+
let(:path) { 'actionkit.api/rest/v1/action' }
|
6
|
+
let(:params) { {} }
|
7
|
+
let(:options) { {} }
|
8
|
+
|
9
|
+
it "knows how to make get request" do
|
10
|
+
vb.should_receive(:request).with(:get, path, params, options)
|
11
|
+
vb.get_request path, params, options
|
12
|
+
end
|
13
|
+
|
14
|
+
it "knows how to make patch request" do
|
15
|
+
vb.should_receive(:request).with(:patch, path, params, options)
|
16
|
+
vb.patch_request path, params, options
|
17
|
+
end
|
18
|
+
|
19
|
+
it "knows how to make post request" do
|
20
|
+
vb.should_receive(:request).with(:post, path, params, options)
|
21
|
+
vb.post_request path, params, options
|
22
|
+
end
|
23
|
+
|
24
|
+
it "knows how to make put request" do
|
25
|
+
vb.should_receive(:request).with(:put, path, params, options)
|
26
|
+
vb.put_request path, params, options
|
27
|
+
end
|
28
|
+
|
29
|
+
it "knows how to make delete request" do
|
30
|
+
vb.should_receive(:request).with(:delete, path, params, options)
|
31
|
+
vb.delete_request path, params, options
|
32
|
+
end
|
33
|
+
end
|
data/vertebrae.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "vertebrae"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nathan Woodhull"]
|
@@ -34,6 +34,7 @@ Gem::Specification.new do |s|
|
|
34
34
|
"lib/constants.rb",
|
35
35
|
"lib/core_ext/array.rb",
|
36
36
|
"lib/railties.rb",
|
37
|
+
"lib/request.rb",
|
37
38
|
"lib/request/basic_auth.rb",
|
38
39
|
"lib/response/raise_error.rb",
|
39
40
|
"lib/vertebrae.rb",
|
@@ -43,6 +44,7 @@ Gem::Specification.new do |s|
|
|
43
44
|
"spec/dummy/client.rb",
|
44
45
|
"spec/dummy/dummy.rb",
|
45
46
|
"spec/logger_spec.rb",
|
47
|
+
"spec/request_spec.rb",
|
46
48
|
"spec/spec_helper.rb",
|
47
49
|
"vertebrae.gemspec"
|
48
50
|
]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vertebrae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- lib/constants.rb
|
135
135
|
- lib/core_ext/array.rb
|
136
136
|
- lib/railties.rb
|
137
|
+
- lib/request.rb
|
137
138
|
- lib/request/basic_auth.rb
|
138
139
|
- lib/response/raise_error.rb
|
139
140
|
- lib/vertebrae.rb
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- spec/dummy/client.rb
|
144
145
|
- spec/dummy/dummy.rb
|
145
146
|
- spec/logger_spec.rb
|
147
|
+
- spec/request_spec.rb
|
146
148
|
- spec/spec_helper.rb
|
147
149
|
- vertebrae.gemspec
|
148
150
|
homepage: http://github.com/controlshift/vertebrae
|