vertebrae 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/VERSION +1 -1
  4. data/lib/api.rb +23 -0
  5. data/vertebrae.gemspec +3 -3
  6. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53a761abff5b9feda04b6f00fb12fbfcb50691b6
4
- data.tar.gz: cf986de1d3ae7e4796d0e1865eeb2ccd90bea05e
3
+ metadata.gz: 62bec3dbf6715f029514cc5388a21bf45ad5b008
4
+ data.tar.gz: 2d3140c4d817b9e5b5c8b5fc22c83677fd2a56dc
5
5
  SHA512:
6
- metadata.gz: a4b589b38d229a5b08f700a5618049ea48be1b39038cd78186a83703bf4bfed3b748a3418eb1c174cd8d682253a175dadb3bc98985f67dcc15257f5bf99d9ee9
7
- data.tar.gz: cb9ce156956196a0bf6feceaa1067611064e6bb1cf20c0548d830d7b35868f73275e06b1ae67a0ae9893b3742669769aba1936010fba7644fb764ecfe72d383f
6
+ metadata.gz: 906d38441f57707df98d07243d9549798493a43e23a4f38cebf5cfb8e933298b4d63c5d0e9303362d99bb69d021badc8be9a58fab8e229331d52946795dca935
7
+ data.tar.gz: 8270f673b278bf6e88d37338645c264a2b699e68c450f87cd78e9676ae8ba98f9c2c8dbca23cccdc27d188b5ba7b9ba20196dce981b36825ec26f985fbf2c5e2
@@ -11,8 +11,8 @@ GEM
11
11
  atomic (1.1.10)
12
12
  builder (3.2.2)
13
13
  diff-lcs (1.2.4)
14
- faraday (0.8.7)
15
- multipart-post (~> 1.1)
14
+ faraday (0.8.8)
15
+ multipart-post (~> 1.2.0)
16
16
  faraday_middleware (0.9.0)
17
17
  faraday (>= 0.7.4, < 0.9)
18
18
  git (1.2.5)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
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)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "vertebrae"
8
- s.version = "0.2.0"
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-07-30"
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.4"
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.0
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-07-30 00:00:00.000000000 Z
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.4
171
+ rubygems_version: 2.0.6
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: API Client Infrastructure