contents/articles/where-does-your-ruby-code-live.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
----- title: "Where does your Ruby code live?" content-type: article timestamp: 1226147640 tags: "ruby|programming" ----- <p>Back when I wrote my <a href="/articles/10-reasons-to-learn-ruby">10 reasons to learn Ruby</a> article, I mentioned <a href="http://www.rubygems.org/">RubyGems</a> in <em>Reason #1</em> as one of they key features of the Ruby programming languages.<br /> Indeed, gems make getting Ruby programs as easy as typing <code>gem install <something></code> from the command line. When you want to distribute something new in Ruby, there's no need to give people download links, zip files or setup programs, just <a href="http://adam.blog.heroku.com/past/2008/11/2/pony_the_express_way_to_send_email_from_ruby/">tell them to get the gem</a>. That's perfectly normal, and extremely cool.</p> <p>Gems are normally stored on <a href="http://rubyforge.org">RubyForge</a>, so all you have to do is uploading your gem there, and it will be available to the rest of the universe. It's a nice feeling. I remember when I first uploaded <a href="http://rubyforge.org/projects/rawline/">RawLine</a> and then tried <code>gem install rawline</code> just for the hell of it: it downloaded and installed the gem, as expected.</p> <p>Back in the day, if you wanted to find something written in Ruby, all you had to do is search through RubyForge, and you'd eventually find it, with a bit of luck.</p> <h3>Can we just have git, please?</h3> <p>RubyForge had, until recently, one major problem: it only allowed <span class="caps">CVS</span> and <span class="caps">SVN</span> repositories, and you had to make your choice when creating the project, once and for all. So when the cool guys at <a href="http://github.com/">GitHub</a> rolled out their <em>social code hosting</em> web site, most of the <em>créme de la créme</em> of RubyForge flocked there in mass migration: <a href="http://github.com/rails/rails/tree/master">Rails</a>, <a href="http://github.com/wycats/merb-core/tree/master">Merb</a>, <a href="http://github.com/dchelimsky/rspec/tree/master">RSpec</a>… you name it.<br /> Once the big guys made the switch, a lot jumped on the GitHub bandwagon of course. Result: we have a lot of projects still on RubyForge, but quite a few (and important ones) on GitHub.</p> <p>Why did people move there? Well, at first it was because they wanted a sleek-looking git host, and RubyForge didn't offer git at the time. But <a href="http://drnicwilliams.com/2008/04/08/git-for-rubyforge-accounts/">git is now available on RubyForge</a>, so why don't people use it? <br /> I'd like to know how many people use git on RubyForge. Apparently you can have your old <span class="caps">SVN</span> repository manually migrated to git, if you ask nicely (and RubyForge people are very helpful always, anyway). Still, I don't think many people use git there, and hardly anyone (if any) moved back from GitHub.</p> <p>What's so special about this new “social code hosting” site then? I guess just a few key features:</p> <ul> <li>Fast and reliable git hosting</li> <li>The ability to “watch” other people's repositories and interact with them “the git way”, also by forking.</li> <li>There's a whole new and fresh community feeling to it: you can follow people, message them, etc.</li> <li>The interface is much more neat than RubyForge's (OK, granted, it doesn't take much)</li> <li>Really cool stats and graphs</li> <li>A basic, but functional, wiki</li> </ul> <h3>…oh, and bug tracking, too!</h3> <p>GitHub has no bug tracking features. It tracks an awful lot of stuff about your repositories and people working on them, but “batteries are sold separately”. You can get batteries <a href="http://lighthouseapp.com/">here</a>, for example. Apparently, GitHub and LightHouse are seamlessly <a href="http://github.com/blog/41-service-integration">integrated</a>.</p> <p>So now you can sign up to two cool brand new web applications with neat interfaces instead of sticking with the old-looking RubyForge (which comes with “batteries included”, after all). <br /> Personally <strong>I'm very confused now</strong>. Fortunately I don't have any extremely cool projects used by thousands of people, so jumping from one source code hosting solution from another is not really an issue for me, but I imagine it would be for others! Correct?</p> <p>So, as far as I know, if you are a Rubyist, here's what you can do:</p> <ol> <li>Stick with RubyForge: it's not so bad after all.</li> <li>Embrace GitHub (and Lighthouse): it's extremely nice to use. Some people are not <a href="http://groovie.org/2008/05/06/most-bizarre-git-service-and-other-stupid-rails-powered-businesses">too convinced</a> that this is the best choice though.</li> <li>Go for something in between, like <a href="http://www.assembla.com/">Assembla</a>, which actually has an <em>impressive</em> list of features and is powered by Rails too, so you'll feel at home. <a href="http://code.google.com/hosting/">Google Code</a> used to be another common choice, but sadly they don't offer git yet.</li> <li>Do-it-yourself, maybe using something like <a href="http://gitorious.org/">Gitorius</a> and some open source bug tracking/project management solution.</li> </ol> <p>So… what choice did <em>you</em> make or are you planning to make?</p> <h3>Moving houses</h3> <p>There's one simple issue to consider when moving your code to a new place: what happens to your <em>old</em> place. If have a relatively popular project, a lot of people may have bookmarked your project page on RubyForge, or the RubyForge subdomain which you may have used as the “home page” for your project (in truth, most of the ones who moved away still use it).</p> <p>You may setup a redirection to the new home page or put a notice saying that the project moved somewhere else and point visitors to GitHub and LightHouse, or to another web site, if you wish. When <a href="http://weblog.rubyonrails.org/2008/4/11/rails-premieres-on-github">Rails moved to GitHub</a>, that wasn't much of a problem as Rails has its own web site.</p> <p>What may become a problem is your old repository. In Rails' case, they left the old <span class="caps">SVN</span> repository available on sourceforge for a while and then removed it altogether. Other project owners have just abandoned their old repositories, occasionally resulting in <a href="http://webby.rubyforge.org/">someone else</a> deciding to leave a note as their <a href="http://webby.rubyforge.org/svn/trunk/">last <span class="caps">SVN</span> commit</a>.</p> <p>These solutions all work (you eventually drive people to the new home of your project), but it's not very nice, that's all. What happens if someone comes up with something cooler than GitHub? In all honesty, you may end up moving house over and over again.</p> <h3>Don't forget the gems!</h3> <p>One thing I liked about RubyForge, as I wrote at the beginning, was that if you uploaded a gem there, it was immediately available to everyone typing <code>gem install <something></code>. <br /> Luckily, <a href="http://gems.github.com/list.html">GitHub supports gems, too</a>! We're saved. The page they put up is <a href="http://gems.github.com/">utterly awful</a>, but it does the job: you can have your gems hosted on GitHub.</p> <p>Good! So surely I can get Rails now, right? Yup: <code>gem install rails</code> will get the latest version of Rails for you, straight from GitHub.</p> <p>Actually, no. It doesn't seem to work that way: sure you can get the latest rails in that way, but it will actually be downloaded from <em>RubyForge</em> (go check the <a href="http://rubyforge.org/frs/?group_id=307&release_id=27493">downloads</a>, you'll see it there). <br /> So even if technically you got Rails, you got it from RubyForge. If you want to get gem from GitHub, you have to add it as gem source first (that's an <em>una tantum</em> operation, luckily): <code>gem sources -a http://gems.github.com</code>.</p> <p>So, yes, you can move to GitHub and you'll also get gem support: but please <em>remind the users</em> that they have to add GitHub as gem source. Or, better, you should always remember to upload your latest gems to GitHub <em>and to RubyForge as well</em>.</p> <h3>The present</h3> <p>To sum up:</p> <ul> <li>If you want, you can stay on RubyForge. It has git, it has gems, it's probably not nearly as prettier than competitors and is not as social, but it works.</li> <li>You can opt for GitHub+LightHouse, have a slick interface, plenty of features and your project will be scattered in 2 different places + your home page, and you'll also have to keep uploading your gems to RubyForge.</li> <li>At this point, you may even go for something completely different, like Assembla or your own setup, but still upload your gems to RubyForge.</li> </ul> <p>The obvious solutions at this point would be that the folks who craft rubygems (the gem which makes the gems, to be clear) add GitHub as default source. Sure as hell when that happens other people will want that too (hey, I'll have gems.h3rald.com setup by then!). Is this the future? I hope not.</p> <h3>The future?</h3> <p>You know there's a domain called <a href="http://www.rubygems.org/">www.rubygems.org</a>? It's where the gem <em>manuals</em> are! <br /> As much as I love documentation, there's nothing wrong in moving all those documents and books to something like <em>docs.rubygems.org</em>, right? <br /> Then they could make RubyGems.org the <em>only</em> official gem server and tell people they should upload their gems there if they want to distribute them efficiently (after manual approval, if necessary, like there is on RubyForge).</p> <p>In this way:</p> <ul> <li>You wouldn't have to upload stuff to RubyForge anymore</li> <li>You could have the clever folks at GitHub to create a simple script to automate the upload</li> <li>You'd have virtually <em>all</em> the gems in one place</li> <li>You'd put a good domain name (currently almost forgotten) to good use</li> </ul> <p>While they are at it, <strong>the clever folks at RubyGems.org could also setup a <em>proper</em> gem directory with a <em>proper</em> search</strong>. I'm sure there would be plenty of people who could help, too!</p> <p>It's not impossible, right? They said that making Rails/Ruby/RSpec documentation more accurate and accessible was impossible, but now there's <a href="http://apidock.com/">APIdock</a>, correct?</p> <p>Personally I'd like it to be a collaborative effort of the Ruby community (like ruby-lang.org), rather than one private company showing off, but I think everyone will be happy as long as it works.<br /> I'm sure people will contribute, I would try at least (after finishing the Italian translation of ruby-lang.org, that is… erhm, well, that's another story…).</p> <p>Thoughts?</p> |