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

Update multiple formatter interface #295

Closed
sferik opened this issue Apr 6, 2014 · 3 comments
Closed

Update multiple formatter interface #295

sferik opened this issue Apr 6, 2014 · 3 comments

Comments

@sferik
Copy link
Collaborator

sferik commented Apr 6, 2014

I left a comment on #158 but I thought I would open an issue proposing a new interface for specifying multiple formatters:

SimpleCov.formatters = [
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
]

This is the current interface:

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::CSVFormatter,
]

I think my proposal is better than the current interface because (conventionally) the [] method is used to fetch a value, not to set a value.

This proposal would not require breaking the current interface SimpleCov.formatter because the new method is named SimpleCov.formatters (with an “s”).

@fables-tales
Copy link

👍. Square brackets on constants doing things other than getting values are almost always a smell.

@bf4
Copy link
Collaborator

bf4 commented Jul 13, 2014

Sounds good to me. Would you mind submitting a PR?

@sferik
Copy link
Collaborator Author

sferik commented Jul 14, 2014

Submitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants