SlideShare a Scribd company 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"
Why ruby
$ 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."
Why ruby
The Main Runtimes
The Interesting Runtimes
The Mobile Runtimes
Why ruby
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
Why ruby
require “relevance”
Tools of the
trade
Why ruby
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
Why ruby
http://iwanttolearnruby.com/
trap("TERM") do	
puts "WIN"	
end	
!
exit
Why ruby

More Related Content

PDF
Python と Docker で mypy Playground を開発した話
PDF
The Total IDE
PDF
ConvergeSE: We Will All Be Game Developers
PPT
Pete Heroku Waza 2013 Ruby 2.0
PDF
Shell basic
KEY
Ruby v cpp_preso
PDF
Shifting gears with Composer
KEY
Heroku in Real Life
Python と Docker で mypy Playground を開発した話
The Total IDE
ConvergeSE: We Will All Be Game Developers
Pete Heroku Waza 2013 Ruby 2.0
Shell basic
Ruby v cpp_preso
Shifting gears with Composer
Heroku in Real Life

Viewers also liked (7)

PDF
Broken Dreams & Shattered Promises
PDF
Unleashing the Rails Asset Pipeline
KEY
Ruote: A Ruby workflow engine
ODP
Ruote in 20 Minutes
PDF
Daemon Kit - RubyKaigi 2009
PDF
Reusing your frontend JS on the server with V8/Rhino
KEY
Broken Dreams & Shattered Promises
Unleashing the Rails Asset Pipeline
Ruote: A Ruby workflow engine
Ruote in 20 Minutes
Daemon Kit - RubyKaigi 2009
Reusing your frontend JS on the server with V8/Rhino
Ad

Similar to Why ruby (20)

PDF
Ruby 入門 第一次就上手
KEY
Hidden treasures of Ruby
KEY
Introducing Ruby
PDF
Introduction to Ruby
PPTX
Ruby from zero to hero
DOCX
Ruby Programming
PDF
Ruby an overall approach
PDF
Introduction to Ruby & Ruby on Rails
KEY
jRuby: The best of both worlds
PDF
Ruby Presentation
PPS
Ruby 1.9.3 Basic Introduction
PDF
Arulalan Ruby An Intro
PPTX
Code for Startup MVP (Ruby on Rails) Session 2
PPTX
Ruby Basics
PPT
Rubyforjavaprogrammers 1210167973516759-9
PPT
Rubyforjavaprogrammers 1210167973516759-9
KEY
PDF
Ruby and Rails by Example (GeekCamp edition)
ODP
Ruby Basics by Rafiq
KEY
Introduction to Ruby
Ruby 入門 第一次就上手
Hidden treasures of Ruby
Introducing Ruby
Introduction to Ruby
Ruby from zero to hero
Ruby Programming
Ruby an overall approach
Introduction to Ruby & Ruby on Rails
jRuby: The best of both worlds
Ruby Presentation
Ruby 1.9.3 Basic Introduction
Arulalan Ruby An Intro
Code for Startup MVP (Ruby on Rails) Session 2
Ruby Basics
Rubyforjavaprogrammers 1210167973516759-9
Rubyforjavaprogrammers 1210167973516759-9
Ruby and Rails by Example (GeekCamp edition)
Ruby Basics by Rafiq
Introduction to Ruby
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Approach and Philosophy of On baking technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Big Data Technologies - Introduction.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
cuic standard and advanced reporting.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
Encapsulation_ Review paper, used for researhc scholars
Approach and Philosophy of On baking technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Review of recent advances in non-invasive hemoglobin estimation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
Empathic Computing: Creating Shared Understanding
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx

Why ruby