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