vertebrae 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/lib/api.rb +23 -0
- data/vertebrae.gemspec +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62bec3dbf6715f029514cc5388a21bf45ad5b008
|
4
|
+
data.tar.gz: 2d3140c4d817b9e5b5c8b5fc22c83677fd2a56dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 906d38441f57707df98d07243d9549798493a43e23a4f38cebf5cfb8e933298b4d63c5d0e9303362d99bb69d021badc8be9a58fab8e229331d52946795dca935
|
7
|
+
data.tar.gz: 8270f673b278bf6e88d37338645c264a2b699e68c450f87cd78e9676ae8ba98f9c2c8dbca23cccdc27d188b5ba7b9ba20196dce981b36825ec26f985fbf2c5e2
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/api.rb
CHANGED
@@ -23,6 +23,29 @@ module Vertebrae
|
|
23
23
|
{}
|
24
24
|
end
|
25
25
|
|
26
|
+
def request(method, path, params, options) # :nodoc:
|
27
|
+
if !::Vertebrae::Request::METHODS.include?(method)
|
28
|
+
raise ArgumentError, "unknown http method: #{method}"
|
29
|
+
end
|
30
|
+
|
31
|
+
path = connection.configuration.prefix + '/' + path
|
32
|
+
|
33
|
+
::Vertebrae::Base.logger.debug "EXECUTED: #{method} - #{path} with #{params} and #{options}"
|
34
|
+
|
35
|
+
connection.connection.send(method) do |request|
|
36
|
+
|
37
|
+
case method.to_sym
|
38
|
+
when *(::Vertebrae::Request::METHODS - ::Vertebrae::Request::METHODS_WITH_BODIES)
|
39
|
+
request.body = params.delete('data') if params.has_key?('data')
|
40
|
+
request.url(path, params)
|
41
|
+
when *::Vertebrae::Request::METHODS_WITH_BODIES
|
42
|
+
request.path = path
|
43
|
+
request.body = extract_data_from_params(params) unless params.empty?
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
|
26
49
|
def yield_or_eval(&block)
|
27
50
|
return unless block
|
28
51
|
block.arity > 0 ? yield(self) : self.instance_eval(&block)
|
data/vertebrae.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "vertebrae"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.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"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-08-08"
|
13
13
|
s.description = "A set of low level infrastructure and reusable code for building API clients"
|
14
14
|
s.email = "nathan@controlshiftlabs.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -52,7 +52,7 @@ Gem::Specification.new do |s|
|
|
52
52
|
s.homepage = "http://github.com/controlshift/vertebrae"
|
53
53
|
s.licenses = ["MIT"]
|
54
54
|
s.require_paths = ["lib"]
|
55
|
-
s.rubygems_version = "2.0.
|
55
|
+
s.rubygems_version = "2.0.6"
|
56
56
|
s.summary = "API Client Infrastructure"
|
57
57
|
|
58
58
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vertebrae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Woodhull
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
168
|
version: '0'
|
169
169
|
requirements: []
|
170
170
|
rubyforge_project:
|
171
|
-
rubygems_version: 2.0.
|
171
|
+
rubygems_version: 2.0.6
|
172
172
|
signing_key:
|
173
173
|
specification_version: 4
|
174
174
|
summary: API Client Infrastructure
|