RubyEnRails2007 - Dr Nic Williams - Keynote

50 %
50 %
Information about RubyEnRails2007 - Dr Nic Williams - Keynote

Published on June 8, 2007

Author: drnic

Source: slideshare.net

Description

Dr Nic gives his report on what's cool with Rails right now

Dr Nic drnicwilliams.com Remember: drnicacademy.com * setup for demo of magic_model_generator (pp 36) * set font size of database.yml to large What’s cool about Rails?

Dr Nic

Dr Nic’s Magic Models

MyConfPlan

Composite Primary Keys

Magic Multi-Connections

Magic Multi-Connections As seen on DHH’s blog

NewGem Generator $ newgem <gem>

NewGem Generator As seen in $ newgem <gem>

Magic Model Generator

Magic Model Generator As seen in ??

why?

Dr Nic’s

Dr Nic’s Academy

Dr Nic’s Academy “Beginning Ruby on Rails” July 7/8 - Netherlands

RailsConf

So why is important?

Why is important?

Why is important? When do I use ?

Why is important? When do I use ? Merb Camping CGI Mongrel Handlers

RailsConf Bet ween last year and this year, I’ve realised they aren’t “Railsconfs”, but...

RailsConf Bet ween last year and this year, I’ve realised they aren’t “Railsconfs”, but...

RubyConf About web development and other things

Websites are text And it doesn’t matter how the text gets to the browser

<html> <head> <title>Hello world</title> </head> <body> Here’s some <p>Hello World</p> might send text that you </body> </html>

Rails When you come to I just want to talk Rails you quickly about these 3... learn there are many things you need to get good at quickly...

Javascript HTML CSS Rails Gems Ruby When you come to I just want to talk Rails you quickly about these 3... learn there are many things you need to get good at quickly... Rake Databases Unix

Javascript HTML CSS Rails Gems Ruby When you come to I just want to talk Rails you quickly about these 3... learn there are many things you need to get good at quickly... Rake Databases Unix

RailsConf 2006 To understand Rails and where its going, let’s look at rails 1.0

RailsConf 2006 To understand Rails and where its going, let’s look at rails 1.0 “Can we make $$$ from Rails?”

RailsConf 2007

RailsConf 2007 “Yes.”

RailsConf 2007 “Because its just text generation” Ok, now let’s look at the latest ways to generate text on the web...

“Does it scale?” Everyone worries about requests per second; but I think its more important to worry about the cost per new feature. Rails is structured to make it easy to design and implement new stuff.

“Does it scale?” “Yes. Just add more controllers.” Everyone worries about requests per second; but I think its more important to worry about the cost per new feature. Rails is structured to make it easy to design and implement new stuff.

RESTful controllers class PeopleController < ApplicationController # GET all or search def index... def show... def new... def edit... def create... def update... def destroy... end

RESTful controllers class PeopleController < ApplicationController # GET all or search def index... def show... def new... CRUD operations def edit... def create... def update... def destroy... end

RESTful routes /people/show/1 => /people/1 /people/some_action/45 => /people/45/some_action Its now cool to use restful routing. The benefit is you can remove the tail of a url, and the url is still meaningful.

One of the main agreements about convention in Rails RESTful result types is RESTfulness. Same actions, but new paradigm. class PeopleController < ApplicationController def create @person = Person.create(params[:person]) respond_to do |format| format.html { redirect_to person_url(@person) } format.xml { render :status => :created, :location => person_url(@person), ... } end From developer side, end you can return more end data formats with the same actions.

One of the main agreements about convention in Rails RESTful result types is RESTfulness. Same actions, but new paradigm. class PeopleController < ApplicationController def create @person = Person.create(params[:person]) respond_to do |format| format.html { redirect_to person_url(@person) } format.xml { render :status => :created, :location => person_url(@person), ... } end From developer side, end you can return more end data formats with the same actions.

Any format you want respond_to do |format| format.html { render ... } format.xml { render ... } format.csv { render ... } format.js { render ... } formal.foobar { render ... } end

ActiveResource Applications “talking” with REST

ActiveResource Applications “talking” with REST

This is cool because... class Person < ActiveResource::Base self.site = quot;http://contacts.drnicwilliams.com:3000/quot; end Person.find_by_name quot;Dr Nic Williamsquot; Who cares what REST is? This syntax is awesome.

Learn more? Read the README and CHANGELOG for ActiveResource http://dev.rubyonrails.org/browser/trunk/activeresource/README

Jester: REST for Javascript Base.model(quot;Personquot;, { plural: quot;peoplequot;, prefix: quot;http://drnicwilliams.com:3000quot;}) Person.find(quot;allquot;, { premium: true }, This #find call is asynchronous { onSuccess: callback }) and invokes callback on complete. by Eric Mill

“Logical” servers for the connector 1) Jumpstart/PXE Boot 2) Monitoring 3) Auditing 4) Logging 5) Provisioning and configuration management 6) DHCP/LDAP for server identification/authentication and control (at dual for failover) 7) DNS: DNS cache and resolver, and a (private) DNS system (4x + 2; 2+ sites) 8) DNS MySQL (4x + 2, dual masters with slaves per DNS node, innodb tables) 9) SPAM filtering servers (files to NFS store and tracking to postgresql) 10) SPAM database setup (postgresql) 11) SPAM NFS store 12) SMTP proxies and gateways out 13) SMTP proxies and gateways in (delivery to clusters to Maildir over NFS) 14) Mail stores 15) IMAP proxy servers 16) IMAP servers 17) User LDAP servers 18) User long running processes 19) User postgresql DB servers 20) User web servers 21) User application servers 22) User File Storage (NFS) 23) Joyent Organization Provisioning/Customer panel servers (web, app, database) 24) iSCSI storage systems 25) Chat servers Jason Hoffman, Railsconf 2007 26) Load balancer/proxies/static caches ...

Guess which is “Rails”? Jason Hoffman, Railsconf 2007

Jason Hoffman, Railsconf 2007

A process of ongoing improvement

Hosting Don’t deploy Rails to Amazon’s EC2 Run Ruby scripts on Amazon’s EC2 EC2 have virtual Use EC2 for storage - if you other lose your instance, processes on you lose data. demand. Backup hourly.

Deployment Capistrano - by Jamis Buck + Deprec - by Mike Bailey deprec = deployment recipies

deprec - easy peasy cap install_rails_stack cap setup cap deploy_with_migrations cap restart_apache Slap ubuntu on a machine and go.

install_rails_stack task :install_rails_stack do setup_user_perms enable_universe disable_cdrom_install install_packages_for_rails install_rubygems The process of install_gems deploying rails install_apache generically is being solved end

Story of 200 database tables

magic_model_generator magicmodels.rubyforge.org

For demo: $ pgstart magic_model_generator $ rails magic_show -d postgresql $ database.yml: database: activerecord_unittest $ Kill textmate and reload it fresh from magic_show folder $ Have /db and /app/models folders open and empty $ Pump up font size $ iTerm open to magic_show folder Now, demo is ready $ sudo gem install magic_model_generator # Show post.rb as example $ rails magic_show $ cd magic_show # point database.yml to legacy database $ rake db:migrate # check /db/schema.rb contains all tables $ ruby script/generate magic_model # check /app/models contains model files

RubyGems are good

Instead of plugins, use gems

Dependencies

Version numbers

Use outside of Rails

Non-ruby code

“But I don’t know how?”

hoe - Ryan Davis

hoe - Ryan Davis seattle.rb - ZenTest/autotest

hoe - Ryan Davis seattle.rb - ZenTest/autotest # Rakefile hoe = Hoe.new(GEM_NAME, VERS) do |p| p.author = AUTHOR p.description = DESCRIPTION p.email = EMAIL p.summary = SUMMARY p.url = HOMEPATH end Its easier to write a Gem than not to!

r a k e

r a k e

History.txt == 0.2.0 2007-06-03 * Added more foo into foo.rb == 0.1.0 2007-06-02 * Foo and Bar now in own files * Using Hoe

History.txt Manifest.txt Manifest.txt README.txt Rakefile bin/gemsonrails lib/gemsonrails.rb lib/gemsonrails/version.rb scripts/txt2html setup.rb templates/init.rb ordered list of templates/tasks_gems_freeze.rake published files templates/tasks_gems_link.rake templates/tasks_gems_unfreeze.rake templates/tasks_load_tasks_in_gems.rake test/test_gemsonrails.rb test/test_helper.rb website/index.html website/index.txt website/javascripts/rounded_corners_lite.inc.js website/stylesheets/screen.css website/template.rhtml

History.txt Manifest.txt Manifest.txt README.txt Rakefile bin/gemsonrails lib/gemsonrails.rb lib/gemsonrails/version.rb scripts/txt2html setup.rb templates/init.rb ordered list of templates/tasks_gems_freeze.rake published files templates/tasks_gems_link.rake templates/tasks_gems_unfreeze.rake templates/tasks_load_tasks_in_gems.rake test/test_gemsonrails.rb test/test_helper.rb website/index.html website/index.txt website/javascripts/rounded_corners_lite.inc.js website/stylesheets/screen.css website/template.rhtml rake check_manifest

NewGem Generator $ newgem <gemname> newgem.rubyforge.org

newgem.rubyforge.org

Test::Unit or RSpec newgem.rubyforge.org

Finally...

JRuby is cool

Learn on ! Dr Nic Academy drnicacademy.com

What: Beginning Rails When: July 7 and 8th Where: Amsterdam +/- BYO: Laptop Cost: 975€ drnicacademy.com

What: Beginning Rails When: July 7 and 8th Where: Amsterdam +/- BYO: Laptop Cost: 975€ 600€ - “rubyenrails” drnicacademy.com

Enjoy En ! drnicwilliams.com drnicacademy.com by Dr Nic

Add a comment

Related pages

Nic | LinkedIn

View 22203 Nic posts, presentations, experts, and more. Get the professional knowledge you need on LinkedIn. LinkedIn Home What is LinkedIn? Join Today
Read more

Dr Nic's Magic Model Generator

Before my keynote, I ... How to install and use the magic_model_generator follows the video from ... All content is copyright © 2006-2010 Dr Nic Williams.
Read more

drnic (Dr Nic Williams) · GitHub

Dr Nic Williams drnic. Stark & Wayne LLC; ... TextMate bundle for working with GitHub; ... make copying syntax highlighted text into Keynote, ...
Read more

RailsConf 2011: Dr. Nic Williams, "Ruby Through the Ages ...

Railsconf 2011: Dr. Nic Williams, ... Meet Dr Nic Williams, ... Keynote: Writing Software by ...
Read more

drnic/copy-as-rtf-tmbundle · GitHub

README.markdown Copy as RTF TextMate bundle. Need to copy + paste some text and keep the syntax highlighting? Yes you do. All the time. For Keynote ...
Read more

Dr Nic's Composite Primary Keys goes 1.0.0 for Rails 2.1

Two years ago Dave Thomas did a keynote at the first ... Composite Primary Keys Goes 1.0.0 ... All content is copyright © 2006-2010 Dr Nic Williams.
Read more

National Speaker Keynote Dr. Trevicia Williams - YouTube

National Speaker for Keynotes, Conferences, Retreats, Corporate Training, Expos, Events and more! Hire Dr. Trevicia Williams to speak at your ...
Read more

Dr Nic Williams on Rails, RailsInstaller and the Future of ...

Dr Nic Williams talks about the ... Dr Nic Williams on Rails, RailsInstaller ... I’d like to ask you about some of the topics that you ...
Read more