Archive for September, 2009

Sinatra Take #2

Because this will not be a ordered list of Sinatra posts…

I will mention right now some advantages of Sinatra

Use your toolbox!

  • You can choose your favorite template engine.
    • ERB, Haml, Builder, …

  • Do you have a favorite ORM?
    • ActiveRecord, DataMapper, Sequel, …

  • Javascript?
    • jQuery, Prototipe, Dojo, …

  • tests
    • Test::Unit, RSpec, Bacon, …

more to come…

Comments

Coding with Sinatra

As a SysAdmin I do love my work but sometimes we need to code also!

Some months ago I found this awesome microframework.
Sinatra





“… Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort:…”

Well thats it. I need move some tasks from command line to the web and Sinatra is what I have found to be the most cool.


# sudo gem install sinatra
# vi mywebapp.rb

require 'rubygems'
require 'sinatra'

get '/' do
  erb :index
end

__END__

@@layout
<html>
  <head></head>
  <body>
    <%= yield %>
  </body>
</html>

@@index
Helloa!

# ruby mywebapp.rb ; lynx http://localhost:4567

Easy right? Next post I will introduce some more stuff about Sinatra and maybe CRUD operations coded from the root.

take care.

PS: I do need to think about this CSS!! It’s a PITA!!

Comments

my run facts

Best of:

runbestof.png
  • I will try to beat the 1k and 10k personal records!

Last 2008 Rundown:

2008Rundown.png
  • Thursdays?
  • Fastest run in 29 December? yep I remember but I didn’t knew it was unique!
  • My iPod stop counting calories long time ago. I don’t know why!
  • Is there any way to transform those 131 petrol liters to money?

Well this post register this: ”

I’m back to kick ass!

Please, invite me for a challange!

Comments (7)