vertebrae 0.1.1 → 0.1.2
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/api.rb +1 -1
- data/lib/base.rb +29 -0
- data/lib/connection.rb +2 -2
- data/lib/railties.rb +1 -1
- data/lib/vertebrae.rb +1 -26
- data/spec/dummy/dummy.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/vertebrae.gemspec +3 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4871a689fe19a6d4c8c3ed9d348c9110f31fd08
|
4
|
+
data.tar.gz: eee0d75223e52ed8ad29fc9ac9928e2b7c5ce60c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0685daeac8d327d0a3a37e352fef2ecaba748d11d21155f358e7f3801c18ff693893b587cfeef96218f0a10271a013d298809370fae2a5af3165b0360d0bfcdd
|
7
|
+
data.tar.gz: 7124f2fa162b184f67e2b75e0359e70b019067e54130e266d876cf2ad0e038b6b614c5cf2a81e9a1ce52e670fcfc4adcf91b56de9ce4cdd12e46ea1d965f0678
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/api.rb
CHANGED
@@ -35,7 +35,7 @@ module Vertebrae
|
|
35
35
|
# Configure options and process basic authorization
|
36
36
|
#
|
37
37
|
def setup(options={})
|
38
|
-
options = Vertebrae.options.merge(options)
|
38
|
+
options = Vertebrae::Base.options.merge(options)
|
39
39
|
self.current_options = options
|
40
40
|
Configuration.keys.each do |key|
|
41
41
|
send("#{key}=", options[key])
|
data/lib/base.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
module Vertebrae
|
2
|
+
module Base
|
3
|
+
extend Configuration
|
4
|
+
|
5
|
+
|
6
|
+
def logger
|
7
|
+
@@logger ||= Logger.new(STDOUT)
|
8
|
+
end
|
9
|
+
|
10
|
+
def logger=(logger)
|
11
|
+
@@logger = logger
|
12
|
+
end
|
13
|
+
|
14
|
+
# implement this in your api
|
15
|
+
#
|
16
|
+
def new(options = {}, &block)
|
17
|
+
raise "implement me!"
|
18
|
+
end
|
19
|
+
|
20
|
+
def method_missing(method, *args, &block)
|
21
|
+
return super unless new.respond_to?(method)
|
22
|
+
new.send(method, *args, &block)
|
23
|
+
end
|
24
|
+
|
25
|
+
def respond_to?(method, include_private = false)
|
26
|
+
new.respond_to?(method, include_private) || super(method, include_private)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/connection.rb
CHANGED
@@ -18,7 +18,7 @@ module Vertebrae
|
|
18
18
|
].freeze
|
19
19
|
|
20
20
|
def default_options(options={})
|
21
|
-
Vertebrae.faraday_options(options)
|
21
|
+
Vertebrae::Base.faraday_options(options)
|
22
22
|
end
|
23
23
|
|
24
24
|
# Default middleware stack that uses default adapter as specified at
|
@@ -70,7 +70,7 @@ module Vertebrae
|
|
70
70
|
def connection(options={})
|
71
71
|
conn_options = default_options(options)
|
72
72
|
clear_cache unless options.empty?
|
73
|
-
Vertebrae.logger.debug "OPTIONS:#{conn_options.inspect}"
|
73
|
+
Vertebrae::Base.logger.debug "OPTIONS:#{conn_options.inspect}"
|
74
74
|
|
75
75
|
@connection ||= Faraday.new(conn_options.merge(:builder => stack(options)))
|
76
76
|
end
|
data/lib/railties.rb
CHANGED
data/lib/vertebrae.rb
CHANGED
@@ -4,6 +4,7 @@ require 'connection'
|
|
4
4
|
require 'authorization'
|
5
5
|
require 'request'
|
6
6
|
require 'api'
|
7
|
+
require 'base'
|
7
8
|
|
8
9
|
|
9
10
|
require 'active_support/all'
|
@@ -11,31 +12,5 @@ require 'vertebrae/railties' if defined? Rails
|
|
11
12
|
|
12
13
|
|
13
14
|
module Vertebrae
|
14
|
-
extend Configuration
|
15
|
-
|
16
|
-
|
17
|
-
def logger
|
18
|
-
@@logger ||= Logger.new(STDOUT)
|
19
|
-
end
|
20
|
-
|
21
|
-
def logger=(logger)
|
22
|
-
@@logger = logger
|
23
|
-
end
|
24
|
-
|
25
|
-
# implement this in your api
|
26
|
-
#
|
27
|
-
def new(options = {}, &block)
|
28
|
-
raise "implement me!"
|
29
|
-
end
|
30
|
-
|
31
|
-
def method_missing(method, *args, &block)
|
32
|
-
return super unless new.respond_to?(method)
|
33
|
-
new.send(method, *args, &block)
|
34
|
-
end
|
35
|
-
|
36
|
-
def respond_to?(method, include_private = false)
|
37
|
-
new.respond_to?(method, include_private) || super(method, include_private)
|
38
|
-
end
|
39
|
-
|
40
15
|
|
41
16
|
end
|
data/spec/dummy/dummy.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
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.1.
|
8
|
+
s.version = "0.1.2"
|
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-
|
12
|
+
s.date = "2013-07-15"
|
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 = [
|
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
"VERSION",
|
30
30
|
"lib/api.rb",
|
31
31
|
"lib/authorization.rb",
|
32
|
+
"lib/base.rb",
|
32
33
|
"lib/configuration.rb",
|
33
34
|
"lib/connection.rb",
|
34
35
|
"lib/constants.rb",
|
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.1.
|
4
|
+
version: 0.1.2
|
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-
|
11
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- VERSION
|
130
130
|
- lib/api.rb
|
131
131
|
- lib/authorization.rb
|
132
|
+
- lib/base.rb
|
132
133
|
- lib/configuration.rb
|
133
134
|
- lib/connection.rb
|
134
135
|
- lib/constants.rb
|