SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 

Why ruby