The Rails Edge Conference in Denver - Day 3
I am a bit late (20minutes) to the conference as I had an iChat with my nieces that turned 3 today.
THE RAILS TIMES by Mike Clark and Bruce Williams
So I seems I haven’t missed to much so far. Mike Clark and Bruce Williams are presenting what’s new in Rails. They call it it “THE RAILS TIMES”, and the first slide is a news paper front page.
- HABTM Ousted in favor of Rich Models using has_many :through.
- Many deprecations telling you how to prepare for Rails 2.0.
- Routes get named.
- Extra: Ruby generates javascript. page[:tags].reload # reload tags.rhtml partial.
- Serial(ization) Killers At Large: YARML, XML, JSON
- RSS is the next big thing: render_rss_feed_for(@people, options)
- The future is CRUD: ruby script/generate scaffold_resource article. map.resources :articles
- Conventions Flourish: see simply_helpful. form_for @person do end
- BULLTIN: Apps respond-to Clients: respond_to do |format| format.html, format.js, format.xml, format.yaml. Custom format can also be added.
- CORBA? RMI? No, ActiveResource!: class Person < ActiveResource::Base
- Security Alert! Parameter Filtering – filter_parameterlogging :password, :login, :user
- Installation Typo Triggers Global App Meltdown: rake rails:freeze:gems
- Manking Attacked by Mongrel: gem install mongrel
- Tomorrow’s Edition? : Rails 2.0? REST?
The Meaning of CRUD by Chad Fowler
This is an awsome talk where Chad is going into the impact that a RESTFul approach has on your development and how to write your application using the new named routes and RESTfull controllers.
Streamlined by Justin Gehtland
Justin goes through many of the options on how to manipulate declaratively a Streamlined driven UI.
Road map:
- 0.0.6 new look (soon)
- 0.0.7 control types for fields
- 0.0.8 plugin instead of generator
- 0.1 99% rcov, compatibility
Features to look for
- visual configuration
- declarative tabbed ui 0.0.8?
- generated columns sortable
- context specific ui (different for list, show , edit…)
- rich text editor (TinyMCE)
Deployment by James Duncan Davidson
Start Early deploying your applications. Find all the “interesting” deployment problems up front. You’ll know how to do it when the times comes. You’ll get into the deployment rhythm.
How to do it: not using WEBrick, CGI, FastCGI…but proxy to Mongrel (ya-huh!). Front End use Apache, Lighttpd, Pound, Pen, or hardware load balancer. Use Capistrano. The Golden Path assumes Capistrano, Unix (NOT Windows), subversion. Apache 2.2.x (myproxy balance), Ruby Termios Library, MySQL 5. Duncan then went on to a live demo, connected to his Subversion repository in Portland using the Hotels network deploying to an EC2 (Amazon Elastic Computing Cloud) . So pretty gutsy demo but the demo went on pretty well.
CONFERENCE CONCLUSION!
Awesome conference, well worth the money. Not only was it well organized but the talks where just loaded of useful information. Thanks to all the presenters!
RailsLogAnalyzer v0.2 for OSX - Faster, Better
Analyzing your log file data.
Once the log file is loaded you will see a breakdown of your requests by year, month, and day.
Click on the year, month, or day to see the controllers invocations during that period.
Click on the controller in the chart to see the method invocations during the selected period.
The method are further broken down based on their http methods (get, post, delete, ...).
Note: loading a 10Mb production log file with 30000 requests takes about 10 seconds on my MacBook Pro.
loading a 250Mb production log file with 530000 requests takes about 2 minutes.
loading a 4.5Gb production log file with 11 million request takes about 45 minutes.
The data is loaded in memory and must be reloaded once the application is closed.
Download it here RailsLogAnalyzer_0.2.dmg (487KB) and let me know your findings at daniel@onrails.org
Part 1: Using WebORB to access ActiveRecords from a Flex application.
On Friday I started for a customer an investigation in providing a Flex front-end for an Ruby on Rails backend using WebORB. In parallel I will push this investigation further for myself in order to find a nice mechanisms to support CRUD operations with relationship support using WebORB. Over the next couple of weeks I will write some of my findings on this blog. So this week-end I started to put in place an environment where I can unit test the interaction between Flex and Ruby on Rails using WebORB. In this first part I will show how to extend WebORB to perform a deep find, how to write a Flex unit test to test asynchronous remote calls, and how to use Ruby on Rails fixtures for the Flex unit tests.
This is an extract of the ‘final’ version of the Flex unit test (as of Part 1 of the article). The full version is at the end of the article.
public function testGetFirstCustomer():void {
var activeRecordService:RemoteObject = getActiveRecordService(onGetFirstCustomerResult);
create_fixtures(["customers", "addresses", "orders", "items"], doGetCustomerFirstCustomer, activeRecordService);
}
private function doGetCustomerFirstCustomer(activeRecordService:Object):void {
var options:Object = {'include':['bill_to_address', {'orders':'items'}]};
activeRecordService.get("Customer", 1, options);
}
private function onGetFirstCustomerResult(event:Event, token:Object=null):void
{
assertTrue(event.toString(), event is ResultEvent); // First param is message.
var customer:Object = ResultEvent(event).result;
assertEquals("Daniel", customer.name);
assertEquals("Littleton", customer.bill_to_address.city);
assertEquals(2, customer.orders.length); // 2 order
assertEquals(3, customer.orders[0].items.length); // the first has 3 items
assertEquals("Remote Control", customer.orders[0].items[2].product);
}
Time.onrails.org now with Blinksale integration.
Blinksale is the easiest way to send invoices online. Now time.onrails.org is the easiest way to create Blinksale invoices. Check http://time.onrails.org/doc/blinksale/blinksale.html for more details.
Namespaces and Rake Command Completion
I got some basic rake command line completion working today using Jon Baer’s comment. Very simple, very easy:
complete -W '`rake—silent—tasks | cut -d ” ” -f 2`' -o default rake
However this didn’t work for the namespaced tasks in a rails app like rake test:units. Searching a little further I found a reference to some code Nicholas Seckar wrote on project.ioni.st. This used ruby to find the possible tasks for command completion. This looked promising, but it still didn’t work for namespaced tasks. A little more googling led me to what looked like the perfect link: Rake-completion script that handles namespaces. Alas, it only handled one level of namespacing. It worked nicely for rake test:units, but rake tmp:ses<TAB> would complete to rake tmp:clear instead of rake tmp:sessions:clear. Also, rake test:units <TAB> would complete to rake test:units units instead of giving me all the tasks again, just in case you want to run multiple tasks form the command line.
So, now what? Stand on the shoulders of others, naturally. Here is what I’m using now that handles multiple namespaces and multiple tasks per command line:
#!/usr/bin/env ruby # Complete rake tasks script for bash # Save it somewhere and then add # complete -C path/to/script -o default rake # to your ~/.bashrc # Nicholas Seckar <nseckar@gmail.com> # Saimon Moore <saimon@webtypes.com> # http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces exit 0 unless File.file?(File.join(Dir.pwd, 'Rakefile')) exit 0 unless /^rake\b/ =~ ENV["COMP_LINE"] after_match = $' task_match = (after_match.empty? || after_match =~ /\s$/) ? nil : after_match.split.last tasks = `rake --silent --tasks`.split("\n")[1..-1].collect {|line| line.split[1]} tasks = tasks.select {|t| /^#{Regexp.escape task_match}/ =~ t} if task_match # handle namespaces if task_match =~ /^([-\w:]+:)/ upto_last_colon = $1 after_match = $' tasks = tasks.collect { |t| (t =~ /^#{Regexp.escape upto_last_colon}([-\w:]+)$/) ? "#{$1}" : t } end puts tasks exit 0
Full time Ruby On Rails Job in Denver.
One of my customers in Denver is looking for an experienced full-time Rails developer. The company is called , Gatelys/Etail Source. You will be part of a small, experienced, and agile development team that has developed three pretty cool Rails eCommerce applications. This is the posting they published on the job board of 37signals (http://jobs.37signals.com/jobs/323):
Description
Small (but quickly growing) eCommerce startup seeks enthusiastic full-time senior-level Rails developer / system engineer. Special focus on performance optimization and tuning. Denver area resident preferred, but not mandatory. Salary will be competitive, depending on qualifications.
To apply
Send resume and salary requirements to jobs@gatelys.com, attention Solomon.
Dreamhost out, Slicehost in.
I must say I like Dreamhost but we had too much downtime recently. Even if we offer time.onrails.org for free it must be up and running when the users need it. This is especially true for a time management application. When you are done with your workday, one click and go home. Lee and I are using time.onrails.org daily for all of our customer projects and recently it has been down once too many time. In addition it’s getting really slow, but then again with a $9 a month shared host plan, I must admit we went already a long way. So time to move on and find a better solution.
We went the last two days on the search for a new hosting provider that would provide dedicated or virtual private servers. There is lots of offerings out there and good information. Lee stumble upon slicehost.com and liked the idea of a small hosting company, that diggs Ruby on Rails, and is about to be launched. They are small and hopefully will work hard to make it. I was not too convinced so we decided to contact them, and had a nice chat with them over their campfire support room. See the campfire transcript. I gave them a hard-time, but they provided us with lots of good information. Check them out if you want to find out what’s going on at slicehost
Transcript: http://onrails.org/files/20060804_slicehost.html
So time.onrails.org users, thank for your patience. In the next month we will move over our application to a way faster environment.
Update: time.onrails.org has been moved. If you sign up with slicehost because of us, feel free to say we referred you. :) Just use this referrel link.
RailsLogAnalyzer – help wanted
I need some Mac users to test and give feed back on a very early version of the RailsLogAnalyzer. This app is an OSX app and not deployed on a server, so I would like to find out the obvious bug that may occur on different Macs. I tried it on my own MacBook Pro, G5 server, and on an old PowerBook G4. But then again the people most likely to use it are Rails developers that may have differences in their environment.
So if you like to take risks :-), understand the basic structure of a Rails app, have a production.log you want to analyze, and are not afraid of some scary bugs then read on…
Two new eCommerce sites driven by Ruby on Rails.
This complements www.nationaltabletennis.com that was launched a couple of months ago:
Streamlined - Will ROCK the Rails World
In the Abendsen release, Streamlined has been focused on solving the problems of our customers and our internal projects. Right now, Streamlined is focused on:
- Generator for churning out the initial views and configuration
- A declarative DSL for managing views, including relationship management, field selection, etc.
- Full Ajax-enabled management views with sorting, paging and live search (with configurable field-inclusion)
- A criteria query extension to Active Record
- Context-sensitive help
- An extensible component system for representing relationships at runtime
- Export to xml/csv
- REST-ful web service layer around all models
- Atom support
- Auto user-management and inclusion of declarative role-based authorization
- Choice of layouts (Yahoo Grids or CSS Framework)
- Theme support
- Includes Javawin for in-browser windowing
This is the feature set we'll release at OSCON in July.