19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/twitty-console/config.rb', line 19
def self.setup
file = File.join(ENV['HOME'], '.twitty-console')
conf = YAML.load_file(file)
user = conf['twitter']['user']
pass = conf['twitter']['password']
site = conf['twitter']['site'] || 'twitter.com'
prot = conf['twitter']['protocol'] || 'https'
frmt = conf['twitter']['format'] || 'xml'
ActiveResource::Base.site = "#{prot}://#{user}:#{pass}@#{site}"
ActiveResource::Base.format = frmt.to_sym
ActiveResource::Base.logger = Logger.new(STDERR) if $DEBUG
if conf['proxy']
proxy_host = conf['proxy']['host']
proxy_port = conf['proxy']['port']
proxy_user = conf['proxy']['user']
proxy_pass = conf['proxy']['password']
ActiveResource::Connection.proxy_host = proxy_host
ActiveResource::Connection.proxy_port = proxy_port
ActiveResource::Connection.proxy_user = proxy_user
ActiveResource::Connection.proxy_password = proxy_pass
if conf['cui']
TwittyConsole::CUI.encoding = conf['cui']['encoding']
end
end
end
|