Skip to content

Instantly share code, notes, and snippets.

@benolee
Created November 12, 2010 22:16
Show Gist options
  • Save benolee/674795 to your computer and use it in GitHub Desktop.
Save benolee/674795 to your computer and use it in GitHub Desktop.
require 'sinatra/base'
require 'erb'
class CIJoe
class Server < Sinatra::Base
[...]
def self.project_path=(project_path)
# next line does something screwy
user, pass = Config.cijoe(project_path).user.to_s, Config.cijoe(project_path).pass.to_s
if user != '' && pass != ''
use Rack::Auth::Basic do |username, password|
[ username, password ] == [ user, pass ]
end
puts "Using HTTP basic auth"
end
set :project_path, Proc.new{project_path}
end
[...]
end
end
@benolee
Copy link
Author

benolee commented Nov 12, 2010

the above is called from:

class CIJoe
class Config
[...]
def initialize(command, project_path = nil, parent = nil)
@command = command
@parent = parent
@project_path = project_path || File.join(File.dirname(FILE), '../../')
end
[...]
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment