Comments (5)
The tests don't assume or force any particular dependency management, see http://gist.github.com/54177
I strongly recommend using Bundler, that way you get to run the tests with the dependencies listed in the Gemfile. When the Gemfile changes, you can update all the dependencies with a simple bundle install.
There are many incompatibilities between Ruby 1.8.6, 1.8.7, 1.9.1 and 1.9.2, not to mention MRI and JRuby. That means that, on occasion, people will check in code that's only tested to work on the particular Ruby platform they use, and fail on others. In my case that would be 1.9.1 (soon 1.9.2).
Sadly, we don't have CI to catch these errors.
PS: Pushed a fix for this.
from vanity.
Assaf -- thanks for the speedy reply.
Also thanks for the link to that gist. It makes perfect sense... (and as hesitant as I am to say something that might be kind of at odds with what the great Ryan Tomayko has said), I feel it is a bit outdated, especially because it doesn't mention Bundler at all.
I mean, fine, don't "force" rubygems on people. But do force Bundler on them. Bundler totally solves the problem of "forcing" rubygems on people, because they can easily edit the Gemfile (if they so desire) to load a library from a given path, github repo (even a specific branch of that repo), or other source.
So I think the best solution (perhaps not available at the time this ranty gist was written) is to completely embrace Bundler. Don't explicitly require rubygems, don't even add "-rrubygems" to task.ruby_opts in your Rakefile. But instead of requiring all the libraries in test_helper.rb, you can explicitly require 'bundler'
(which will work without rubygems), and then do Bundler.require
This way you can have a really simple bootstrapping for new people getting started with the tests, but you also have a highly customizable solution for resolving & requiring dependencies. AND... it will immediately break and tell new users/developers what they need to do if they don't have Bundler or if they haven't run bundle install
yet.
Whaddaya think?
from vanity.
Bundler doesn't require any libraries for you, it only makes libraries available from the LOAD_PATH. It's the same thing as requiring rubygems, but with a different local repository.
I still don't understand why I would want to force Bundler on people. I strongly recommend it as the way to work on the Vanity source code. I just don't see reason to exclude people from using different setups.
http://vanity.labnotes.org/contributing.html#building
from vanity.
You certainly can have Bundler require your dependencies for you. (That's what I was talking about with Bundler.require
).
http://rdoc.info/rdoc/carlhuda/bundler/blob/b0665682e3c3781632eae667e39b24a6d9a0dd95/Bundler.html#require-class_method
It seems to me that the meat of the argument against "forcing" rubygems on people is that you can't use custom or edge versions of required libraries. Obviously, Bundler solves these problems, so it would seem that this argument is moot.
The reason to "exclude" people from using different setups is to ensure compatibility and proper functioning. It provides this nice starting point "start with these versions of these libraries and this will work". Then if you want to utilize some other version of the required libraries, simply edit the Gemfile.
Just like with Rails -- convention over configuration. The convention should make it easy for people to get bootstrapped. If they then want to muck around with different setups, they can do so -- within the constraints of Bundler and the Gemfile.
Anyway if I can't convince you to remove the "require 'mocha'" etc from your test_helper, that's fine -- I was just more interested in thinking about . My question is answered so I'll go ahead and close this ticket.
from vanity.
Sorry. I was thinking of using Bundler strictly in a non-invasive way (calling setup). If you use it in an invasive way, it can indeed require some of the libraries. I don't want to use it in an invasive way.
Remember, it's "convention over configuration", not "convention and no configuration". By analogy I'm in favor of convention first and have no intent of prohibiting configuration. Hence there's an easy way to use Vanity, well supported, clearly documented, and consistent with other projects.
I'm not going to go out of my way to make it hard to use Vanity without Bundler.
from vanity.
Related Issues (20)
- Vanity metrics generating a row for each call to track HOT 2
- Finish a/b test HOT 9
- Connection issues can go unnoticed with rails
- Getting an error from vanity when trying to update redis HOT 3
- Rails 5 Support HOT 4
- vanity.yml on CI HOT 3
- Redis gem version 4+ ==> Error when Vanity tries to call redis.client.disconnect! HOT 4
- failing to deploy to heroku HOT 3
- Progressive tests HOT 1
- Disable logs HOT 2
- use_vanity not working? HOT 2
- Vanity generator not found HOT 1
- Be able to configure default callbacks
- Update Jekyll and documentation generation
- Add rubocop HOT 4
- Be able to disable vanity for test. HOT 1
- "Preload" multiple experiment status/participation for a page
- Thoughts on improvements to the Vanity developer interface
- Appraisals don't actually test on Rails 6
- Collaborate on experimentation library concepts HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vanity.