seiso-connector 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/lib/seiso/connector.rb +2 -11
- data/lib/seiso/connector/uri_factory_v1.rb +12 -0
- data/seiso-connector.gemspec +2 -1
- data/test/test_connector.rb +0 -1
- metadata +16 -5
- data/lib/seiso/connector/connector_v2.rb +0 -24
- data/test/test_connector_v2.rb +0 -26
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjVhYjA4ZmE5ZDQxMWFkMTkzMjY5Yjc0MTFlNmJkNWI4NzM3MzkzMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MThhNWI2MGJiZTY2N2JlYjUxMzdkOTg5OThjMTU2MzE5ZTUwMTUwZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZTIyYjIyYWI2Y2FiMDljYzE1YjhiNGQ5ZWUxZmFhZWM1Yzk2MTU5MjNhODNj
|
10
|
+
YWUwYzg0OGE4MjA1ODRkNjQ0NzU2NzJjMDE1NDFlNjNlZGZlYzZjM2JiZTQz
|
11
|
+
YmEyYTRhNWFhYjZjZjRkNDQ0NmU4YzU3YzRkNjI1OGVhZDcyYzM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2Q5Mzk1YWQ2ZjczNDk2ZGY4NjFlZjBkZjhmMTAyYWRmOGZiY2U2ZmI4NDQ1
|
14
|
+
Zjg4OTYxY2M4NmZjN2M2Mjg0MWQ1MzNhOTY2N2ZiY2VhZjU5NjE5ZWEwMjcy
|
15
|
+
YzZmMzM2Njg3OTBjNjE4NzgzZGRmZjYxODIyNzliM2YxMGU3ZmQ=
|
data/.gitignore
CHANGED
data/lib/seiso/connector.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
require "net/http"
|
2
2
|
require "openssl"
|
3
|
+
require "require_all"
|
3
4
|
require "uri"
|
4
5
|
|
5
|
-
|
6
|
-
require_relative "connector/connector_v2"
|
7
|
-
require_relative "connector/rest_connector"
|
8
|
-
require_relative "connector/uri_factory_v1"
|
9
|
-
require_relative "connector/uri_factory_v2"
|
6
|
+
require_rel "connector"
|
10
7
|
|
11
8
|
# DEPRECATED
|
12
9
|
# Seiso namespace module
|
@@ -37,7 +34,6 @@ module Seiso
|
|
37
34
|
http = create_http(host, port, use_ssl, ignore_cert)
|
38
35
|
|
39
36
|
@connector_v1 = Seiso::Connector::ConnectorV1.new(http, username, password)
|
40
|
-
@connector_v2 = Seiso::Connector::ConnectorV2.new(http, username, password)
|
41
37
|
end
|
42
38
|
|
43
39
|
# Tests can override this
|
@@ -45,11 +41,6 @@ module Seiso
|
|
45
41
|
@connector_v1
|
46
42
|
end
|
47
43
|
|
48
|
-
# Tests can override this
|
49
|
-
def connector_v2
|
50
|
-
@connector_v2
|
51
|
-
end
|
52
|
-
|
53
44
|
# GET item list
|
54
45
|
def get_items(type)
|
55
46
|
connector_v1.do_get("/v1/#{type}")
|
data/seiso-connector.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "seiso-connector"
|
7
|
-
spec.version = "0.1.
|
7
|
+
spec.version = "0.1.7"
|
8
8
|
spec.authors = ["Willie Wheeler"]
|
9
9
|
spec.email = ["wwheeler@expedia.com"]
|
10
10
|
spec.summary = "Connector to make it easier for Ruby clients to talk to the Seiso REST API."
|
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.add_development_dependency "rake", "~> 10.0"
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "json", "~> 1.7"
|
24
|
+
spec.add_runtime_dependency "require_all", "~> 1.3.2"
|
24
25
|
end
|
data/test/test_connector.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seiso-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willie Wheeler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.7'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: require_all
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.3.2
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.3.2
|
55
69
|
description: Very basic at this point. Plan to support pagination, sorting, searching
|
56
70
|
and more in the future.
|
57
71
|
email:
|
@@ -69,7 +83,6 @@ files:
|
|
69
83
|
- Rakefile
|
70
84
|
- lib/seiso/connector.rb
|
71
85
|
- lib/seiso/connector/connector_v1.rb
|
72
|
-
- lib/seiso/connector/connector_v2.rb
|
73
86
|
- lib/seiso/connector/request_failed_error.rb
|
74
87
|
- lib/seiso/connector/rest_connector.rb
|
75
88
|
- lib/seiso/connector/uri_factory_v1.rb
|
@@ -77,7 +90,6 @@ files:
|
|
77
90
|
- seiso-connector.gemspec
|
78
91
|
- test/test_connector.rb
|
79
92
|
- test/test_connector_v1.rb
|
80
|
-
- test/test_connector_v2.rb
|
81
93
|
homepage: http://seiso.io
|
82
94
|
licenses:
|
83
95
|
- Apache-2.0
|
@@ -105,4 +117,3 @@ summary: Connector to make it easier for Ruby clients to talk to the Seiso REST
|
|
105
117
|
test_files:
|
106
118
|
- test/test_connector.rb
|
107
119
|
- test/test_connector_v1.rb
|
108
|
-
- test/test_connector_v2.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require_relative 'request_failed_error'
|
3
|
-
|
4
|
-
# DEPRECATED
|
5
|
-
module Seiso
|
6
|
-
class Connector
|
7
|
-
class ConnectorV2
|
8
|
-
attr_reader :http
|
9
|
-
attr_reader :username
|
10
|
-
|
11
|
-
def initialize(http, username, password)
|
12
|
-
@http = http
|
13
|
-
@username = username
|
14
|
-
@password = password
|
15
|
-
@request_headers = {
|
16
|
-
"Accept" => "application/hal+json",
|
17
|
-
"Content-Type" => "application/hal+json"
|
18
|
-
}
|
19
|
-
end
|
20
|
-
|
21
|
-
# TODO
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/test/test_connector_v2.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'seiso/connector/connector_v2'
|
2
|
-
require 'minitest/autorun'
|
3
|
-
|
4
|
-
# Author:: Willie Wheeler
|
5
|
-
# Copyright:: Copyright (c) 2015 Expedia, Inc.
|
6
|
-
# License:: Apache 2.0
|
7
|
-
class TestConnectorV2 < MiniTest::Unit::TestCase
|
8
|
-
|
9
|
-
def setup
|
10
|
-
|
11
|
-
# Test data
|
12
|
-
@username = "willie"
|
13
|
-
@password = "rocket88"
|
14
|
-
|
15
|
-
# Dependencies
|
16
|
-
@http = {}
|
17
|
-
|
18
|
-
# Class under test
|
19
|
-
@connector = Seiso::Connector::ConnectorV2.new(@http, @username, @password)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_init
|
23
|
-
assert_equal(@http, @connector.http)
|
24
|
-
assert_equal(@username, @connector.username)
|
25
|
-
end
|
26
|
-
end
|