Code Monkey home page Code Monkey logo

Comments (5)

assaf avatar assaf commented on August 25, 2024

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.

sdhull avatar sdhull commented on August 25, 2024

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.

assaf avatar assaf commented on August 25, 2024

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.

sdhull avatar sdhull commented on August 25, 2024

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.

assaf avatar assaf commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.