matterhorn_whymper 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/matterhorn/endpoint.rb +4 -4
- data/lib/matterhorn_whymper/version.rb +1 -1
- data/spec/matterhorn.yml.sample +8 -5
- data/spec/spec_helper.rb +11 -13
- data/spec/unit/matterhorn/endpoint/ingest_spec.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWNiNGI1ZTQ5OTJlMmI0M2ZkOTA0MjRkNTEyMGRiMzVjMjI1Mzg0Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjYzOGU4ODUzZDhkMWY1MjY1ZmY1MDZkZjU4MTI4ZWMxOTZlOGZiZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTMyMThjMTYxNjg2ZjdhYjAyZmVhZjM0OTRiZmUwOTc3YTY0OTk5NDA2YWU1
|
10
|
+
ZmViZGJkZjczMmNmZDc1OWRiMjBmODM2ZWM0ZmY0ZDVmZjJlM2Y3NGFjMjJl
|
11
|
+
MmFlMDNhMzg3NjcyMzA1NTBhM2NkYTRkYmY1M2UwNWY2NDU5Mjk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2FjYjJmZDA5ZjFjOTE5MDQwMTA1ZDJhZTY3YTc0NmM5Y2NhYzY4ZGIyYWVi
|
14
|
+
MGJlODJiNWE4NGU2ZjQ4NTQ4Y2I3Nzc5NjhhZmI3NDM3NWZiN2IxMDMxMDI2
|
15
|
+
ZWM1NjBlODZlNGRkMGM1NjcwNWZhNWNlODZiZjQwY2MyZGQ4Mjg=
|
data/lib/matterhorn/endpoint.rb
CHANGED
@@ -28,13 +28,13 @@ class Matterhorn::Endpoint
|
|
28
28
|
|
29
29
|
|
30
30
|
def self.open(endpoint, org_domain = '', mh_instance = :default)
|
31
|
-
endpoint = create(endpoint, mh_instance)
|
31
|
+
endpoint = create(endpoint, org_domain, mh_instance)
|
32
32
|
begin
|
33
33
|
yield endpoint
|
34
34
|
ensure
|
35
35
|
endpoint.close
|
36
36
|
end
|
37
|
-
end
|
37
|
+
end
|
38
38
|
|
39
39
|
|
40
40
|
def initialize(org_domain = '', mh_instance = :default)
|
@@ -88,8 +88,8 @@ class Matterhorn::Endpoint
|
|
88
88
|
|
89
89
|
|
90
90
|
def close
|
91
|
-
http_endpoint_client.close
|
92
|
-
http_api_client.close
|
91
|
+
http_endpoint_client.close if http_endpoint_client
|
92
|
+
http_api_client.close if http_api_client
|
93
93
|
end
|
94
94
|
|
95
95
|
|
@@ -5,7 +5,7 @@ module MatterhornWhymper
|
|
5
5
|
|
6
6
|
# -------------------------------------------------------------------------- const definitions ---
|
7
7
|
|
8
|
-
VERSION = "1.0.
|
8
|
+
VERSION = "1.0.2"
|
9
9
|
|
10
10
|
|
11
11
|
end # -------------------------------------------------------------------- end MatterhornWhymper ---
|
data/spec/matterhorn.yml.sample
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
test:
|
2
|
+
protocol: http
|
3
|
+
domain: admin.example.com
|
4
|
+
user: inser_system_user_name_here
|
5
|
+
password: insert_system_user_password_here
|
6
|
+
auth_mode: digest
|
7
|
+
ssl_dont_verify_cert: false
|
8
|
+
multi_tenant: false
|
data/spec/spec_helper.rb
CHANGED
@@ -10,26 +10,24 @@ require 'fileutils'
|
|
10
10
|
|
11
11
|
Dir.glob(File.expand_path('../support/**/*.rb', __FILE__)).each { |lib| require lib }
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
test_configuration = YAML::load_file(File.expand_path('../matterhorn.yml', __FILE__))
|
14
|
+
MatterhornWhymper.configure do |config|
|
15
|
+
config.add_matterhorn_instance
|
16
|
+
config.add_endpoint(test_configuration['test'])
|
17
|
+
end
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
mh_config.system_account_password = mh_yml['matterhorn']['system_account_password']
|
20
|
-
mh_config.system_domain = mh_yml['matterhorn']['system_domain']
|
21
|
-
mh_config.system_protocol = mh_yml['matterhorn']['system_protocol']
|
22
|
-
end
|
19
|
+
logfile_path = File.expand_path('../../log/test.log', __FILE__)
|
20
|
+
FileUtils.mkdir_p(File.dirname(logfile_path))
|
21
|
+
MatterhornWhymper.logger = Logger.new(File.open(logfile_path, 'a'))
|
23
22
|
|
24
|
-
|
25
|
-
|
26
|
-
MatterhornWhymper.logger = Logger.new(File.open(logfile_path, 'a'))
|
23
|
+
RSpec.configure do |config|
|
24
|
+
config.include Support::FixtureHelpers
|
27
25
|
end
|
28
26
|
|
29
27
|
module Kernel
|
30
28
|
private
|
31
29
|
|
32
30
|
def endpoint_configured?
|
33
|
-
MatterhornWhymper.configuration.
|
31
|
+
!!MatterhornWhymper.configuration.endpoint
|
34
32
|
end
|
35
33
|
end
|
@@ -27,4 +27,12 @@ describe Matterhorn::Endpoint::Ingest do
|
|
27
27
|
response_body = @ingest.addTrack('http://example.com/path/to/file', 'source/raw')
|
28
28
|
expect(response_body).to start_with('<?xml')
|
29
29
|
end
|
30
|
+
|
31
|
+
describe "initialization" do
|
32
|
+
it "creates an endpoint instance with open" do
|
33
|
+
Matterhorn::Endpoint.open(:ingest) do |client|
|
34
|
+
expect(client).to be_kind_of(Matterhorn::Endpoint::Ingest)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
30
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matterhorn_whymper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Fritschi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|