lib/plezi/base/services.rb in plezi-0.7.1 vs lib/plezi/base/services.rb in plezi-0.7.2

- old
+ new

@@ -12,11 +12,11 @@ S_LOCKER = Mutex.new # public API to add a service to the framework. # accepts: # port:: port number - # parameters:: a hash of paramaters that are passed on to the service for handling (and from there, service dependent, to the protocol and/or handler). + # parameters:: a hash of parameters that are passed on to the service for handling (and from there, service dependent, to the protocol and/or handler). # # parameters are any of the following: # host:: the host name. defaults to any host not explicitly defined (a catch-all). # alias:: a String or an Array of Strings which represent alternative host names (i.e. `alias: ["admin.google.com", "admin.gmail.com"]`). # root:: the public root folder. if this is defined, static files will be served from the location. @@ -36,15 +36,15 @@ # # templates: # # templates can be either an ERB file on a Haml file. # - def add_service port, paramaters = {} - paramaters[:port] ||= port - paramaters[:service_type] ||= ( paramaters[:ssl] ? SSLService : BasicService) + def add_service port, parameters = {} + parameters[:port] ||= port + parameters[:service_type] ||= ( parameters[:ssl] ? SSLService : BasicService) service = nil - service = paramaters[:service_type].create_service(port, paramaters) unless ( defined?(BUILDING_PLEZI_TEMPLATE) || defined?(PLEZI_ON_RACK) ) - S_LOCKER.synchronize {SERVICES[service] = paramaters} + service = parameters[:service_type].create_service(port, parameters) unless ( defined?(BUILDING_PLEZI_TEMPLATE) || defined?(PLEZI_ON_RACK) ) + S_LOCKER.synchronize {SERVICES[service] = parameters} info "Started listening on port #{port}." true end # Plezi Engine, DO NOT CALL. stops all services - active connection will remain open until completion.