Skip to content

Commit

Permalink
Fix the require string for the JSON gem on case-sensitive file system…
Browse files Browse the repository at this point in the history
…s and accept a proxy config setting (or try to get it from the environment).
  • Loading branch information
Brian Donovan committed Jun 12, 2008
1 parent f65d1b9 commit e55c7de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions github-campfire.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require 'rubygems'
require 'JSON'
require 'json'
require 'tinder'
require 'sinatra'
require 'erb'
Expand All @@ -19,7 +19,13 @@ def initialize(payload)

def connect(repo)
credentials = REPOS[repo]
campfire = Tinder::Campfire.new(credentials['subdomain'], :ssl => credentials['ssl'] || false)

# generate Tinder options
options = {}
options[:ssl] = credentials['ssl'] || false
options[:proxy] = credentials['proxy'] || ENV[options[:ssl] ? 'https_proxy' : 'http_proxy']

campfire = Tinder::Campfire.new(credentials['subdomain'], options)
campfire.login(credentials['username'], credentials['password'])
return campfire.find_room_by_name(credentials['room'])
end
Expand Down

0 comments on commit e55c7de

Please sign in to comment.