SlideShare a Scribd company logo
1 of 70
Download to read offline
Padrino
the Godfather of Sinatra
Padrino
the Godfather of Sinatra


          ?
Why?
Quiz
SASS ?
SASS
Syntactically Awesome Stylesheets
SASS
CoffeeScript ?
CoffeeScript
sprockets ?
sprockets
Rack-based asset packaging
Too complicated
Simple is GOOD
Data
services
 (mobile , API)
       +
  DB backend
Data flow

 HTTP request

process by RUBY
  HTTP response
Rack
Rack = HTTP model

           env {}

    def ca# ( env )
[ status , { headers } , [body] ]
Rack application
Rack

Webservers

RACK app
Frameworks
Rack tools
Rack tools
Rack tools
config.ru
Rack is GOOD !
• Renee
• Presto
• Hebo
• RESTrack
TOO CROWDED
YARF
YARF
Yet Another Rack Framework
https://github.com/zh/yarf
Sinatra
Sinatra
Sinatra is REAL !


http://www.sinatrarb.com/wild.html
But...
my own
link_to :confirm
Missing pieces

• Generators - Gemfile, config.ru etc.
• Helpers - link_to(), image_tag()
• Mailer
• Admin interface - a.l.a Django
Too simple is BAD
Padrino
gem install padrino
YARF
Yet Another Rack Framework
Padrino = Sinatra++
Container (   )
Modular (   )
$ padrino ...
Generators
$ padrino g project myproj
$ padrino g project myproj
 -s jquery -c sass -e erb
$ padrino g project myproj
 -s jquery -c sass -e erb
 -d activerecord -a sqlite
$ padrino g project myproj
 -s jquery -c sass -e erb
 -d activerecord -a sqlite
 -t rspec -m mocha
Agnostic (           )
Component    Default    Alias       Options
                                activerecord
  ORM         none       -d
                                 , mongoid

 Renderer     haml       -e         erb,slim

                                   jquery,
  Script      none       -s
                                 prototype
                                 sass , less ,
  Style       none       -c
                                  compass

   Test       none       -t     rspec, bacon
Many generators

• Project generator
• Controller generator
• Model generator
• Migration generator
• Admin generator
padrino g admin
Multiple
  Apps
by design
Interesting files


• Gemfile - bundle install
• config/apps.rb - Padrino.mount( ... ).to( ... )
• config/boot.rb - logger , locale
• app/app.rb - core application install
Helpers


• Tags:   input_tag :text, :class => ‘demo’

• Assets: stylesheet_link_tag ‘layout’
• Format: escape_html( ) , truncate( )
• Links: link_to ... , :confirm => ‘Are you sure?’
Mailer

• Configure: app/app.rb
• Generate: $ pd g mailer Sample register
• [views]/mailers/sample/register.plain.erb
• Deliver: deliver(:sample, :register, “foo@bar”)
• Tests: set :delivery_method, :test
Simple mailer (   )
Multipart

Attachments
Dev Friendly


• Reloader - disable :reload to stop it
• Auto load paths - lib/*
• $ padrino gen | start | stop | console | rake
Friendly



•             - http://jp.padrino.com/

• @udzura ( Uchio Kondo )
Padrino inside Sinatra
Helpers




Routing
Mailer in Sinatra
I18n
Padrino is GOOD !
Questions?

More Related Content

What's hot

Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
Avi Kedar
 
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
jduff
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
jduff
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
MongoDB
 

What's hot (20)

RESTful Rails2
RESTful Rails2RESTful Rails2
RESTful Rails2
 
Web Development using Ruby on Rails
Web Development using Ruby on RailsWeb Development using Ruby on Rails
Web Development using Ruby on Rails
 
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
 
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
 
Project Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G SProject Fedena and Why Ruby on Rails - ArvindArvind G S
Project Fedena and Why Ruby on Rails - ArvindArvind G S
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
 
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
Frameworks and webcomponents
Frameworks and webcomponentsFrameworks and webcomponents
Frameworks and webcomponents
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
 
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
 
React.js for Rails Developers
React.js for Rails DevelopersReact.js for Rails Developers
React.js for Rails Developers
 
Simplify your integrations with Apache Camel
Simplify your integrations with Apache CamelSimplify your integrations with Apache Camel
Simplify your integrations with Apache Camel
 
Using Apache Camel as AKKA
Using Apache Camel as AKKAUsing Apache Camel as AKKA
Using Apache Camel as AKKA
 

Viewers also liked (7)

Introduction to padrino
Introduction to padrinoIntroduction to padrino
Introduction to padrino
 
Colors
ColorsColors
Colors
 
Intro to Merb
Intro to MerbIntro to Merb
Intro to Merb
 
11 frases de la película El Padrino
11 frases de la película El Padrino11 frases de la película El Padrino
11 frases de la película El Padrino
 
Presentacion padrino tutor
Presentacion padrino tutorPresentacion padrino tutor
Presentacion padrino tutor
 
El Padrino
El PadrinoEl Padrino
El Padrino
 
"El Padrino", Coppola y "Uno de los Nuestros", Scorsese
"El Padrino", Coppola y "Uno de los Nuestros", Scorsese "El Padrino", Coppola y "Uno de los Nuestros", Scorsese
"El Padrino", Coppola y "Uno de los Nuestros", Scorsese
 

Similar to Padrino - the Godfather of Sinatra

Socket applications
Socket applicationsSocket applications
Socket applications
João Moura
 

Similar to Padrino - the Godfather of Sinatra (20)

RSpec on Rails Tutorial
RSpec on Rails TutorialRSpec on Rails Tutorial
RSpec on Rails Tutorial
 
Wider than rails
Wider than railsWider than rails
Wider than rails
 
Usecase examples of Packer
Usecase examples of Packer Usecase examples of Packer
Usecase examples of Packer
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
FP - Découverte de Play Framework Scala
FP - Découverte de Play Framework ScalaFP - Découverte de Play Framework Scala
FP - Découverte de Play Framework Scala
 
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
 
Padrino is agnostic
Padrino is agnosticPadrino is agnostic
Padrino is agnostic
 
Launch Arguments & NSUserDefaults by Franck Lefebvre
Launch Arguments & NSUserDefaults by Franck LefebvreLaunch Arguments & NSUserDefaults by Franck Lefebvre
Launch Arguments & NSUserDefaults by Franck Lefebvre
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角以Vue開發電子商務網站
架構與眉角
以Vue開發電子商務網站
架構與眉角
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
How to eat Cucmber
How to eat CucmberHow to eat Cucmber
How to eat Cucmber
 
Asset Pipeline in Ruby on Rails
Asset Pipeline in Ruby on RailsAsset Pipeline in Ruby on Rails
Asset Pipeline in Ruby on Rails
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with ChefAchieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with Chef
 
Ruby w/o Rails (Олександр Сімонов)
Ruby w/o Rails (Олександр Сімонов)Ruby w/o Rails (Олександр Сімонов)
Ruby w/o Rails (Олександр Сімонов)
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Adding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of TricksAdding Riak to your NoSQL Bag of Tricks
Adding Riak to your NoSQL Bag of Tricks
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Deploy like a pro!
Deploy like a pro!Deploy like a pro!
Deploy like a pro!
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 

More from Stoyan Zhekov

Deployment on Heroku
Deployment on HerokuDeployment on Heroku
Deployment on Heroku
Stoyan Zhekov
 
Websockets with ruby
Websockets with rubyWebsockets with ruby
Websockets with ruby
Stoyan Zhekov
 
Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)
Stoyan Zhekov
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
Stoyan Zhekov
 

More from Stoyan Zhekov (18)

Multirotors
MultirotorsMultirotors
Multirotors
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
Sequel
SequelSequel
Sequel
 
Deployment on Heroku
Deployment on HerokuDeployment on Heroku
Deployment on Heroku
 
Push the web with HTML5
Push the web with HTML5Push the web with HTML5
Push the web with HTML5
 
Foreman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple componentsForeman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple components
 
Social Network for spare parts
Social Network for spare partsSocial Network for spare parts
Social Network for spare parts
 
Using XMPP Presence stanzas for real-time parking information
Using XMPP Presence stanzas for real-time parking informationUsing XMPP Presence stanzas for real-time parking information
Using XMPP Presence stanzas for real-time parking information
 
Ruby cooking
Ruby cookingRuby cooking
Ruby cooking
 
Websockets with ruby
Websockets with rubyWebsockets with ruby
Websockets with ruby
 
EventMachine
EventMachineEventMachine
EventMachine
 
Webhooks - glue for the web (japanese)
Webhooks - glue for the web (japanese)Webhooks - glue for the web (japanese)
Webhooks - glue for the web (japanese)
 
Webhooks - glue for the web
Webhooks - glue for the webWebhooks - glue for the web
Webhooks - glue for the web
 
Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)Microblogging via XMPP (japanese)
Microblogging via XMPP (japanese)
 
Microblogging via XMPP
Microblogging via XMPPMicroblogging via XMPP
Microblogging via XMPP
 
Ruby off Rails (english)
Ruby off Rails (english)Ruby off Rails (english)
Ruby off Rails (english)
 
Ruby off Rails (japanese)
Ruby off Rails (japanese)Ruby off Rails (japanese)
Ruby off Rails (japanese)
 
Rails Deployment with NginX
Rails Deployment with NginXRails Deployment with NginX
Rails Deployment with NginX
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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...
 
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
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
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
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Padrino - the Godfather of Sinatra