Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor encapsulate the command-line interface #9

Merged
merged 10 commits into from
May 3, 2016

Conversation

gonzalo-bulnes
Copy link
Owner

As a developer
In order to be able to start the Ruby hooks server programatically
I want to keep all the Ruby hooks server business logic in a single directory

In order to to be able to improve its CLI independently
I want its CLI to be a first-class citizen among the code

See apiaryio#5

This refactoring should allow to start using Thor to build the CLI with minimal disruption.

Using Thor would change the API (starting the server would require to dredd-hooks-ruby start instead of dredd-hooks-ruby) but would allow to build a properly documented CLI (dredd-hooks-ruby help and so on...) with minimal effort.

Remove Bundler dependency
I might be wrong, but I think declaring bundler as a dependency is
superfluous (e.g. its version is not locked in the Gemfile).
This reverts commit ae792ba due to
failures in the Ruby 1.9.3 build on Travis CI.

I'm not sure why the Ruby 1.9.3 build fails (while the Ruy 2.3.0
succeeds) but truth is this update can be omitted for now.

See https://travis-ci.org/gonzalo-bulnes/dredd-hooks-ruby/builds/127012201
This refactoring should allow to start using Thor to build the CLI with
minimal disruption.

Using Thor would change the API (starting the server would require to
dredd-hooks-ruby start instead of dredd-hooks-ruby) but would allow to
build a properly documented CLI (dredd-hooks-ruby help and so on...)
with minimal effort.

See http://whatisthor.com
Minor refactor fix useless variable assignation
...provide default argument to 'Hash#fetch' instead.
Minor move informative output to STDOUT.

Injecting the error and output steams allows to configure them
and to write specs for their messages (eventually).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant