vaneyckt/Jently — pull request #21 by vhladama (2013-04-12 14:13:09+00:00)
Title: Add first specs, for Logger, and incorporate helper module breakout from PR#15

No need to merge this (although if you do, it'll make it easier for me to keep up-to-date with changes to the helpers you make in your repo if you're cool with breaking them out like this.)

I pulled in just a couple commits from pr #15, but left most of it, as you suggested.

If this start seems ok, I'll continue adding coverage for the helpers, then start on the main Modules.

The stateless/functional thing takes a little getting used to, but I can deal with it. I feel like the Config file might be better off as a class, just for convenience of accessing the methods and being able to do refactors like changing

```ruby
if config.has_key?(:jenkins_login) && config.has_key?(:jenkins_password)
connection.basic_auth config[:jenkins_login], config[:jenkins_password]
end
````
to
```ruby
config.has_auth_credentials? && connection.basic_auth config.auth_credentials
````
I realize, though, that once you start saving the results of parsing the Config file (say, in jently.rb itself), you now start introducing state which has to be maintained or passed around everywhere, or you have to add methods for stashing and accessing a parsed Config instance. That gets even grosser because the only way I can think of storing it is in a class variable, which our team has come to avoid like the plague.

If you can think of alternative approaches, I'd appreciate your input. For now, I'm going to keep following your stateless pattern.