assaf / vanity

Experiment Driven Development for Ruby
http://vanity.labnotes.org
MIT License
1.55k stars 269 forks source link

Remove track! from the global scope #257

Closed daniel-nelson closed 8 years ago

daniel-nelson commented 9 years ago

Vanity has overall been a boon. Thank you for your work on it.

One request would be to remove track! from the global scope. Vanity.track! would avoid polluting the global namespace and would also be easier to read months down the line or by someone unfamiliar with Vanity in the project.

phillbaker commented 9 years ago

Thanks @daniel-nelson, there's definitely a lot more work to be done!

I tend to agree. I think a better approach is to make it available on the Vanity object and also make it includable in the ApplicationController so it's easily accessible in controllers. Thoughts?

daniel-nelson commented 9 years ago

I don't see the benefit of a global track! method. Analytics track, too, so it isn't clear what track! belongs to/does. But as long as it wasn't exposed in controllers by default, I would just avoid including and always access via the class method.