SlideShare a Scribd company logo
An Introduction to Ruby and Rails Matthew Bohnsack Wannabe Rubyist November 9 th  2005
Outline What is Ruby and why should I care? What is Rails and why should I care? Two must-have tools for Ruby development Major Ruby features (the language in a nutshell) Rails overview Where to go for more information Questions / Hacking November 9th 2005 An Introduction to Ruby and Rails
What is Ruby?  Why should I care? What: The Wikipedia answer is here . Created/lead by  Matz  (Japanese) Open Source interpreted scripting language, like Perl, Python, Tcl, etc., but focused on being very object oriented, expressive, and  bringing joy to programming . Principle of least surprise Why: Productivity ideas presented in  Ousterhout’s 1998 paper  coming to very serious critical mass (and beyond) Learn a new language to learn new ways of thinking about code in any language (e.g., blocks and iterators) Joy!  November 9th 2005 An Introduction to Ruby and Rails
What is Rails?  Why should I care? What: Web Framework that makes building database-driven MVC-oriented web apps easy through a template engine, ORM ( ActiveRecord ) and other best practices, such as test driven development, deployment tools, patterns, etc. Much less complicated than J2EE solutions, but perhaps more so than PHP or Perl in cgi-bin. Copy cats are being created in other languages: Python (TurboGears) Perl (Maypole) http://rubyonrails.org/  + book + online screencasts + online docs & tutorials Why: I’ve been watching the world of web development since ~ 1995, and I’ve never seen anything like Rails in terms of buzz, momentum, adoption rate, etc. November 9th 2005 An Introduction to Ruby and Rails
Must have tool #1:  irb Interactive ruby console : Experiment on the fly Tab complete object methods … November 9th 2005 An Introduction to Ruby and Rails # ~/.irbrc require 'irb/completion ' use_readline=true auto_indent_mode=true
Must have tool #2:  ri Console-based Ruby doc tool November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – irb sessions follow Like all interpreted scripting languages, you can put code into a file, chmod +x, then just execute it. But, we’ll mostly use irb sessions in this presentation… November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – objects are everywhere Some languages have built-in types that aren’t objects. Not so with Ruby.  Everything’s an object: November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – objects have methods November 9th 2005 An Introduction to Ruby and Rails Bang on the tab key in irb to see the methods that are available for each object.
Ruby in a nutshell – Variables Local variables - start with lower case: foo bar Global variables - start with dollar sign: $foo $bar Constants and Classes – start with capital letter: CONSTANT Class Instance variables – start with at sign: @foo @bar Class variables – start with double at sign: @@foo @@bar November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Arrays November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Hashes November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Symbols Starts with a ‘:’ Only one copy of a symbol kept in memory November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Blocks & Iterators November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – It’s easy to build classes November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – It’s fun to play with classes (like the one we just made) November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Classes are open Example shown here uses our Hacker class, but what happens when the whole language is open? November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – Other notes on Classes Ruby only has single inheritance.  This makes things simpler, but mix-ins provide much of multiple inheritance’s benefit, without the hassle. November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – a few gotchas Despite the principle of least surprise: Zero isn’t false: No increment operator ( foo++ ).  Instead use: foo += 1 foo = foo + 1 November 9th 2005 An Introduction to Ruby and Rails
Ruby in a nutshell – RubyGems CPAN for Ruby?  http://docs.rubygems.org/ Examples: gem list gem install redcloth --version ">= 3.0.0"   … Using gems in your program: require ‘rubygems’ require ‘some_gem’  November 9th 2005 An Introduction to Ruby and Rails
Want to learn more Ruby?  Excellent, simple, beginner’s tutorial: http://www.math.umd.edu/~dcarrera/ruby/0.3/index.html Other stuff at end of talk Start hacking November 9th 2005 An Introduction to Ruby and Rails
Quick Rails Demo – Build a TODO list application in 5 minutes Define database rails todo cd todo Edit config/database.yml ./script/generate model Todo ./script/generate scaffold todo Look at scaffolding ./script/server –b www.bohnsack.com Add due_date field, regenerate scaffolding, and check the results ./script/console November 9th 2005 An Introduction to Ruby and Rails
Where to go for more information Books: Online material: First edition of Pickaxe online for free http://www.ruby-doc.org/ why’s (poignant) guide to Ruby http://rubyonrails.org/ Rails screencast (s) Planet Ruby on Rails November 9th 2005 An Introduction to Ruby and Rails
The End / Questions November 9th 2005 An Introduction to Ruby and Rails

More Related Content

What's hot (20)

Ruby Loves Dot Net
Ruby Loves Dot NetRuby Loves Dot Net
Ruby Loves Dot Net
Ivan Porto Carrero
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
Will Green
 
Javascript
JavascriptJavascript
Javascript
해원 이
 
IronRuby And The DLR
IronRuby And The DLRIronRuby And The DLR
IronRuby And The DLR
Andre John Cruz
 
Bldr: A Minimalist JSON Templating DSL
Bldr: A Minimalist JSON Templating DSLBldr: A Minimalist JSON Templating DSL
Bldr: A Minimalist JSON Templating DSL
Alex Sharp
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
Visuality
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
Ricardo Sanchez
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
SATOSHI TAGOMORI
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Odyssey to async ruby
Odyssey to async rubyOdyssey to async ruby
Odyssey to async ruby
Delton Ding
 
High Concurrent Ruby Web Development Without Fear
High Concurrent Ruby Web Development Without FearHigh Concurrent Ruby Web Development Without Fear
High Concurrent Ruby Web Development Without Fear
Delton Ding
 
Special Subject 1+2: RoR 2
Special Subject 1+2: RoR 2Special Subject 1+2: RoR 2
Special Subject 1+2: RoR 2
Stefan Fodor
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
mametter
 
Ruby introductions
Ruby introductionsRuby introductions
Ruby introductions
Binh Bui
 
Intro to kotlin
Intro to kotlinIntro to kotlin
Intro to kotlin
Tomislav Homan
 
Coding in kotlin
Coding in kotlinCoding in kotlin
Coding in kotlin
Debmalya Jash
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
Will Green
 
Bldr: A Minimalist JSON Templating DSL
Bldr: A Minimalist JSON Templating DSLBldr: A Minimalist JSON Templating DSL
Bldr: A Minimalist JSON Templating DSL
Alex Sharp
 
TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
Ruby formatters
Ruby formattersRuby formatters
Ruby formatters
Visuality
 
Lock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin CoroutinesLock-free algorithms for Kotlin Coroutines
Lock-free algorithms for Kotlin Coroutines
Roman Elizarov
 
A Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and UnderstandingA Type-level Ruby Interpreter for Testing and Understanding
A Type-level Ruby Interpreter for Testing and Understanding
mametter
 
Ruby projects of interest for DevOps
Ruby projects of interest for DevOpsRuby projects of interest for DevOps
Ruby projects of interest for DevOps
Ricardo Sanchez
 
Exploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQLExploring Ruby on Rails and PostgreSQL
Exploring Ruby on Rails and PostgreSQL
Barry Jones
 
Make Your Ruby Script Confusing
Make Your Ruby Script ConfusingMake Your Ruby Script Confusing
Make Your Ruby Script Confusing
SATOSHI TAGOMORI
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Odyssey to async ruby
Odyssey to async rubyOdyssey to async ruby
Odyssey to async ruby
Delton Ding
 
High Concurrent Ruby Web Development Without Fear
High Concurrent Ruby Web Development Without FearHigh Concurrent Ruby Web Development Without Fear
High Concurrent Ruby Web Development Without Fear
Delton Ding
 
Special Subject 1+2: RoR 2
Special Subject 1+2: RoR 2Special Subject 1+2: RoR 2
Special Subject 1+2: RoR 2
Stefan Fodor
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
mametter
 
Ruby introductions
Ruby introductionsRuby introductions
Ruby introductions
Binh Bui
 

Viewers also liked (7)

How Computer Work
How Computer WorkHow Computer Work
How Computer Work
guest5dedf5
 
Two Slides
Two SlidesTwo Slides
Two Slides
guest5dedf5
 
Test Deck Server
Test Deck ServerTest Deck Server
Test Deck Server
guest5dedf5
 
Dopfel
DopfelDopfel
Dopfel
guest5dedf5
 
Bpa
BpaBpa
Bpa
guest5dedf5
 
Strange Attractors
Strange AttractorsStrange Attractors
Strange Attractors
guest5dedf5
 
A Prediction Technique for Chaotic Time Series
A Prediction Technique for Chaotic Time SeriesA Prediction Technique for Chaotic Time Series
A Prediction Technique for Chaotic Time Series
Suhel Mulla
 
How Computer Work
How Computer WorkHow Computer Work
How Computer Work
guest5dedf5
 
Test Deck Server
Test Deck ServerTest Deck Server
Test Deck Server
guest5dedf5
 
Strange Attractors
Strange AttractorsStrange Attractors
Strange Attractors
guest5dedf5
 
A Prediction Technique for Chaotic Time Series
A Prediction Technique for Chaotic Time SeriesA Prediction Technique for Chaotic Time Series
A Prediction Technique for Chaotic Time Series
Suhel Mulla
 

Similar to Intro To Ror (20)

ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
 
Book of ruby
Book of rubyBook of ruby
Book of ruby
phongbk1609
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
Espen Brækken
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
Felipe Schmitt
 
P4 P Update January 2009
P4 P Update January 2009P4 P Update January 2009
P4 P Update January 2009
vsainteluce
 
Ebay News 2001 4 19 Earnings
Ebay News 2001 4 19 EarningsEbay News 2001 4 19 Earnings
Ebay News 2001 4 19 Earnings
QuarterlyEarningsReports
 
Ebay News 2000 10 19 Earnings
Ebay News 2000 10 19 EarningsEbay News 2000 10 19 Earnings
Ebay News 2000 10 19 Earnings
QuarterlyEarningsReports
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
 
Fukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - OpalFukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - Opal
Andy Maleh
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
Thomas Asikis
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Manoj Kumar
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Amit Patel
 
02 ruby overview
02 ruby overview02 ruby overview
02 ruby overview
Walker Maidana
 
Pré Descobrimento Do Brasil
Pré Descobrimento Do BrasilPré Descobrimento Do Brasil
Pré Descobrimento Do Brasil
ecsette
 
Ruby'on'rails
Ruby'on'railsRuby'on'rails
Ruby'on'rails
gmergel
 
Ruby Beyond Rails
Ruby Beyond RailsRuby Beyond Rails
Ruby Beyond Rails
Gaveen Prabhasara
 
Ruby hellug
Ruby hellugRuby hellug
Ruby hellug
Eleni Hourouzidou
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
Espen Brækken
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
tutorialsruby
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
Espen Brækken
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
Felipe Schmitt
 
P4 P Update January 2009
P4 P Update January 2009P4 P Update January 2009
P4 P Update January 2009
vsainteluce
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
 
Fukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - OpalFukuoka Ruby Award 2023 - Opal
Fukuoka Ruby Award 2023 - Opal
Andy Maleh
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
Thomas Asikis
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Manoj Kumar
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
Amit Patel
 
Pré Descobrimento Do Brasil
Pré Descobrimento Do BrasilPré Descobrimento Do Brasil
Pré Descobrimento Do Brasil
ecsette
 
Ruby'on'rails
Ruby'on'railsRuby'on'rails
Ruby'on'rails
gmergel
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
Espen Brækken
 

Recently uploaded (20)

Network Detection and Response (NDR): The Future of Intelligent Cybersecurity
Network Detection and Response (NDR): The Future of Intelligent CybersecurityNetwork Detection and Response (NDR): The Future of Intelligent Cybersecurity
Network Detection and Response (NDR): The Future of Intelligent Cybersecurity
GauriKale30
 
NewBase 05 May 2025 Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
NewBase 05 May 2025  Energy News issue - 1785 by Khaled Al Awadi_compressed.pdfNewBase 05 May 2025  Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
NewBase 05 May 2025 Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
intra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.pptintra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.ppt
NTTDATA INTRAMART
 
www.visualmedia.com digital markiting (1).pptx
www.visualmedia.com digital markiting (1).pptxwww.visualmedia.com digital markiting (1).pptx
www.visualmedia.com digital markiting (1).pptx
Davinder Singh
 
Salesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptxSalesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptx
reinbauwens1
 
EquariusAI analytics for business water risk
EquariusAI analytics for business water riskEquariusAI analytics for business water risk
EquariusAI analytics for business water risk
Peter Adriaens
 
The Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdfThe Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdf
Richard Lucas
 
Level Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up SuccessLevel Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up Success
Best Virtual Specialist
 
Region Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdfRegion Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdf
Consultonmic
 
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand AwarenessAlec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler
 
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdfAccounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
CA Suvidha Chaplot
 
AlaskaSilver Corporate Presentation Apr 28 2025.pdf
AlaskaSilver Corporate Presentation Apr 28 2025.pdfAlaskaSilver Corporate Presentation Apr 28 2025.pdf
AlaskaSilver Corporate Presentation Apr 28 2025.pdf
Western Alaska Minerals Corp.
 
20250428 CDB Investor Deck_Apr25_vFF.pdf
20250428 CDB Investor Deck_Apr25_vFF.pdf20250428 CDB Investor Deck_Apr25_vFF.pdf
20250428 CDB Investor Deck_Apr25_vFF.pdf
yihong30
 
Strategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptxStrategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptx
PrekshyaRana
 
From Sunlight to Savings The Rise of Homegrown Solar Power.pdf
From Sunlight to Savings The Rise of Homegrown Solar Power.pdfFrom Sunlight to Savings The Rise of Homegrown Solar Power.pdf
From Sunlight to Savings The Rise of Homegrown Solar Power.pdf
Insolation Energy
 
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
janewatson684
 
From Dreams to Threads: The Story Behind The Chhapai
From Dreams to Threads: The Story Behind The ChhapaiFrom Dreams to Threads: The Story Behind The Chhapai
From Dreams to Threads: The Story Behind The Chhapai
The Chhapai
 
Solaris Resources Presentation - Corporate April 2025.pdf
Solaris Resources Presentation - Corporate April 2025.pdfSolaris Resources Presentation - Corporate April 2025.pdf
Solaris Resources Presentation - Corporate April 2025.pdf
pchambers2
 
Freeze-Dried Fruit Powder Market Trends & Growth
Freeze-Dried Fruit Powder Market Trends & GrowthFreeze-Dried Fruit Powder Market Trends & Growth
Freeze-Dried Fruit Powder Market Trends & Growth
chanderdeepseoexpert
 
CGG Deck English - Apr 2025-edit (1).pptx
CGG Deck English - Apr 2025-edit (1).pptxCGG Deck English - Apr 2025-edit (1).pptx
CGG Deck English - Apr 2025-edit (1).pptx
China_Gold_International_Resources
 
Network Detection and Response (NDR): The Future of Intelligent Cybersecurity
Network Detection and Response (NDR): The Future of Intelligent CybersecurityNetwork Detection and Response (NDR): The Future of Intelligent Cybersecurity
Network Detection and Response (NDR): The Future of Intelligent Cybersecurity
GauriKale30
 
NewBase 05 May 2025 Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
NewBase 05 May 2025  Energy News issue - 1785 by Khaled Al Awadi_compressed.pdfNewBase 05 May 2025  Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
NewBase 05 May 2025 Energy News issue - 1785 by Khaled Al Awadi_compressed.pdf
Khaled Al Awadi
 
intra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.pptintra-mart Accel series 2025 Spring updates-en.ppt
intra-mart Accel series 2025 Spring updates-en.ppt
NTTDATA INTRAMART
 
www.visualmedia.com digital markiting (1).pptx
www.visualmedia.com digital markiting (1).pptxwww.visualmedia.com digital markiting (1).pptx
www.visualmedia.com digital markiting (1).pptx
Davinder Singh
 
Salesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptxSalesforce_Architecture_Diagramming_Workshop (1).pptx
Salesforce_Architecture_Diagramming_Workshop (1).pptx
reinbauwens1
 
EquariusAI analytics for business water risk
EquariusAI analytics for business water riskEquariusAI analytics for business water risk
EquariusAI analytics for business water risk
Peter Adriaens
 
The Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdfThe Peter Cowley Entrepreneurship Event Master 30th.pdf
The Peter Cowley Entrepreneurship Event Master 30th.pdf
Richard Lucas
 
Level Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up SuccessLevel Up Your Launch: Utilizing AI for Start-up Success
Level Up Your Launch: Utilizing AI for Start-up Success
Best Virtual Specialist
 
Region Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdfRegion Research (Hiring Trends) Vietnam 2025.pdf
Region Research (Hiring Trends) Vietnam 2025.pdf
Consultonmic
 
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand AwarenessAlec Lawler - A Passion For Building Brand Awareness
Alec Lawler - A Passion For Building Brand Awareness
Alec Lawler
 
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdfAccounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
Accounting_Basics_Complete_Guide_By_CA_Suvidha_Chaplot (1).pdf
CA Suvidha Chaplot
 
20250428 CDB Investor Deck_Apr25_vFF.pdf
20250428 CDB Investor Deck_Apr25_vFF.pdf20250428 CDB Investor Deck_Apr25_vFF.pdf
20250428 CDB Investor Deck_Apr25_vFF.pdf
yihong30
 
Strategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptxStrategic Enterprise Management - Unit I.pptx
Strategic Enterprise Management - Unit I.pptx
PrekshyaRana
 
From Sunlight to Savings The Rise of Homegrown Solar Power.pdf
From Sunlight to Savings The Rise of Homegrown Solar Power.pdfFrom Sunlight to Savings The Rise of Homegrown Solar Power.pdf
From Sunlight to Savings The Rise of Homegrown Solar Power.pdf
Insolation Energy
 
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
Mexico Office Furniture Market Share, Size, Growth & Trends (2025-2034)
janewatson684
 
From Dreams to Threads: The Story Behind The Chhapai
From Dreams to Threads: The Story Behind The ChhapaiFrom Dreams to Threads: The Story Behind The Chhapai
From Dreams to Threads: The Story Behind The Chhapai
The Chhapai
 
Solaris Resources Presentation - Corporate April 2025.pdf
Solaris Resources Presentation - Corporate April 2025.pdfSolaris Resources Presentation - Corporate April 2025.pdf
Solaris Resources Presentation - Corporate April 2025.pdf
pchambers2
 
Freeze-Dried Fruit Powder Market Trends & Growth
Freeze-Dried Fruit Powder Market Trends & GrowthFreeze-Dried Fruit Powder Market Trends & Growth
Freeze-Dried Fruit Powder Market Trends & Growth
chanderdeepseoexpert
 

Intro To Ror

  • 1. An Introduction to Ruby and Rails Matthew Bohnsack Wannabe Rubyist November 9 th 2005
  • 2. Outline What is Ruby and why should I care? What is Rails and why should I care? Two must-have tools for Ruby development Major Ruby features (the language in a nutshell) Rails overview Where to go for more information Questions / Hacking November 9th 2005 An Introduction to Ruby and Rails
  • 3. What is Ruby? Why should I care? What: The Wikipedia answer is here . Created/lead by Matz (Japanese) Open Source interpreted scripting language, like Perl, Python, Tcl, etc., but focused on being very object oriented, expressive, and bringing joy to programming . Principle of least surprise Why: Productivity ideas presented in Ousterhout’s 1998 paper coming to very serious critical mass (and beyond) Learn a new language to learn new ways of thinking about code in any language (e.g., blocks and iterators) Joy! November 9th 2005 An Introduction to Ruby and Rails
  • 4. What is Rails? Why should I care? What: Web Framework that makes building database-driven MVC-oriented web apps easy through a template engine, ORM ( ActiveRecord ) and other best practices, such as test driven development, deployment tools, patterns, etc. Much less complicated than J2EE solutions, but perhaps more so than PHP or Perl in cgi-bin. Copy cats are being created in other languages: Python (TurboGears) Perl (Maypole) http://rubyonrails.org/ + book + online screencasts + online docs & tutorials Why: I’ve been watching the world of web development since ~ 1995, and I’ve never seen anything like Rails in terms of buzz, momentum, adoption rate, etc. November 9th 2005 An Introduction to Ruby and Rails
  • 5. Must have tool #1: irb Interactive ruby console : Experiment on the fly Tab complete object methods … November 9th 2005 An Introduction to Ruby and Rails # ~/.irbrc require 'irb/completion ' use_readline=true auto_indent_mode=true
  • 6. Must have tool #2: ri Console-based Ruby doc tool November 9th 2005 An Introduction to Ruby and Rails
  • 7. Ruby in a nutshell – irb sessions follow Like all interpreted scripting languages, you can put code into a file, chmod +x, then just execute it. But, we’ll mostly use irb sessions in this presentation… November 9th 2005 An Introduction to Ruby and Rails
  • 8. Ruby in a nutshell – objects are everywhere Some languages have built-in types that aren’t objects. Not so with Ruby. Everything’s an object: November 9th 2005 An Introduction to Ruby and Rails
  • 9. Ruby in a nutshell – objects have methods November 9th 2005 An Introduction to Ruby and Rails Bang on the tab key in irb to see the methods that are available for each object.
  • 10. Ruby in a nutshell – Variables Local variables - start with lower case: foo bar Global variables - start with dollar sign: $foo $bar Constants and Classes – start with capital letter: CONSTANT Class Instance variables – start with at sign: @foo @bar Class variables – start with double at sign: @@foo @@bar November 9th 2005 An Introduction to Ruby and Rails
  • 11. Ruby in a nutshell – Arrays November 9th 2005 An Introduction to Ruby and Rails
  • 12. Ruby in a nutshell – Hashes November 9th 2005 An Introduction to Ruby and Rails
  • 13. Ruby in a nutshell – Symbols Starts with a ‘:’ Only one copy of a symbol kept in memory November 9th 2005 An Introduction to Ruby and Rails
  • 14. Ruby in a nutshell – Blocks & Iterators November 9th 2005 An Introduction to Ruby and Rails
  • 15. Ruby in a nutshell – It’s easy to build classes November 9th 2005 An Introduction to Ruby and Rails
  • 16. Ruby in a nutshell – It’s fun to play with classes (like the one we just made) November 9th 2005 An Introduction to Ruby and Rails
  • 17. Ruby in a nutshell – Classes are open Example shown here uses our Hacker class, but what happens when the whole language is open? November 9th 2005 An Introduction to Ruby and Rails
  • 18. Ruby in a nutshell – Other notes on Classes Ruby only has single inheritance. This makes things simpler, but mix-ins provide much of multiple inheritance’s benefit, without the hassle. November 9th 2005 An Introduction to Ruby and Rails
  • 19. Ruby in a nutshell – a few gotchas Despite the principle of least surprise: Zero isn’t false: No increment operator ( foo++ ). Instead use: foo += 1 foo = foo + 1 November 9th 2005 An Introduction to Ruby and Rails
  • 20. Ruby in a nutshell – RubyGems CPAN for Ruby? http://docs.rubygems.org/ Examples: gem list gem install redcloth --version ">= 3.0.0" … Using gems in your program: require ‘rubygems’ require ‘some_gem’ November 9th 2005 An Introduction to Ruby and Rails
  • 21. Want to learn more Ruby? Excellent, simple, beginner’s tutorial: http://www.math.umd.edu/~dcarrera/ruby/0.3/index.html Other stuff at end of talk Start hacking November 9th 2005 An Introduction to Ruby and Rails
  • 22. Quick Rails Demo – Build a TODO list application in 5 minutes Define database rails todo cd todo Edit config/database.yml ./script/generate model Todo ./script/generate scaffold todo Look at scaffolding ./script/server –b www.bohnsack.com Add due_date field, regenerate scaffolding, and check the results ./script/console November 9th 2005 An Introduction to Ruby and Rails
  • 23. Where to go for more information Books: Online material: First edition of Pickaxe online for free http://www.ruby-doc.org/ why’s (poignant) guide to Ruby http://rubyonrails.org/ Rails screencast (s) Planet Ruby on Rails November 9th 2005 An Introduction to Ruby and Rails
  • 24. The End / Questions November 9th 2005 An Introduction to Ruby and Rails