I don't like the fact that credentials may only be provided using a configuration file in the home directory. As a solution I suggest inversion of control when dealing with credentials - the Service should not know where to ask for them, but expect them as provided on initialization. That makes it possible to supply them like
I don't like the fact that credentials may only be provided using a configuration file in the home directory. As a solution I suggest inversion of control when dealing with credentials - the Service should not know where to ask for them, but expect them as provided on initialization. That makes it possible to supply them like
ShortURL.shorten 'http://oh.my/very/long/url', :bitly, {'username' => 'joe', 'key' => 'key123'}
The code in the PR is just a quick proposal for now. If it was to be accepted, I would also provide tests that are now missing.