Sha256: baa08c8b4ff96ffd269325dc39bd3cd331ea2de0165f7038ba6cb9ff3a164509

Contents?: true

Size: 881 Bytes

Versions: 61

Compression:

Stored size: 881 Bytes

Contents

# Misc utility function used throughout by the RubyCAS-server.
module Spider; module CASServer
  module Utils
    def random_string(max_length = 29)
#      rg =  ::Crypt::ISAAC.new
      max = 4294619050
      r = "#{Time.now.to_i}r%X%X%X%X%X%X%X%X" % 
        [rand(max), rand(max), rand(max), rand(max), 
         rand(max), rand(max), rand(max), rand(max)]
      r[0..max_length-1]
    end
    module_function :random_string
      
    def log_controller_action(controller, params)
      $LOG << "\n"
      
      /`(.*)'/.match(caller[1])
      method = $~[1]
      
      if params.respond_to? :dup
        params2 = params.dup
        params2['password'] = '******' if params2['password']
      else
        params2 = params
      end
      $LOG.debug("Processing #{controller}::#{method} #{params2.inspect}")
    end
    module_function :log_controller_action
  end
end; end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
spiderfw-1.0.1 apps/cas_server/lib/utils.rb
spiderfw-1.0.0 apps/cas_server/lib/utils.rb
spiderfw-0.6.39 apps/cas_server/lib/utils.rb
spiderfw-0.6.38 apps/cas_server/lib/utils.rb
spiderfw-0.6.37 apps/cas_server/lib/utils.rb
spiderfw-0.6.35 apps/cas_server/lib/utils.rb
spiderfw-0.6.34 apps/cas_server/lib/utils.rb
spiderfw-0.6.33 apps/cas_server/lib/utils.rb
spiderfw-0.6.32 apps/cas_server/lib/utils.rb
spiderfw-0.6.31 apps/cas_server/lib/utils.rb
spiderfw-0.6.30 apps/cas_server/lib/utils.rb
spiderfw-0.6.29 apps/cas_server/lib/utils.rb
spiderfw-0.6.28 apps/cas_server/lib/utils.rb
spiderfw-0.6.27 apps/cas_server/lib/utils.rb
spiderfw-0.6.26 apps/cas_server/lib/utils.rb
spiderfw-0.6.26.pre1 apps/cas_server/lib/utils.rb
spiderfw-0.6.25 apps/cas_server/lib/utils.rb
spiderfw-0.6.24 apps/cas_server/lib/utils.rb
spiderfw-0.6.23 apps/cas_server/lib/utils.rb
spiderfw-0.6.22 apps/cas_server/lib/utils.rb