vertebrae 0.1.1 → 0.1.2

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: 4e395a1764189afd72762d812fc3ce99e29c10a0
4
- data.tar.gz: 83ea2a91bace49b3be3f5930935732f97750d769
3
+ metadata.gz: f4871a689fe19a6d4c8c3ed9d348c9110f31fd08
4
+ data.tar.gz: eee0d75223e52ed8ad29fc9ac9928e2b7c5ce60c
5
5
  SHA512:
6
- metadata.gz: 8557a36874f15f00cd163f35a28d42e6cfa9e4259ca6c6db2f549213c6532c6cdd79b3afa8fc151eccfbd0d44293f89377cf29694c3a5eb956c379e1d3735681
7
- data.tar.gz: 3eefb2271ccfd2767db259b714e91b618e017e58489680491f8510f2c27334a1094684933f7dac9df64c6f391d1a9e85e1619e9bbce0d646c55ca7da69a48f5e
6
+ metadata.gz: 0685daeac8d327d0a3a37e352fef2ecaba748d11d21155f358e7f3801c18ff693893b587cfeef96218f0a10271a013d298809370fae2a5af3165b0360d0bfcdd
7
+ data.tar.gz: 7124f2fa162b184f67e2b75e0359e70b019067e54130e266d876cf2ad0e038b6b614c5cf2a81e9a1ce52e670fcfc4adcf91b56de9ce4cdd12e46ea1d965f0678
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.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])
@@ -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
@@ -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
@@ -1,7 +1,7 @@
1
1
  module Vertebrae
2
2
  class Railties < ::Rails::Railtie
3
3
  initializer 'Rails logger' do
4
- Vertebrae.logger = Rails.logger
4
+ Vertebrae::Base.logger = Rails.logger
5
5
  end
6
6
  end
7
7
  end
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Dummy
2
- extend Vertebrae
2
+ extend Vertebrae::Base
3
3
  class << self
4
4
  def new(options = {}, &block)
5
5
  Dummy::Client.new(options, &block)
@@ -17,7 +17,7 @@ end
17
17
 
18
18
  def reset_authentication_for(object)
19
19
  ['username', 'password'].each do |item|
20
- Vertebrae.send("#{item}=", nil)
20
+ Vertebrae::Base.send("#{item}=", nil)
21
21
  object.send("#{item}=", nil)
22
22
  end
23
23
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "vertebrae"
8
- s.version = "0.1.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"
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.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-12 00:00:00.000000000 Z
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