Prev | Current Page 272 | Next

Brad Ediger

"Advanced Rails"

If you have specific trouble, the Rails wiki (http://
wiki.rubyonrails.com/) might help. The wiki is disorganized at times, but it has a
large amount of relevant information on many topics if you are willing to search.
* The idea and implementation of this separation of concerns come from Mephisto, which is a good example
of a cleanly structured Rails application. The code is available from http://svn.techno-weenie.net/projects/
mephisto/trunk/.
182 | Chapter 6: Performance
Choosing the Right Tool
A large part of software development consists of selecting the right tools for the job.
This encompasses not only languages but libraries, frameworks, source control,
databases, servers, and all of the other tools and materials that go into a completed
application.
Leveraging external programs
Sometimes the best way to solve a problem is not to have a problem at all. Chances
are, if you have a moderately complicated technical problem, someone else has
solved it. 37signals??™ Basecamp takes this approach when resizing images??”rather
than dealing with the hassle of installing RMagick, they just shell out to ImageMagick:*
def thumbnail(temp, target)
system(
"/usr/local/bin/convert #{escape(temp)} -resize 48x48! #{escape(target)}"
)
end
Part of the beauty of scripting languages is that they were designed out of necessity,
so they have ways to glue disparate parts together.


Pages:
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284