daniely/lita-jenkins — pull request #1 by harlanbarnes (2014-07-26 19:35:20+00:00)
Title: added auth header, refactored, added tests

- I added the auth header to the "jenkins list" call as opposed to JUST the build calls. Our jenkins installation is all behind an auth screen (not just the build calls). I did some testing that seemed to indicate that sending the authorization header for URLs that didn't need it had no real effect.
- Refactored ...
- I moved the authorization handling into a single method called headers. I guessed that if later headers were needed they'd be easy to inject here.
- The auth header is now optional, however, I doubt very many people have their Jenkins installation setup that way. :smile:
- I changed the caching of the job list to lazy load instead of explicitly calling the cache method. This was also important because there was a bug where if the user hadn't called "jenkins list" first and just tried to do a build, the build would fail.
- Collapsed the jenkins_build_by_id into the jenkins_build method
- Fixed typo in the help output
- Changed the regex to cover both "jenkins b ID" and "jenkins build ID"
- Added tests to cover the "jenkins build" action