happi 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/happi/client.rb +3 -3
- data/lib/happi/configuration.rb +5 -3
- data/lib/happi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cbe7a33112d358c16c95b35ec410b82aaf65622
|
4
|
+
data.tar.gz: 65d57b1a2230647d0246290ace7ae9a214667163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
68
|
-
if value.respond_to?(:multipart)
|
68
|
+
elsif value.respond_to?(:multipart)
|
69
69
|
[key, value.multipart]
|
70
70
|
else
|
71
71
|
[key, value]
|
data/lib/happi/configuration.rb
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
class Happi::Configuration
|
2
|
-
|
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
|
-
|
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
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.
|
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-
|
11
|
+
date: 2014-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|