Showing posts with label gems. Show all posts
Showing posts with label gems. Show all posts

Sep 10, 2011

Rack-webconsole, a Ruby/Rails console inside your browser


Rack-webconsole is a Rack middleware that enhances your development experience providing a JavaScript-powered bridge to your Ruby application backend.

With it you can interact with your database and explore the runtime environment from within the browser.

Although it should be used mainly in development environments, I personally think it could be a useful tool for staging as well.

Avoids the pain interacting with some console over an SSH session :) Here you have a little video showing how it works (watch in HD, otherwise you won't see the tiny letters!):

 

Yes, Slim is speedy


Slim
Slim is a template language whose goal is to reduce the view syntax to the essential parts without becoming cryptic.

What?

Slim is a fast, lightweight templating engine with support for Rails 3. It has been tested on Ruby 1.9.2 and Ruby/REE 1.8.7.

Slim's core syntax is guided by one thought: "What's the minimum required to make this work".

As more people have contributed to Slim, there have been optional syntax additions influenced from their use of Haml and Jade. The Slim team is open to these optional additions because we know beauty is in the eye of the beholder.

Slim uses Temple for parsing/compilation and is also integrated into Tilt, so it can be used together with Sinatra or plain Rack.

Sample View:

doctype html
html
  head
    title Slim Examples
    meta name="keywords" content="template language"

  body
    h1 Markup examples
    #content.example1
      p Nest by indentation

    = yield

    - unless items.empty?
      table
        - for item in items do
          tr
            td = item.name
            td = item.price
    - else
      p No items found

    #footer
      | Copyright © 2010 Andrew Stone

    = render 'tracking_code'

    script
      | $(content).do_something();

Aug 29, 2011

rubygems-pwn: A Vulnerability in RubyGems

If you've seen people saying to run  gem install rubygems-pwn  on Twitter (which I don't advise!), it's because it's a proof of concept for a vulnerabilty in RubyGems.

The rubygems-pwn project on GitHub has more information about it, but essentially you can push arbitrary Ruby code into gemspec parameters which will then be executed later on.

The vulnerability has been discussed in the rubygems repo where a fix has already been made but, hopefully, more general fixes should be made available soon. (If you want to see the direct example of a malicious gemspec, look here.)

Source: RubyFlow

Aug 18, 2011

rbenv: A Simple, New Ruby Version Management Tool

rbenv is a new lightweight Ruby version management tool built by Sam Stephenson (of 37signals and Prototype.js fame). 


The established leader in the Ruby version management scene is RVM but rbenv is an interesting alternative if you want or need something significantly lighter with fewer features. 


Think of it as a bit like Sinatra and Rails.


Link: https://github.com/sstephenson/rbenv

Jul 22, 2011

LocomotiveCMS - Better than RefineryCMS

You can play with the demo app @ http://demo.locomotivecms.com/admin
Some features are not enabled in the demo mode.

http://pogodan.com/blog/2011/06/03/we-ve-switched-to-locomotive - blog post on why an organization switched from refinery, adva CMS, etc to LocomotiveCMS.

Things like CSS/JS editiing, custom themes, custom attributes for the CMS pages, custom models, etc are missing in refinery.

You can do everything within the site itself unlike refinery where I had to write lot of ruby code to achieve certain features.

Rails development mode 300% faster

The bigger rails project the slower development mode. If it annoys you go and try ActiveReload by Robert Pankowecki. If you don't believe just watch a video comparison -