5 ms·
Whoever this guy is, he really needs to pull his head out of his ass. If someone's writing a library or app.. it's up to THEM whether they want to require ruby
by ajkirwin 17y ago
Whoever this guy is, he really needs to pull his head out of his ass.
If someone's writing a library or app.. it's up to THEM whether they want to require rubygems or not. If you don't like how they do it.. then don't use their application/library, it's simple.
Most people create code for their OWN use and THEN publish it for others to use.
- masklinn 17y ago> If someone's writing a library or app.. it's up to THEM whether they want to require rubygems or not. But… why? Most of the time it's not like they actually need gems. They just happen to use gems as a $LOAD_PATH manager, so they're leaking their environment configuration into the library. How can anyone defend that? It's like hardcoding the paths of dynamic libraries, or respawning your shell scripts because damn it if any god damn user is going to run it with anything other than /bin/bash. It's completely insane.
- sho 17y agothey just happen to use gems as a $LOAD_PATH manager Oh come on. That's like saying "you should not make your MacOSX app require Finder just because some people just happen to use it as their file manager". Just happen? It's the default, and overwhelmingly dominant, choice! It's freaking bundled in 1.9 core! rtomayko is a prominent and well regarded community member but he's pretty much a crank on this issue. He is the extreme odd one out who doesn't like rubygems, so it's on him to deal with it, rather than causing inconvenience for everyone else. He doesn't even give a good, or any, reason why he doesn't use gems. And as if I'm going to write -rubygems every time I run anything, give me a break. Rubygems is the official package manager and is used without any issue by 99.9% of Rubyists. It's not 100% perfect but in general works beautifully and greatly contributes to making everything in Ruby "just work". There is no reason for people to stop using it as the default choice.
- masklinn 17y ago> Oh come on. That's like saying "you should not make your MacOSX app require Finder just because some people just happen to use it as their file manager". Yeah it is. And indeed you shouldn't. > Just happen? It's the default, and overwhelmingly dominant, choice! It's freaking bundled in 1.9 core! So fucking what? (and as others have said, in 1.9 rubygems is required by default so that's a very good reason not to require it yourself ever). > Rubygems is the official package manager and is used without any issue by 99.9% of Rubyists. And so the rest should just take it up the ass and live with completely insane and nonsensical decisions such as randomly requiring rubygems just because? > There is no reason for people to stop using it as the default choice. That is not what Ryan says. Ryan doesn't care how you handle your own $LOAD_PATH. If you want to use gems, knock yourself out, that's your own business not his. Ryan just asks that you don't force others to use rubygems without any justification.
- sho 17y agoI can't understand if you are arguing against people duplicating the fact that rubygems is already loaded / is part of the core lib, or that people should respect alternative choices. I thought it was the latter. Yeah it is. And indeed you shouldn't. You're nuts, did you know? completely insane and nonsensical decisions such as randomly requiring rubygems just because Just because .. it's loading required libraries? Like it is designed for? Like everyone uses it for? And so the rest should just take it up the ass Well .. yeah, sorry. The weird personal tastes of two people basically don't matter compared to the great benefits enjoyed by the rest of the community. So, OK. I guess you're just never going to update to 1.9 then? So sad. Anyway, no sense arguing so whatever, carry on.
- masklinn 17y ago> You're nuts, did you know? Thanks for teaching me that I shouldn't use an alternate explorer to the finder. > Just because .. it's loading required libraries? No it's not. It's managing your $LOAD_PATH. You don't need gems to load libraries, unless those were installed by gems in the first place if we stretch the meaning of "load libraries" a lot. > The weird personal tastes of two people basically don't matter compared to the great benefits enjoyed by the rest of the community. What's the relation there? What's the "great benefits" to you adding "require 'rubygems'" like so many droppings to all your libraries? It's not like anyone is arguing against using Rubygems. If you like gems, go ahead and use it. All that's asked is that you don't force others to do so. > I guess you're just never going to update to 1.9 then? I fail to see the relevance. Ruby 1.9 isn't going to shoot me if I don't use gems to manage $LOAD_PATH. And as far as Ruby 1.9 is concerned, since it requires rubygems on its own there's no reason whatsoever for library writers to do it themselves.
- defunkt 17y agoI'm also a crank. So is Rails core member Yehuda Katz. So is Rails core member Josh Peek. So is Rails core member Jeremy Kemper. Calling Ryan "the extreme odd one out" is a) untrue and b) unfair.
- sho 17y agoRight. Now I am really confused. You went out of your way to build gem building support into GH. You run a fricking gem repository, probably the largest after Rubyforge itself. If you honestly agree that using Rubygems is "utterly insane" then .. wtf are you doing? And Rails uses Rubygems. Of course. Its ease of use is one of the reasons Rails, and indeed Ruby itself, is so popular. Is it "utterly insane" for Rails to use Rubygems, too? And if all the core members are so against it, why does it? Why is Rails even in the gem repositories? What am I missing here? Seriously, I just don't get it. I'm currently kinda mentoring a friend of mine who's just getting started programming (my 3rd student!). I can personally attest that Rubygems is an invaluable resource for the beginner and intermediate Rubyist. Have you considered the possibility that your ultra-expert status has blinded you to the needs of the lesser 99% of programmers?
- defunkt 17y agoNo one has suggested, is suggesting, or will suggest that you stop using Rubygems. That is not what this is about in any sense of the phrase. Everyone loves Rubygems, including Ryan Tomayko. This is about the best way to use Rubygems. Check out Josh Peek's recent article: http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-pr... There are ways to use Rubygems without putting "require 'rubygems'" in your code. Those are the correct, most portable, least painful ways of using Rubygems. Learn them and cherish them! That is what this is about: how you are using Rubygems, not whether or not to use them.
- sho 17y agoI just read that post again. Good post, but it's talking about something different. This HN article is about Ryan's views on the matter. Of course I agree that libraries should not require it. I often want to use libraries by themselves. But apps!? What do you suggest - manually place each gem directory, by its full system file path, into $LOAD_PATH? How on earth are you going to use a gem installed in its default location by the ubiquitous "gem install" method, if not by, at some point, requiring rubygems? This whole kerfuffle was started by this gist: http://gist.github.com/54177 http://gist.github.com/54177. Note the title: Why "require 'rubygems'" In Your Library/App/Tests Is Wrong. I thought that was a ridiculous thing to say then and still do. In my app!? That no-one else will ever see, my personal little IRC bot or something? What, pray tell, is the difference between loading rubygems on the command line every single time you run the program, or just writing in the source because you know your app needs it? I have no quarrel with best practise for responsible use of gems. I agree completely with what Josh Peek writes. People publishing gems to public repos should absolutely learn how to do it without stepping on anyone's shoes. But that is not what Ryan says. Ryan says this: You should never do this in a source file included with your library, app, or tests: require 'rubygems' and that is extremist and indefensible and, IMO, flat out wrong. update: I mean, let's have an example. Let's take a top-level app that depends on things. I know, thin. Here we are: http://github.com/macournoyer/thin/blob/9f391ed7fcc7c202a32e520bda9323be25d666e4/lib/thin.rb http://github.com/macournoyer/thin/blob/9f391ed7fcc7c202a32e... He needs eventmachine. He requires rubygems and loads it. Tell me what he is doing wrong. Tell me how he should do it differently. Because I can not see what is wrong with that. And if that usage is wrong, then what is the point of even having Rubygems. update 2: And I would like to clarify that I agree Rails should only be requiring Rubygems when it is being used at the top level, such as being launched from the binary or from the script directory, not when it is being loaded as a lib. It is always the top level app's responsibility to set up paths, etc - rails is a special case because it's both an app and a library.
- jon_dahl 17y agoWhoever this guy is, he really needs to pull his head out of his ass. The author is a smart guy. Major contributor to Sinatra, developer at Heroku, etc. You might be right about the rubygems issue, but the random bile and personal attacks make it hard to take you seriously.