Close and Go BackBack to Viget

Opinions/Reviews

Keep Your Friends Close, But Your Test Data Closer

Patrick Reagan
Patrick Reagan, Development Director, September 18, 2009

Like any Rails developer, you've been indoctrinated into the cult of DRY and are constantly removing duplication whenever you can as you add new functionality to your application. Refactoring is an important part of the development process and improves the maintainability and understandability of your application's code.

While this is good practice for production code, the tests in your application can benefit from refactoring as well. Often, it is the setup phase of the unit testing cycle where you will encounter the most duplication. The following example was extracted from Tweets of Fury (go play now, I'll wait) – I'm using both Shoulda and Matchy for the tests:

Continue reading "Keep Your Friends Close, But Your Test Data Closer"

Getting Started with MongoDB & MongoMapper

Clinton R. Nixon
Clinton R. Nixon, Former Staffer, September 17, 2009

As part of our NoSQL exploration, I’ve spent some time lately with MongoDB. MongoDB bills itself as a “schema-free document-oriented database.” In using MongoDB, I’ve found it to be an easy transition from RDBMS’s because of the way it organizes document-based data. Here’s the basics:

  • MongoDB has collections of data, not tables. Unlike CouchDB, which is also a document-oriented DB, Mongo has namespaces for data. These are schema-less, so any data could go in each namespace. In my practice, I’ve persisted objects of one class into each collection, not unlike ActiveRecord with MySQL or any other RDBMS.

  • MongoDB has indexes. Even though each collection has no schema, you can still index the data in a collection based off a field. Not all documents in a collection have to have this field.

  • MongoDB has a query language and query profiling. While you can use JavaScript to search through a collection, like CouchDB, you also have access to a rich query language that can filter based on fields, like SQL, and filter based on the contents of embedded documents, which proves to be totally freaking awesome. Instead of a complex join, you can query for all documents in the posts collection that have an embedded comment in the last month.

Continue reading "Getting Started with MongoDB & MongoMapper"

Introducing Garb: Access the Google Analytics Data Export API with Ruby

Tony Pitale
Tony Pitale, Former Staffer, April 24, 2009

Since Google announced that they would be releasing an API for their de-facto analytics tools I was pained with the effort to contain my excitement. The results were a reporting tool and a new gem: Garb.

Continue reading "Introducing Garb: Access the Google Analytics Data Export API with Ruby"

Scala: The Adventure Begins!

Clinton R. Nixon
Clinton R. Nixon, Former Staffer, September 24, 2008

I’ve been enthusiastic about the Scala programming language for a few months now, and this week’s been very exciting for the Scala community. A new Scala book from the Pragmatic Programmers was announced today, and Alex Payne from Twitter gave a presentation at C4 that strongly indicates Twitter’s writing part of their platform in Scala. Given this week’s news, I thought I’d explain why I’m using Scala, and what that means for the Lab.

Continue reading "Scala: The Adventure Begins!"

Passenger: Let It Ride?

Mark Cornick
Mark Cornick, Former Staffer, April 21, 2008

Rails application deployment has gotten a pretty bad rep. Legitimate Rails developers and blog trolls alike have bemoaned the lack of something equivalent to mod_php, which would make Rails applications "just work" when uploaded to a web server, as we got used to doing in the PHP days.

So Passenger made a big splash when it was released this month. It promises to make deployment "a breeze" and says "No Ruby on Rails-specific server configuration [will be] required!" Furthermore, the developers' own benchmarks show it being a little faster than Mongrel.

After a decade-plus in IT, I'm skeptical of hype and twice as skeptical of benchmarks. But even though I've mastered the sometimes-confusing realm of Apache and Mongrel, I'm curious to see just how easy it is to use, and just how fast.

Continue reading "Passenger: Let It Ride?"

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Upcoming Events

Future Insights Live - April 29 to May 4
Future of Web Apps, Future of Web Design, Future of Mobile, and Future of Web in the Enterprise have joined forces to bring you our most comprehensive event EVER!

Contact Us

Have any questions, comments, ideas, or secrets to share? Let us know.


What color is the sky?

Sorry, you need to have Javascript enabled to use this form. (Don't blame us, blame the spammers!) If you'd like to contact us, please visit our Contact page.