Hacking Journal [2006/01/10]

written by edavis on January 10th, 2006 @ 04:03 PM

New Project, Old Hacks

[2006/01/10]

Today was yet another busy day in my Rails world. Between building up the new website for my work to trying to start my own from scratch, I am beat. At work I finally got a full access limits coded in and tested. Over 1200 lines of tests for 400 lines of code, pretty ratio. I think doing a time rake test_all turned out at about 8 seconds on my Dell 700m. I think tomorrow I will be adding in some ActionMailer to send emails when there is new content that needs approval.

On the home-front, I decided to custom code my own website. I have been debating between doing a Ruby on Rails blog (similar to Typo but more lightweight) or a custom Rake generated one (similar to Martin Fowler’s). I am prototyping the Rails one but something is telling me to do the Rake version instead. Heres a quick breakdown chart as of now:

Rails Version Rake Version
Database backed html generated files
Dynamic pages Static html
Comments allowed No comments
Must run on FCGI Can run anywhere
Good learning experience in Rails Good learning experience in “Ruby”:http://www.ruby-lang.org
nil Improve yaml skills
Could Open Source Project Too Custom to Open Source

I dunno what I will go with, I am leaning to the Rails version but I will know in a few days.

Eric Davis

Comments

  • Jeremy Teale on January 12, 2006 @ 11:29 PM

    I'm confused. I thought Ruby was run on a VM a la Python or Java and used a JIT compiler or bytecode interpreter. As I understand make, it's used to aid in compiling modules and object files in non-VM languages. So what exactly does rake do?
  • Eric Davis on January 13, 2006 @ 03:10 PM

    I think you are thinking make is used only to compile. From the "GNU Make webpage":http://www.gnu.org/software/make/
    # Make is not limited to any particular language. For each non-source file in the program, the makefile specifies the shell commands to compute it. These shell commands can run a compiler to produce an object file, the linker to produce an executable, or to update a library, or TeX or Makeinfo to format documentation.
    # Make is not limited to building a package. You can also use Make to control installing or deinstalling a package, generate tags tables for it, or anything else you want to do often enough to make it worth while writing down how to do it.
    
    An easy way to think of what make can do is to think of it as a very powerful scripting language that is for software developers and has come great built in defaults (i.e. Time check to build only new items, built in C/C++ support). Rake has these features (plus some ideas from "Apache Ant":http://ant.apache.org/ ). I great introduction to Rake can be found at "Martin Fowlers Webpage":http://martinfowler.com/articles/rake.html. Think of rake as a combo of make, bash, and ant with all the power and classes of Ruby thrown in. I recently wrote a simple Rakefile to build my daily life graph, I will try to post it online soon. Eric Davis
  • Jeremy Teale on January 13, 2006 @ 04:41 PM

    Hm, so what were you considering as a data storage method if you go the rake route?
  • Eric Davis on January 14, 2006 @ 02:09 AM

    I was planning to use a text file here to store the page content (with textile markup). Then using a rake job it would be combined with a header/footer and generate a static HTML file. This would make it easy to host (no dynamic pages, no FastCGI) . I think I decided to use the rake version on my business website (it does not change much and has no comments) and then build a simple "Rails":http://www.rubyonrails.com blog for this website. Eric Davis

Post a comment