Guest User

Untitled

a guest
Jun 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. require 'sinatra/base'
  2. require 'erb'
  3.  
  4. class CIJoe
  5. class Server < Sinatra::Base
  6. [...]
  7. def self.project_path=(project_path)
  8. # next line does something screwy
  9. user, pass = Config.cijoe(project_path).user.to_s, Config.cijoe(project_path).pass.to_s
  10. if user != '' && pass != ''
  11. use Rack::Auth::Basic do |username, password|
  12. [ username, password ] == [ user, pass ]
  13. end
  14. puts "Using HTTP basic auth"
  15. end
  16. set :project_path, Proc.new{project_path}
  17. end
  18. [...]
  19. end
  20. end
Add Comment
Please, Sign In to add comment