SlideShare una empresa de Scribd logo
puts "Hello PTA!"
# Why Ruby?
whoami = {	
name: "Kenneth Kalmer",	
twitter: "@kennethkalmer",	
github: "kennethkalmer",	
blog: "opensourcery.co.za"	
}	
!
class History 	
def when? 	
1995 	
end 	
	
def where? 	
"Japan" 	
end 	
	
def by? 	
"Matz" 	
end 	
end 	
!
[1] pry(main)> class History
[1] pry(main)*
[1] pry(main)* def when?
[1] pry(main)* 1995
[1] pry(main)* end
[1] pry(main)*
[1] pry(main)* def where?
[1] pry(main)* "Japan"
[1] pry(main)* end
[1] pry(main)*
[1] pry(main)* def by?
[1] pry(main)* "Matz"
[1] pry(main)* end
[1] pry(main)*
[1] pry(main)* end
=> :by?
[2] pry(main)> lesson = History.new
=> #<History:0x007fcdb306a3f0>
[3] pry(main)> lesson.when?
=> 1995
[4] pry(main)> lesson.where?
=> "Japan"
[5] pry(main)> lesson.by?
=> "Matz"
$ gem install pry
Fetching: pry-0.10.0.gem (100%)
Successfully installed pry-0.10.0
1 gem installed
!
$ pry
[1] pry(main)> 1 + 1
=> 2
$ pry
[1] pry(main)> 1.is_a?( Object ) && 1.is_a?( Fixnum )
=> true
!
[2] pry(main)> true.is_a?( Object ) && true.is_a?( TrueClass )
=> true
!
[3] pry(main)> nil.is_a?( Object ) && nil.is_a?( NilClass )
=> true
!
[4] pry(main)> "PTA".is_a?( Object ) && "PTA".is_a?( String )
=> true
$ pry
[1] pry(main)> 1.object_id == 1.object_id
=> true
!
[2] pry(main)> "PTA".object_id == "PTA".object_id
=> false
$ pry
[1] pry(main)> require 'nokogiri'
=> true
!
[2] pry(main)> require 'open-uri'
=> true
!
[3] pry(main)> doc = Nokogiri::HTML(open("http://en.wikipedia.org/wiki/
Ruby_(programming_language)"))
=> #(Document:0x3fe11d253454…)
!
[4] pry(main)> paragraph = doc.search('//*[@id="mw-content-text"]/p[23]').text
=> "Matsumoto has said that Ruby is designed for…”
!
[5] pry(main)> paragraph =~ /"([^"]*)/
=> 194
!
[6] pry(main)> $1
=> "I hope to see Ruby help every programmer in the world to be productive, and
to enjoy programming, and to be happy. That is the primary purpose of Ruby
language."
The Main Runtimes
The Interesting Runtimes
The Mobile Runtimes
required “reading”
http://mislav.uniqpath.com/poignant-guide/
3,239,798,210
downloads
of 77,207 gems cut since July 2009
require “*”
• State of the art dependency
management
• Authors now building the same tool for
the Rust programming language
require “sinatra”
get "/" do	
"<h1>Hello PTA</h1>"	
end	
• Rack
• Sinatra
• Padrino
• Rails
require “adhearsion”
class MyController < Adhearsion::CallController	
def run	
answer	
resp = ask "How many woodchucks?", :limit => 1	
say "You said #{resp}. That's obviously wrong!"	
end	
end	
!
# adhearsion.com
require “artoo”
connection :sphero, adaptor: :sphero, port: '4560'	
device :sphero, driver: :sphero	
!
work do	
every(3.seconds) do	
puts "Rolling..."	
sphero.roll 60, rand(360)	
end	
end	
!
# artoo.io
require “relevance”
Tools of the
trade
require “simple_form”
simple_form_for @user do |f|	
= f.input :email	
= f.input :password	
= f.submit "Login"	
• Rapid form
building
• Highlight errors
• Wrappers for
Bootstrap
require “better_errors”
require “reform”
class SongForm < Reform::Form	
property :title	
property :length	
!
validates :title, presence: true	
validates :length, numericality: true	
end	
!
class SongsController	
def new	
@form = SongForm.new(Song.new)	
end
require
“active_interaction”
• Model business processes as simple
objects.
• Avoid the callback hell that so easily
happens in models
http://iwanttolearnruby.com/
trap("TERM") do	
puts "WIN"	
end	
!
exit
Why ruby

Más contenido relacionado

Destacado

Destacado (7)

Broken Dreams & Shattered Promises
Broken Dreams & Shattered PromisesBroken Dreams & Shattered Promises
Broken Dreams & Shattered Promises
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset Pipeline
 
Ruote: A Ruby workflow engine
Ruote:  A Ruby workflow engineRuote:  A Ruby workflow engine
Ruote: A Ruby workflow engine
 
Ruote in 20 Minutes
Ruote in 20 MinutesRuote in 20 Minutes
Ruote in 20 Minutes
 
Daemon Kit - RubyKaigi 2009
Daemon Kit - RubyKaigi 2009Daemon Kit - RubyKaigi 2009
Daemon Kit - RubyKaigi 2009
 
Reusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/RhinoReusing your frontend JS on the server with V8/Rhino
Reusing your frontend JS on the server with V8/Rhino
 
Ruote
RuoteRuote
Ruote
 

Similar a Why ruby

Ruby 入門 第一次就上手
Ruby 入門 第一次就上手Ruby 入門 第一次就上手
Ruby 入門 第一次就上手
Wen-Tien Chang
 
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
edthix
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
Nobuo Danjou
 

Similar a Why ruby (20)

Ruby is an Acceptable Lisp
Ruby is an Acceptable LispRuby is an Acceptable Lisp
Ruby is an Acceptable Lisp
 
Ruby 入門 第一次就上手
Ruby 入門 第一次就上手Ruby 入門 第一次就上手
Ruby 入門 第一次就上手
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
 
2015 bioinformatics python_io_wim_vancriekinge
2015 bioinformatics python_io_wim_vancriekinge2015 bioinformatics python_io_wim_vancriekinge
2015 bioinformatics python_io_wim_vancriekinge
 
Introduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on RailsIntroduction to Ruby, Rails, and Ruby on Rails
Introduction to Ruby, Rails, and Ruby on Rails
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming Language
 
Ruby for Java Developers
Ruby for Java DevelopersRuby for Java Developers
Ruby for Java Developers
 
Pa++ern - esoteric language for embroidery (2009)
Pa++ern - esoteric language for embroidery  (2009)Pa++ern - esoteric language for embroidery  (2009)
Pa++ern - esoteric language for embroidery (2009)
 
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with LuaKamailioworld 2018 - Modular and test driven SIP Routing with Lua
Kamailioworld 2018 - Modular and test driven SIP Routing with Lua
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Linux Shell Scripting Craftsmanship
Linux Shell Scripting CraftsmanshipLinux Shell Scripting Craftsmanship
Linux Shell Scripting Craftsmanship
 
Plan 9のお話
Plan 9のお話Plan 9のお話
Plan 9のお話
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
Perl Moderno
Perl ModernoPerl Moderno
Perl Moderno
 
Reasons To Love Ruby
Reasons To Love RubyReasons To Love Ruby
Reasons To Love Ruby
 
Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1Introduction to Game programming with PyGame Part 1
Introduction to Game programming with PyGame Part 1
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Lemme tell ya 'bout Ruby
Lemme tell ya 'bout RubyLemme tell ya 'bout Ruby
Lemme tell ya 'bout Ruby
 

Último

Último (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Motion for AI: Creating Empathy in Technology
Motion for AI: Creating Empathy in TechnologyMotion for AI: Creating Empathy in Technology
Motion for AI: Creating Empathy in Technology
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.Enterprise Security Monitoring, And Log Management.
Enterprise Security Monitoring, And Log Management.
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Intelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdfIntelligent Gimbal FINAL PAPER Engineering.pdf
Intelligent Gimbal FINAL PAPER Engineering.pdf
 

Why ruby