lib/ezid/configuration.rb in ezid-client-0.11.0 vs lib/ezid/configuration.rb in ezid-client-0.12.0
- old
+ new
@@ -9,19 +9,24 @@
# @api private
#
class Configuration
HOST = "ezid.cdlib.org"
+ PORT = 443
# EZID host name
# Default: value of `EZID_HOST` environment variable, if present, or
# the EZID service host "ezid.cdlib.org".
attr_accessor :host
+ # EZID TCP/IP port
+ # Default: value of `EZID_PORT` variable
+ attr_accessor :port
+
# Use HTTPS?
- # Default: `true`, unless `EZID_USE_SSL` environment variable is set
- # to the string "false".
+ # Default: `nil`; `true` if `EZID_USE_SSL` environment variable is set
+ # to the string "true".
attr_accessor :use_ssl
# EZID user name
# Default: value of `EZID_USER` environment variable
attr_accessor :user
@@ -40,10 +45,11 @@
def initialize
@user = ENV["EZID_USER"]
@password = ENV["EZID_PASSWORD"]
@host = ENV["EZID_HOST"] || HOST
- @use_ssl = ENV["EZID_USE_SSL"] != false.to_s
+ @port = ENV["EZID_PORT"] || PORT
+ @use_ssl = true if ENV["EZID_USE_SSL"] == true.to_s
@default_shoulder = ENV["EZID_DEFAULT_SHOULDER"]
end
def logger
@logger ||= Logger.new(STDERR)