Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Fixing Issue #50, Issue #36, and Issue #14.
Browse files Browse the repository at this point in the history
For #36 I rewrote the setup.xqy. Also added unit tests for Roxy bootstrap
  • Loading branch information
paxtonhare committed Oct 25, 2012
1 parent ccb4bd7 commit 17fd910
Show file tree
Hide file tree
Showing 14 changed files with 4,998 additions and 1,902 deletions.
18 changes: 13 additions & 5 deletions deploy/lib/MLClient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,26 @@ class MLClient
def initialize(options)
@ml_username = options[:user_name]
@ml_password = options[:password]
@logger = options[:logger]
@logger = options[:logger] || logger
@request = {}
end

def self.set_logger(logger)
def MLClient.logger()
@@logger ||= Logger.new(STDOUT)
end

def MLClient.logger=(logger)
@@logger = logger
end

def logger()
@logger
end

def get_http
if (!@http)
@http = Roxy::Http.new({
:logger => @logger
:logger => logger
})
end
@http
Expand All @@ -37,7 +45,7 @@ def get_http
def build_request_params(url, verb)
uri = URI.parse url
if (!@request[verb])
@logger.debug("creating new #{verb} request\n")
logger.debug("creating new #{verb} request\n")
@request[verb] = Net::HTTP.const_get(verb.capitalize).new(uri.request_uri)
@request[verb].add_field 'Connection', 'keep-alive'
@request[verb].add_field 'Keep-Alive', '30'
Expand All @@ -52,7 +60,7 @@ def build_request_params(url, verb)
:protocol => uri.scheme,
:user_name => @ml_username,
:password => @ml_password,
:logger => @logger
:logger => logger
}
end

Expand Down
Loading

0 comments on commit 17fd910

Please sign in to comment.