/usr/lib/ruby/1.8/twitter/console.rb is in libtwitter-ruby1.8 0.7.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Contains hooks for the twitter console
require('optparse')
module Twitter
class Client
class << self
# Helper method mostly for irb shell prototyping.
#
# Reads in login/password Twitter credentials from YAML file
# found at the location given by <tt>config_file</tt> that has
# the following format:
# envname:
# login: mytwitterlogin
# password: mytwitterpassword
#
# Where <tt>envname</tt> is the name of the environment like 'test',
# 'dev' or 'prod'. The <tt>env</tt> argument defaults to 'test'.
#
# To use this in the shell you would do something like the following
# examples:
# twitter = Twitter::Client.from_config('config/twitter.yml', 'dev')
# twitter = Twitter::Client.from_config('config/twitter.yml')
def from_config(config_file, env = 'test')
yaml_hash = YAML.load(File.read(config_file))
self.new yaml_hash[env]
end
end # class << self
end
end
|