Weitere ähnliche Inhalte Ähnlich wie Rs on Rails 2011 (20) Mehr von Fabio Akita (20) Kürzlich hochgeladen (20) Rs on Rails 20115. 1 ano atrás 4 pessoas
20 pessoas
Hoje
+ USD 1 Milhão/ano
6. 1 ano atrás 4 pessoas
20 pessoas
Hoje
+ USD 1 Milhão/ano
7. 1 ano atrás 4 pessoas
20 pessoas
Hoje
+ USD 1 Milhão/ano
10. Anos 80 Fim Anos 90 Século XXI
Perl
Basic Pascal Java
C PHP
dBase Delphi Python ABAP
III
Ruby
Clipper
ASP .NET
ObjC
VB6
15. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
16. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
17. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
18. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
19. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
20. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
21. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
22. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
23. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
24. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
25. Request
Web Server
Rack Middlewares
Routes
Controller
View Model
26. Response Request
Web Server
Rack Middlewares
Routes
Controller
View Model
27. Response Request
Web Server
Rack Middlewares
Application
Server Rack:
Routes
Unicorn,
Controller
Passenger
View Model
28. Web Server:
Response Request NginX
Apache
Web Server
Rack Middlewares
Application
Server Rack:
Routes
Unicorn,
Controller
Passenger
View Model
29. NginX, Apache
Reverse Proxy
Unicorn, Passenger
ActiveRecord/DataMapper
RDBMS/NoSQL
30. HAProxy
NginX, Apache
Reverse Proxy
Unicorn, Passenger
ActiveRecord/DataMapper
RestClient/Savon
RDBMS/NoSQL
Web Services (REST, SOAP)
31. HAProxy
NginX, Apache
Varnish
Reverse Proxy
Unicorn, Passenger
ActiveRecord/DataMapper
RestClient/Savon
RDBMS/NoSQL
Web Services (REST, SOAP)
32. HAProxy
NginX, Apache
Varnish
Reverse Proxy
Unicorn, Passenger
ActiveRecord/DataMapper
RestClient/Savon
Memcached
RDBMS/NoSQL
Web Services (REST, SOAP)
33. Request Request Request Request Request Request
HTTPD HTTPD HTTPD HTTPD HTTPD HTTPD
Rails Rails Rails Rails Rails Rails
App App App App App App
RDBMS
34. Request Request Request Request Request Request
HTTPD HTTPD HTTPD HTTPD HTTPD HTTPD
Rails Rails Rails Rails Rails Rails
App App App App App App
RDBMS
35. Request Request Request Request Request Request
HTTPD HTTPD HTTPD HTTPD HTTPD HTTPD
Rails Rails Rails Rails Rails Rails
App App App App App App
Mais curto RDBMS
possível!
46. Request Request Request Request Request Request
HTTPD HTTPD HTTPD HTTPD HTTPD HTTPD
Rails Rails Rails Rails Rails Rails
App App App App App App
RDBMS
47. Request Request Request Request Request Request
NginX
Async App
RDBMS
48. Request Request Request Request Request Request
NginX
Async App
“Look Ma!
No Threads!”
RDBMS
49. Request Request Request Request Request Request
NginX
5k ~ 10k
conexões
Async App
“Look Ma!
No Threads!”
RDBMS
50. Request Request Request Request Request Request
NginX
5k ~ 10k
conexões
Conexões
Longas Async App
“Look Ma!
No Threads!”
RDBMS
56. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
57. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
58. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
59. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
60. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
61. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
62. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
63. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
64. EventMachine.run do
conn = { :host => "0.0.0.0", :port => 8080 }
EventMachine::WebSocket.start(conn) do |ws|
ws.onopen do
puts "WebSocket connection open"
# publish message to the client
ws.send "Hello Client"
end
ws.onclose { puts "Connection closed" }
ws.onmessage do |msg|
puts "Recieved message: #{msg}"
ws.send "Pong: #{msg}"
end
end
end
72. require 'pusher'
Pusher.app_id = 'APP_ID'
Pusher.key = 'API_KEY'
Pusher.secret = 'SECRET_KEY'
class ThingsController < ApplicationController
def create
@thing = Thing.new(params[:thing])
if @thing.save
Pusher['MEU_CANAL'].trigger('coisa-criada',
@thing.attributes)
end
end
end
73. require 'pusher'
Pusher.app_id = 'APP_ID'
Pusher.key = 'API_KEY'
Pusher.secret = 'SECRET_KEY'
class ThingsController < ApplicationController
def create
@thing = Thing.new(params[:thing])
if @thing.save
Pusher['MEU_CANAL'].trigger('coisa-criada',
@thing.attributes)
end
end
end
74. require 'pusher'
Pusher.app_id = 'APP_ID'
Pusher.key = 'API_KEY'
Pusher.secret = 'SECRET_KEY'
class ThingsController < ApplicationController
def create
@thing = Thing.new(params[:thing])
if @thing.save
Pusher['MEU_CANAL'].trigger('coisa-criada',
@thing.attributes)
end
end
end
75. require 'pusher'
Pusher.app_id = 'APP_ID'
Pusher.key = 'API_KEY'
Pusher.secret = 'SECRET_KEY'
class ThingsController < ApplicationController
def create
@thing = Thing.new(params[:thing])
if @thing.save
Pusher['MEU_CANAL'].trigger('coisa-criada',
@thing.attributes)
end
end
end
81. IN GOD WE TRUST
Todos os outros devem trazer dados
107. 3.0.9
2011 2.3.12
10
2010 3.0.0
2.2.3
12
2009
2.3.0
2.1.2
4
2.2.0
2.0.5 3
2.1.0
2008 6
2007 Ruby on Rails 2.0.0
108. 3.0.9
2011 2.3.12
2010 3.0.0
2.2.3
2009
2.1.2
2.3.0
34
2.2.0 Versões!
2.0.5
2.1.0
2008
2007 Ruby on Rails 2.0.0
110. Request
Web Server
Rails
App
/public/stylesheets
111. Request
Web Server
Arquivos
Estáticos Rails
App
/public/stylesheets
113. Variáveis
$blue: #3bbfce;
$margin: 16px; /* CSS */
.content-navigation { .content-navigation {
border-color: $blue; border-color: #3bbfce;
color: color: #2b9eab;
darken($blue, 9%); }
}
.border {
.border { padding: 8px;
padding: $margin / 2; margin: 8px;
margin: $margin / 2; border-color: #3bbfce;
border-color: $blue; }
}
114. Nesting
table.hl { /* CSS */
margin: 2em 0;
td.ln { table.hl {
text-align: right; margin: 2em 0;
} }
} table.hl td.ln {
text-align: right;
li { }
font: {
family: serif; li {
weight: bold; font-family: serif;
size: 1.2em; font-weight: bold;
} font-size: 1.2em;
} }
115. Mixins
@mixin table-base {
th {
/* CSS */
text-align: center;
font-weight: bold;
#data {
}
td, th {padding: 2px} float: left;
} margin-left: 10px;
}
@mixin left($dist) { #data th {
float: left; text-align: center;
margin-left: $dist; font-weight: bold;
}
}
#data td, #data th {
#data {
@include left(10px); padding: 2px;
@include table-base; }
}
116. Selector Inheritance
/* CSS */
.error {
.error, .badError {
border: 1px #f00;
border: 1px #f00;
background: #fdd;
background: #fdd;
}
}
.error.intrusion {
font-size: 1.3em;
.error.intrusion,
font-weight: bold;
.badError.intrusion {
}
font-size: 1.3em;
font-weight: bold;
.badError {
}
@extend .error;
border-width: 3px;
.badError {
}
border-width: 3px;
}
118. class Animal
constructor: (@name) ->
move: (meters) ->
alert @name + " moved " + meters + "m."
class Snake extends Animal
move: ->
alert "Slithering..."
super 5
class Horse extends Animal
move: ->
alert "Galloping..."
super 45
sam = new Snake "Sammy the Python"
tom = new Horse "Tommy the Palomino"
sam.move()
tom.move()
119. var Animal, Horse, Snake, sam, tom;
var __hasProp = Object.prototype.hasOwnProperty,
__extends = function(child, parent) {
for (var key in parent) { if (__hasProp.call(parent,
key)) child[key] = parent[key]; }
function ctor() { this.constructor = child; }
ctor.prototype = parent.prototype;
child.prototype = new ctor;
class Animal child.__super__ = parent.prototype;
constructor: (@name) -> return child;
};
Animal = (function() {
move: (meters) -> function Animal(name) {
this.name = name;
alert @name + " moved " + meters + "m." }
Animal.prototype.move = function(meters) {
return alert(this.name + " moved " + meters + "m.");
class Snake extends Animal };
return Animal;
move: -> })();
alert "Slithering..." Snake = (function() {
__extends(Snake, Animal);
super 5 function Snake() {
Snake.__super__.constructor.apply(this, arguments);
}
class Horse extends Animal Snake.prototype.move = function() {
alert("Slithering...");
move: -> return Snake.__super__.move.call(this, 5);
alert "Galloping..." };
return Snake;
super 45 })();
Horse = (function() {
__extends(Horse, Animal);
sam = new Snake "Sammy the Python" function Horse() {
tom = new Horse "Tommy the Palomino" Horse.__super__.constructor.apply(this, arguments);
}
Horse.prototype.move = function() {
alert("Galloping...");
sam.move() return Horse.__super__.move.call(this, 45);
tom.move() };
return Horse;
})();
sam = new Snake("Sammy the Python");
tom = new Horse("Tommy the Palomino");
sam.move();
tom.move();
loadrun
123. Request Request
Web Server Web Server
(Desenvolvimento) (Produção)
Rails
App
/app/assets /public
124. Request Request
Web Server Web Server
(Desenvolvimento) (Produção)
Rails
Sprockets
App
/app/assets /public
125. Request Request
Web Server Web Server
(Desenvolvimento) (Produção)
Rails
Sprockets
App
Tilt
/app/assets /public
126. Request Request
Web Server Web Server
(Desenvolvimento) (Produção)
Rails
Sprockets
App
Tilt
Ugli er
/app/assets /public
127. ENGINE FILE EXTENSIONS REQUIRED LIBRARIES
ERB .erb, .rhtml
none
Interpolated String .str
Erubis .erb, .rhtml, .erubis erubis
Haml .haml haml
Sass .sass
sass
Scss .scss
Less CSS .less less
Builder .builder builder
Liquid .liquid liquid
RDiscount rdiscount
Redcarpet redcarpet
BlueCloth .markdown, .mkd, .md bluecloth
Kramdown kramdown
Maruku maruku
RedCloth .textile redcloth
RDoc .rdoc rdoc
Radius .radius radius
Markaby .mab markaby
Nokogiri .nokogiri nokogiri
CoffeeScript .coffee coffee-script
Creole (Wiki markup) .creole creole
129. jQuery Tamanho Tempo
Original Size 621kb
Google Closure 234kb 6.5s
YUI Compressor 240kb 2.7s
UglifyJS 235kb 1.3s
130. jQuery Tamanho Tempo
Original Size 621kb
Google Closure 234kb 6.5s
YUI Compressor 240kb 2.7s
UglifyJS 235kb 1.3s
131. jQuery Tamanho Tempo
Original Size 621kb
Google Closure 234kb 6.5s
YUI Compressor 240kb 2.7s
UglifyJS 235kb 1.3s
132. jQuery Tamanho Tempo
Original Size 621kb
Google Closure 234kb 6.5s
YUI Compressor 240kb 2.7s
UglifyJS 235kb 1.3s
133. jQuery Tamanho Tempo
Original Size 621kb
Google Closure 234kb 6.5s
YUI Compressor 240kb 2.7s
UglifyJS 235kb 1.3s
143. RubyConf
Brasil
3 e 4 de Novembro
www.rubyconf.com.br
147. Como o cliente Como o Líder de Como o Analista Como o Programador Como o Consultor de
explicou Projeto entendeu desenhou escreveu Negócios descreveu
Como o projeto foi Como Operações Como o cliente foi O que o cliente
Como foi o suporte
documentado instalou cobrado realmente queria
166. cada padrão
(“pattern”)representa nosso melhor
chute agora ... os padrões ainda são
hipóteses, ... e portanto todos são
tentativas, todos livres para evoluir sob
o impacto de novas experiências e
observações."
Christopher Alexander
177. Aqui estão os fatos. Que Aqui está a conclusão.
conclusões podemos Que fatos podemos
chegar com eles? suportar com eles?