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

Make formatters object-oriented so we can Autoload them #1020

Merged
merged 1 commit into from
Feb 22, 2014

Conversation

sethvargo
Copy link
Contributor

This commit changes the way we handle formatter objects by using const_get instead of searching through a list of Formatter objects. This allows us to use Ruby's native Kernel.autolaod to only load
the formatter classes that we want.

Switching to an object-orientated approach also makes it much easier to test and reason about the code. If anything, it is now less lines of code and less intimidating to a non-Rubyist.

@reset
Copy link
Contributor

reset commented Feb 19, 2014

@sethvargo this needs to be rebased

This commit changes the way we handle formatter objects by using
`const_get` instead of searching through a list of Formatter objects.
This allows us to use Ruby's native `Kernel.autolaod` to _only_ load
the formatter classes that we want.

Switching to an object-orientated approach also makes it much easier to
test and reason about the code. If anything, it is now less lines of
code and less intimidating to a non-Rubyist.
@sethvargo sethvargo added this to the 3.0.0 milestone Feb 22, 2014
@sethvargo sethvargo self-assigned this Feb 22, 2014
@sethvargo
Copy link
Contributor Author

@reset rebased and this is now 💚

reset added a commit that referenced this pull request Feb 22, 2014
Make formatters object-oriented so we can Autoload them
@reset reset merged commit b763214 into master Feb 22, 2014
@reset reset deleted the sethvargo/more_speed branch February 22, 2014 21:22
@berkshelf berkshelf locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants