Friday, October 28, 2011

Rails 3 Beginner to Builder

The Ruby Style Guide

One thing has always bothered me as Ruby developer - Python devs have a great programming style reference (PEP-8) and we never got an official guide documenting Ruby coding style and best practices.



Table of Contents

Rails Style Guide


Abstract
The goal of this guide is to present a set of best practices and style prescriptions for Ruby on Rails 3 development. It's a complementary guide to the already existing community-driven Ruby coding style guide.

While in the guide the section Testing Rails applications is after Developing Rails applications I truly believe that Behaviour-Driven Development (BDD) is the best way to develop software. Keep that in mind.

Rails is an opinionated framework and this is an opinionated guide. In my mind I'm totally certain that RSpec is superior to Test::Unit, Sass is superior to CSS and Haml (Slim) is superior to Erb. So don't expect to find any Test::Unit, CSS or Erb advice in here.

Some of the advice here is applicable only to Rails 3.1.

Table of Contents

  • Developing Rails Applications
  • Configuration
  • Routing
  • Controllers
  • Models
  • ActiveRecord
  • Migrations
  • Views
  • Assets
  • Mailers
  • Bundler
  • Priceless Gems
  • Flawed Gems
  • Managing processes
  • Testing Rails Applications
  • Cucumber
  • RSpec
  • Views
  • Contollers
  • Models
  • Mailers
  • Uploaders
  • Further Reading
  • Contributing
  • Spread the word

A Modern Guide to Threads

Every time you execute ruby, rails or irb, you are creating a process. Within each process, you have something which is executing the code in your process. This is called a thread.

Your operating system starts every process with a “main” thread. Ruby allows you to create as many additional threads as you want by calling Thread.new with a block of code to be executed. Once the block of code has finished executing, the thread is considered dead. If the main thread exits, the process dies.

Connection Management in ActiveRecord


OMG! Happy Thursday! I am trying to be totally enthusiastic, but the truth is that I have a cold, so there will be fewer uppercase letters and exclamation points than usual. 
Anyway, I want to talk about database connection management in ActiveRecord. I am not too pleased with its current state of affairs. I would like to describe how ActiveRecord connection management works today, how I think it should work, and steps towards fixing the current system.
Posted by Aaron Patterson – October 20, 2011
http://tenderlovemaking.com/2011/10/20/connection-management-in-activerecord

RailwayJS - MVC framework


What is railway?

Railway is the Node. JS MVC framework based on ExpressJS, fully ExpressJS-compatible. It allows you to build web applications in a similar manner as in Ruby On Rails.
The main objective of the framework - web development without pain.
What is under the hood

  • Full MVC+H stack
  • Resource-based routing
  • JugglingDB ORM
  • Multi-locale support
  • Coffee-script support (howto)
  • Generators for model, controller, scaffold
  • Testing: nodeunit, cucumis, code coverage reporting
  • Debugging: railway console
  • Extensions

Wednesday, October 26, 2011

Rhodes

Rhodes is an open source Ruby-based framework to rapidly build native apps for all major smartphone operating systems (iPhone, Android, RIM, Windows Mobile and Windows Phone 7). These are true native device applications (NOT mobile web apps) which work with synchronized local data and take advantage of device capabilities such as GPS, PIM contacts and calendar, camera, native mapping, push, barcode, signature capture, Bluetooth and Near Field Communications (NFC).
Rhodes is the ONLY framework with: support for Model View Controller (other frameworks force you to put all business logic into the view as JavaScript), synchronized data (the price of entry for enterprise apps), support for ALL devices (Android and iPhone is not “crossplatform”), a hosted build service (RhoHub – which changes the game for mobile app development entirely) and true industrial device capabilities such as NFC. Rhodes has many other major advantages over every other framework and underlying SDK, which can be summarized as modern development goodness for mobile apps.

If you don’t need an IDE and have Ruby already, you can install Rhodes with: “gem install rhodes”. Instructions on how to build your first app are in our Rhodes Tutorial

http://rhomobile.com/products/rhodes/