1 # Contains hooks for the twitter console
8 # Helper method mostly for irb shell prototyping.
10 # Reads in login/password Twitter credentials from YAML file
11 # found at the location given by <tt>config_file</tt> that has
12 # the following format:
14 # login: mytwitterlogin
15 # password: mytwitterpassword
17 # Where <tt>envname</tt> is the name of the environment like 'test',
18 # 'dev' or 'prod'. The <tt>env</tt> argument defaults to 'test'.
20 # To use this in the shell you would do something like the following
22 # twitter = Twitter::Client.from_config('config/twitter.yml', 'dev')
23 # twitter = Twitter::Client.from_config('config/twitter.yml')
24 def from_config(config_file, env = 'test')
25 yaml_hash = YAML.load(File.read(config_file))
26 self.new yaml_hash[env]