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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODQzZmIzNWVkY2EwMjRiNjJiZTMwNDQ1YTE4NTNlMDRhY2IxOTRkYw==
4
+ NWNiNGI1ZTQ5OTJlMmI0M2ZkOTA0MjRkNTEyMGRiMzVjMjI1Mzg0Nw==
5
5
  data.tar.gz: !binary |-
6
- YThkZDk3NTM0NzVkNzY0NTc5YjI0N2U3NGM5YjNjNmI3YWJmYjkxMQ==
6
+ NjYzOGU4ODUzZDhkMWY1MjY1ZmY1MDZkZjU4MTI4ZWMxOTZlOGZiZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWYxMDcyMTNiZjdmYTI2ODFiNzQ1MDI1OTZiZGQwZTBkYWIzNjExNGEwZmM4
10
- Njk3MmJjMGQ1MGUyNjExMWU1MjhkZWE0ZTdhYTMzZGIxMzljYjQ1NTkzMDAx
11
- NjdmZGVjZjA4Y2FkNmNkNDdjYjcwMDg5NTZjOTYxOWNlZmQ2OWI=
9
+ NTMyMThjMTYxNjg2ZjdhYjAyZmVhZjM0OTRiZmUwOTc3YTY0OTk5NDA2YWU1
10
+ ZmViZGJkZjczMmNmZDc1OWRiMjBmODM2ZWM0ZmY0ZDVmZjJlM2Y3NGFjMjJl
11
+ MmFlMDNhMzg3NjcyMzA1NTBhM2NkYTRkYmY1M2UwNWY2NDU5Mjk=
12
12
  data.tar.gz: !binary |-
13
- Mzk4YzQ0NjNjNmVkYWMxMWJhNjU4YjE5MjZjOTY4NmFmYTc2MDI3NjNjZWQw
14
- MDI2ZjRjMjhhMGNmNTBjZTdiYmQ4MGM3YjQ1YmE2NjI5NGM0OTJmZTFiODNl
15
- ZTUxNzNmNWFhZWI3MTY3MTJkMDJkMDMzOTM1NjgyNjJkMTdjMTA=
13
+ M2FjYjJmZDA5ZjFjOTE5MDQwMTA1ZDJhZTY3YTc0NmM5Y2NhYzY4ZGIyYWVi
14
+ MGJlODJiNWE4NGU2ZjQ4NTQ4Y2I3Nzc5NjhhZmI3NDM3NWZiN2IxMDMxMDI2
15
+ ZWM1NjBlODZlNGRkMGM1NjcwNWZhNWNlODZiZjQwY2MyZGQ4Mjg=
@@ -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.1"
8
+ VERSION = "1.0.2"
9
9
 
10
10
 
11
11
  end # -------------------------------------------------------------------- end MatterhornWhymper ---
@@ -1,5 +1,8 @@
1
- matterhorn:
2
- system_account_user: inser_system_user_name_here
3
- system_account_password: insert_system_user_password_here
4
- system_domain: mh-admin.localdomain
5
- system_protocol: http
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
- RSpec.configure do |config|
14
- config.include Support::FixtureHelpers
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
- MatterhornWhymper.configure do |mh_config|
17
- mh_yml = YAML::load_file( "./spec/matterhorn.yml" )
18
- mh_config.system_account_user = mh_yml['matterhorn']['system_account_user']
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
- logfile_path = File.expand_path('../../log/test.log', __FILE__)
25
- FileUtils.mkdir_p(File.dirname(logfile_path))
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.system_domain.to_s.strip != ''
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.1
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-02 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post