happi 0.0.3 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
- metadata.gz: 815bfa647b5685686424c837a1faafa8ac832cab
4
- data.tar.gz: 4b94139ddd0980d3b55ad861144dc329aec74032
3
+ metadata.gz: 7cbe7a33112d358c16c95b35ec410b82aaf65622
4
+ data.tar.gz: 65d57b1a2230647d0246290ace7ae9a214667163
5
5
  SHA512:
6
- metadata.gz: cad2b3510bfed96b8a1ac8a6e8ccba620e811ea4ab74e24a84c9a1185bc1eacb0d3f45b302e8b1d8e7c21037aecb3edc700975dc83d6626600bd7eb99de66edc
7
- data.tar.gz: 703681dc151cd3bf9cba6597f8a3093517c3bd2e36a367e61cceedd35b7a3f912d0e0ff2a09639f9d6881145c4ccd2a4425ce13ef36b84e6a772dd17a559865f
6
+ metadata.gz: 7836ce0c555cbbc9d9e49588dbb6f6b1d875256b98b60e6b2b1e75c62957bad3dde9ef7ed8ec488265c8bac084059d65578a1366e5ba8a431d31fc3b5a351c58
7
+ data.tar.gz: 8be1620f866422be96752a44e657cea4ef2498a0e66862b89e718ddf1362c97bba613f37f2e5d171648592af7652419e38dc28d1227ae137705ac1f9487ca756
data/lib/happi/client.rb CHANGED
@@ -4,6 +4,7 @@ require 'active_support/core_ext/string/inflections'
4
4
  require 'active_support/core_ext/hash'
5
5
 
6
6
  class Happi::Client
7
+
7
8
  delegate :config, to: :class
8
9
 
9
10
  def self.config
@@ -36,7 +37,7 @@ class Happi::Client
36
37
  end
37
38
 
38
39
  def url(resource)
39
- "/api/#{version}/#{resource}"
40
+ "/api/#{config.version}/#{resource}"
40
41
  end
41
42
 
42
43
  def call(method, url, params)
@@ -64,8 +65,7 @@ class Happi::Client
64
65
  Hash[params.map do |key, value|
65
66
  if value.is_a? Hash
66
67
  [key, param_check(value)]
67
- end
68
- if value.respond_to?(:multipart)
68
+ elsif value.respond_to?(:multipart)
69
69
  [key, value.multipart]
70
70
  else
71
71
  [key, value]
@@ -1,15 +1,17 @@
1
1
  class Happi::Configuration
2
- DEFAULTS = {
2
+ def self.defaults
3
+ {
3
4
  host: 'http://localhost:8080',
4
5
  port: 443,
5
6
  timeout: 60,
6
7
  version: 'v1'
7
- }
8
+ }
9
+ end
8
10
 
9
11
  attr_accessor :oauth_token, :host, :port, :timeout, :version
10
12
 
11
13
  def initialize(options = {})
12
- DEFAULTS.merge(options).each do |key, value|
14
+ self.class.defaults.merge(options).each do |key, value|
13
15
  send("#{key}=", value)
14
16
  end
15
17
  end
data/lib/happi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Happi
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: happi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - John D'Agostino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-29 00:00:00.000000000 Z
11
+ date: 2014-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday