The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Different Ways of Installing Metric Fu

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jake Scruggs

Posts: 336
Nickname: aurorae314
Registered: Feb, 2008

Jake Scruggs is a developer at ThoughtWorks
Different Ways of Installing Metric Fu Posted: Sep 24, 2008 7:19 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jake Scruggs.
Original Post: Different Ways of Installing Metric Fu
Feed Title: Jake Scruggs
Feed URL: http://jakescruggs.blogspot.com/feeds/posts/default
Feed Description: Ruby, Rails, Metrics, Testing, and pursuit of clean code.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jake Scruggs
Latest Posts From Jake Scruggs

Advertisement
Something I didn't mention when I announced the re-launch of metric_fu as a gem is that now, because it's a gem, you have more options when installing it in your project.

First option:
Vendor Everything. Lots of people are big fans of unpacking gems into the vendor directory of their Rails project (or a similar folder in a non-Rails project) so that everyone who checks out the code gets the right version of the gem. You can then require it in your Rakefile like this:
require 'vendor/gems/jscruggs-metric_fu-0.7.6/lib/metric_fu'

However...

Second option:
Conditionally require the gem. When I announced metric_fu back in April, a lot of commentors bemoaned the fact that they would have to install something into their production code that wasn't really necessary for production. I don't really mind doing this as metric_fu does not modify any classes: It's mostly just a bunch of Rake tasks (and some report building code). However, I see their point. So if you don't want to put metric_fu into your project, you can simply make sure the gem is installed on your CruiseControl machine and then conditionally require metric_fu in a rake file like so:
begin; require 'metric_fu'; rescue LoadError; end

So anyone who has the metric_fu gem installed on their box can run the reports, while keeping everything else pure.

Read: Different Ways of Installing Metric Fu

Topic: Interview on Elegant Code Previous Topic   Next Topic Topic: Windy City Rails Part Two

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use