Created
November 12, 2010 22:16
-
-
Save benolee/674795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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