SlideShare a Scribd company logo
1 of 81
Download to read offline
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

More Related Content

What's hot

Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)err
 
Testing Backbone applications with Jasmine
Testing Backbone applications with JasmineTesting Backbone applications with Jasmine
Testing Backbone applications with JasmineLeon van der Grient
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Devon Bernard
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationKirill Chebunin
 
Node.js in action
Node.js in actionNode.js in action
Node.js in actionSimon Su
 
Why Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebWhy Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebBryan Helmig
 
To Batch Or Not To Batch
To Batch Or Not To BatchTo Batch Or Not To Batch
To Batch Or Not To BatchLuca Mearelli
 
Controlling The Cloud With Python
Controlling The Cloud With PythonControlling The Cloud With Python
Controlling The Cloud With PythonLuca Mearelli
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends旻琦 潘
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsIgnacio Martín
 
Going crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPGoing crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPMariano Iglesias
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015Fernando Hamasaki de Amorim
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I thinkWim Godden
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I thinkWim Godden
 
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.nubela
 

What's hot (20)

Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)Kickin' Ass with Cache-Fu (with notes)
Kickin' Ass with Cache-Fu (with notes)
 
Rest in flask
Rest in flaskRest in flask
Rest in flask
 
Testing Backbone applications with Jasmine
Testing Backbone applications with JasmineTesting Backbone applications with Jasmine
Testing Backbone applications with Jasmine
 
Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]Lean React - Patterns for High Performance [ploneconf2017]
Lean React - Patterns for High Performance [ploneconf2017]
 
Rich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 ApplicationRich Model And Layered Architecture in SF2 Application
Rich Model And Layered Architecture in SF2 Application
 
Node.js in action
Node.js in actionNode.js in action
Node.js in action
 
Scala active record
Scala active recordScala active record
Scala active record
 
Why Task Queues - ComoRichWeb
Why Task Queues - ComoRichWebWhy Task Queues - ComoRichWeb
Why Task Queues - ComoRichWeb
 
To Batch Or Not To Batch
To Batch Or Not To BatchTo Batch Or Not To Batch
To Batch Or Not To Batch
 
Controlling The Cloud With Python
Controlling The Cloud With PythonControlling The Cloud With Python
Controlling The Cloud With Python
 
Magic of Ruby
Magic of RubyMagic of Ruby
Magic of Ruby
 
Fatc
FatcFatc
Fatc
 
A tour on ruby and friends
A tour on ruby and friendsA tour on ruby and friends
A tour on ruby and friends
 
Symfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worldsSymfony & Javascript. Combining the best of two worlds
Symfony & Javascript. Combining the best of two worlds
 
Going crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPGoing crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHP
 
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
The worst Ruby codes I’ve seen in my life - RubyKaigi 2015
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
 
My app is secure... I think
My app is secure... I thinkMy app is secure... I think
My app is secure... I think
 
Rapid web development, the right way.
Rapid web development, the right way.Rapid web development, the right way.
Rapid web development, the right way.
 

Similar to RubyEnRails2007 - Dr Nic Williams - Keynote

Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails DevsDiacode
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkDaniel Spector
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
Php classes in mumbai
Php classes in mumbaiPhp classes in mumbai
Php classes in mumbaiaadi Surve
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!mold
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD WorkshopWolfram Arnold
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On RailsSteve Keener
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011Lance Ball
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on RailsViridians
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVCAlive Kuo
 

Similar to RubyEnRails2007 - Dr Nic Williams - Keynote (20)

Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Supa fast Ruby + Rails
Supa fast Ruby + RailsSupa fast Ruby + Rails
Supa fast Ruby + Rails
 
Road to Rails
Road to RailsRoad to Rails
Road to Rails
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
Phoenix for Rails Devs
Phoenix for Rails DevsPhoenix for Rails Devs
Phoenix for Rails Devs
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Php classes in mumbai
Php classes in mumbaiPhp classes in mumbai
Php classes in mumbai
 
Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!Catalyst - refactor large apps with it and have fun!
Catalyst - refactor large apps with it and have fun!
 
2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop2011-02-03 LA RubyConf Rails3 TDD Workshop
2011-02-03 LA RubyConf Rails3 TDD Workshop
 
Introduction To Ruby On Rails
Introduction To Ruby On RailsIntroduction To Ruby On Rails
Introduction To Ruby On Rails
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
Viridians on Rails
Viridians on RailsViridians on Rails
Viridians on Rails
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 

More from Dr Nic Williams

RailsConf Keynote - History of Ruby
RailsConf Keynote - History of RubyRailsConf Keynote - History of Ruby
RailsConf Keynote - History of RubyDr Nic Williams
 
What is your job at your ruby club?
What is your job at your ruby club?What is your job at your ruby club?
What is your job at your ruby club?Dr Nic Williams
 
Integration Testing With Cucumber How To Test Anything J A O O 2009
Integration Testing With  Cucumber    How To Test Anything    J A O O 2009Integration Testing With  Cucumber    How To Test Anything    J A O O 2009
Integration Testing With Cucumber How To Test Anything J A O O 2009Dr Nic Williams
 
Living With 1000 Open Source Projects
Living With 1000 Open Source ProjectsLiving With 1000 Open Source Projects
Living With 1000 Open Source ProjectsDr Nic Williams
 
Rubygem Dev And Workflow
Rubygem Dev And WorkflowRubygem Dev And Workflow
Rubygem Dev And WorkflowDr Nic Williams
 
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008Dr Nic Williams
 
Meta Meta Programming - EuRuKo2008
Meta Meta Programming -  EuRuKo2008Meta Meta Programming -  EuRuKo2008
Meta Meta Programming - EuRuKo2008Dr Nic Williams
 

More from Dr Nic Williams (8)

RailsConf Keynote - History of Ruby
RailsConf Keynote - History of RubyRailsConf Keynote - History of Ruby
RailsConf Keynote - History of Ruby
 
What is your job at your ruby club?
What is your job at your ruby club?What is your job at your ruby club?
What is your job at your ruby club?
 
Integration Testing With Cucumber How To Test Anything J A O O 2009
Integration Testing With  Cucumber    How To Test Anything    J A O O 2009Integration Testing With  Cucumber    How To Test Anything    J A O O 2009
Integration Testing With Cucumber How To Test Anything J A O O 2009
 
Living With 1000 Open Source Projects
Living With 1000 Open Source ProjectsLiving With 1000 Open Source Projects
Living With 1000 Open Source Projects
 
Rubygem Dev And Workflow
Rubygem Dev And WorkflowRubygem Dev And Workflow
Rubygem Dev And Workflow
 
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008
Everyone Can Participate - Dr Nic Williams - Railssummit Brazil 2008
 
Meta Meta Programming - EuRuKo2008
Meta Meta Programming -  EuRuKo2008Meta Meta Programming -  EuRuKo2008
Meta Meta Programming - EuRuKo2008
 
Why Use Rails by Dr Nic
Why Use Rails by  Dr NicWhy Use Rails by  Dr Nic
Why Use Rails by Dr Nic
 

Recently uploaded

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 

Recently uploaded (20)

DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 

RubyEnRails2007 - Dr Nic Williams - Keynote

  • 1. 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?
  • 7. Magic Multi-Connections As seen on DHH’s blog
  • 8. NewGem Generator $ newgem <gem>
  • 9. NewGem Generator As seen in $ newgem <gem>
  • 11. Magic Model Generator As seen in ??
  • 12. why?
  • 14. Dr Nic’s Academy
  • 15. Dr Nic’s Academy “Beginning Ruby on Rails” July 7/8 - Netherlands
  • 17. So why is important?
  • 18. Why is important?
  • 19. Why is important? When do I use ?
  • 20. Why is important? When do I use ? Merb Camping CGI Mongrel Handlers
  • 21. RailsConf Bet ween last year and this year, I’ve realised they aren’t “Railsconfs”, but...
  • 22. RailsConf Bet ween last year and this year, I’ve realised they aren’t “Railsconfs”, but...
  • 24. Websites are text And it doesn’t matter how the text gets to the browser
  • 25. <html> <head> <title>Hello world</title> </head> <body> Here’s some <p>Hello World</p> might send text that you </body> </html>
  • 26. 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...
  • 27. 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
  • 28. 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
  • 29. RailsConf 2006 To understand Rails and where its going, let’s look at rails 1.0
  • 30. RailsConf 2006 To understand Rails and where its going, let’s look at rails 1.0 “Can we make $$$ from Rails?”
  • 32. RailsConf 2007 “Yes.”
  • 33. RailsConf 2007 “Because its just text generation” Ok, now let’s look at the latest ways to generate text on the web...
  • 34. “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.
  • 35. “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.
  • 36. RESTful controllers class PeopleController < ApplicationController # GET all or search def index... def show... def new... def edit... def create... def update... def destroy... end
  • 37. 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
  • 38. 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.
  • 39. 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.
  • 40. 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.
  • 41. Any format you want respond_to do |format| format.html { render ... } format.xml { render ... } format.csv { render ... } format.js { render ... } formal.foobar { render ... } end
  • 44. 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.
  • 45. Learn more? Read the README and CHANGELOG for ActiveResource http://dev.rubyonrails.org/browser/trunk/activeresource/README
  • 46. 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
  • 47. “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 ...
  • 48. Guess which is “Rails”? Jason Hoffman, Railsconf 2007
  • 50. A process of ongoing improvement
  • 51. 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.
  • 52. Deployment Capistrano - by Jamis Buck + Deprec - by Mike Bailey deprec = deployment recipies
  • 53. deprec - easy peasy cap install_rails_stack cap setup cap deploy_with_migrations cap restart_apache Slap ubuntu on a machine and go.
  • 54. 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
  • 55. Story of 200 database tables
  • 57. 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
  • 64. “But I don’t know how?”
  • 65. hoe - Ryan Davis
  • 66. hoe - Ryan Davis seattle.rb - ZenTest/autotest
  • 67. 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!
  • 70. 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
  • 71. 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
  • 72. 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
  • 73. NewGem Generator $ newgem <gemname> newgem.rubyforge.org
  • 75. Test::Unit or RSpec newgem.rubyforge.org
  • 78. Learn on ! Dr Nic Academy drnicacademy.com
  • 79. What: Beginning Rails When: July 7 and 8th Where: Amsterdam +/- BYO: Laptop Cost: 975€ drnicacademy.com
  • 80. What: Beginning Rails When: July 7 and 8th Where: Amsterdam +/- BYO: Laptop Cost: 975€ 600€ - “rubyenrails” drnicacademy.com
  • 81. Enjoy En ! drnicwilliams.com drnicacademy.com by Dr Nic