Parent

Methods

StompServer::StompAuth

Attributes

authorized[RW]

Public Class Methods

new(passfile='.passwd') click to toggle source
# File lib/stomp_server/stomp_auth.rb, line 6
def initialize(passfile='.passwd')
  @passfile = passfile
  @authorized = Hash.new
  if File.exists?(@passfile)
    file = File.read(@passfile)
    file.split(/\n/).each do |data|
      next if data =~/^\s*#/
      data.gsub(/\s/,'')
      if data =~ /^\s*(\S+)\s*:\s*(.*?)\s*$/
        @authorized[$1] = $2
      end
    end
  end
  puts "Authorized users #{@authorized.keys}" if $DEBUG
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.