SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Padrino is Agnostic
RubyHiroba 2013
Takeshi Yabe / @tyabe
account: {
twitter: "@tyabe",
github: "tyabe" },
name: "Takeshi Yabe",
organization : [
"Shibuya.rb",
"Yokohama.rb",
"RubyKajaTeam" ]
About Me?
It’s Me!
Padrino Contributer
What is Padrino?
Web MVC framework
built on Sinatra
“Structured Sinatra”
require 'sinatra/base'
 
class App < Sinatra::Base
get '/' do
'Hello world!'
end
end
 
App.run! host: 'localhost', port: 3000
$ gem install sinatra
$ vim app.rb
$ ruby app.rb
$ curl http://localhost:3000/
Example Sinatra App
Padrino App Structure
$ gem install padrino
$ padrino g project sample_project
Padrino App Structure
sample_project
!"" Gemfile
!"" Rakefile
!"" app
#   !"" app.rb
#   !"" controllers
#   !"" helpers
#   $"" views
#   $"" layouts
!"" config
#   !"" apps.rb
#   !"" boot.rb
#   $"" database.rb
!"" config.ru
!"" public
#   !"" favicon.ico
#   !"" images
#   !"" javascripts
#   $"" stylesheets
$"" tmp
Example Padrino App
module SampleProject
class App < Padrino::Application
register Padrino::Rendering
register Padrino::Helpers
enable :sessions
 
get '/' do
'Hello world!'
end
end
end
$ vim app/app.rb
$ padrino s
$ curl http://localhost:3000/
class App < Sinatra::Base
get '/' do
'Hello world!'
end
end
Sinatra
Comparison App File
Padrino
module SampleProject
class App < Padrino::Application
register Padrino::Rendering
register Padrino::Helpers
enable :sessions
 
get '/' do
'Hello world!'
end
end
end
Philosophy
Simple to use
Simple to hack
Developer freedom
Coding should be fun!
Only have a very few layer
between We and the Padrino.
Major Feature
Agnostic
Generators
Mounting Multiple Apps
Admin Interface
... and much more
Major Feature
Agnostic
Generators
Mounting Multiple Apps
Admin Interface
... and much more
What does Agnostic mean?
Be not bound by specific thought.
What does Agnostic mean?
Caution!
this might lead to misunderstanding.
my poor english has limitations... :-c
Agnostic
DatabaseWrapper
- ActiveRecord
- MiniRecord
- DataMapper
- Sequel
- MongoMapper
- Mongoid
- Mongomatic
- Ohm
- Coachrest
- Ripple
Renderer
- Haml
- Erb
- Liquid
- Slim
Javascripts
- JQuery
- Prototype
- Rightjs
- MooTools
- ExtCore
- Dojo
Stylesheets
- Less
- Sass
- Compass
- Scss
And tests, mocks
Usage
$ padrino g project [name] [options]
Options:
-d, [--orm=ORM] # Default: none
-t, [--test=TEST] # Default: none
-m, [--mock=MOCK] # Default: none
-s, [--script=SCRIPT] # Default: none
-e, [--renderer=RENDERER] # Default: slim
-c, [--stylesheet=STYLESHEET] # Default: none
Specify the options in the project generator
example
Like a Rails(with RSpec)
$ padrino g project example 
-d activerecord 
-t rspec 
-s jquery 
-e erb 
-c scss
Very Simple Project
$ padrino g project example 
-d minirecord 
-t minitest 
-s rightjs 
-e slim 
-c compass
Javascript Lover(?)
$ padrino g project example 
-d mongoid 
-t riot 
-s mootools 
-e liquid 
-c less
Suppin
$ padrino g project example 
-e none
You can use all of the innate skills of any
and all already mastered modules!
Let's Enjoy Padrino !
Thanks
@tyabe
More Info
Adding New Components
http://www.padrinorb.com/guides/adding-new-components

Más contenido relacionado

La actualidad más candente

Auto tools
Auto toolsAuto tools
Auto tools
祺 周
 
Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
lokku
 
An Impromptu Introduction to HTML5 Canvas
An Impromptu Introduction to HTML5 CanvasAn Impromptu Introduction to HTML5 Canvas
An Impromptu Introduction to HTML5 Canvas
Ben Hodgson
 
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e SinatraRaspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
Duke Khaos
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with Moose
Dave Cross
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門
Yusuke Wada
 

La actualidad más candente (17)

How to eat Cucmber
How to eat CucmberHow to eat Cucmber
How to eat Cucmber
 
Auto tools
Auto toolsAuto tools
Auto tools
 
Ansible -new kid in configuration management world
Ansible -new kid in configuration management worldAnsible -new kid in configuration management world
Ansible -new kid in configuration management world
 
Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
 
ES2015のカバレッジ計測
ES2015のカバレッジ計測ES2015のカバレッジ計測
ES2015のカバレッジ計測
 
An Impromptu Introduction to HTML5 Canvas
An Impromptu Introduction to HTML5 CanvasAn Impromptu Introduction to HTML5 Canvas
An Impromptu Introduction to HTML5 Canvas
 
Raspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e SinatraRaspagem da dados com Hpricot e Sinatra
Raspagem da dados com Hpricot e Sinatra
 
Damage Control
Damage ControlDamage Control
Damage Control
 
Your JavaScript Library
Your JavaScript LibraryYour JavaScript Library
Your JavaScript Library
 
Evolving Software with Moose
Evolving Software with MooseEvolving Software with Moose
Evolving Software with Moose
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 
WordPress 3.4 Theme Customizer
WordPress 3.4 Theme CustomizerWordPress 3.4 Theme Customizer
WordPress 3.4 Theme Customizer
 
Sinatra slideshare
Sinatra slideshareSinatra slideshare
Sinatra slideshare
 
RSpec. Part 1
RSpec. Part 1RSpec. Part 1
RSpec. Part 1
 
PerlでWeb API入門
PerlでWeb API入門PerlでWeb API入門
PerlでWeb API入門
 
Shortcodes In-Depth
Shortcodes In-DepthShortcodes In-Depth
Shortcodes In-Depth
 
Web Components Revolution
Web Components RevolutionWeb Components Revolution
Web Components Revolution
 

Destacado

Responsive Design - ISCTE
Responsive Design - ISCTEResponsive Design - ISCTE
Responsive Design - ISCTE
fidibiko
 
Childhood obesity-Proposal
Childhood obesity-Proposal Childhood obesity-Proposal
Childhood obesity-Proposal
jtran888
 

Destacado (14)

Actividad de aprendizaje 1.1 Caren Taipe tics_internet_estado del arte
Actividad de aprendizaje 1.1 Caren Taipe tics_internet_estado del arteActividad de aprendizaje 1.1 Caren Taipe tics_internet_estado del arte
Actividad de aprendizaje 1.1 Caren Taipe tics_internet_estado del arte
 
Yokohama.rb monthly meetup #50
Yokohama.rb monthly meetup #50Yokohama.rb monthly meetup #50
Yokohama.rb monthly meetup #50
 
デブサミ2013 オフィシャルコミュニティLT by Shibuya.rb
デブサミ2013 オフィシャルコミュニティLT by Shibuya.rbデブサミ2013 オフィシャルコミュニティLT by Shibuya.rb
デブサミ2013 オフィシャルコミュニティLT by Shibuya.rb
 
Edaraty may-2013 - copy
Edaraty may-2013 - copyEdaraty may-2013 - copy
Edaraty may-2013 - copy
 
Cádiz
CádizCádiz
Cádiz
 
Padrino decorator
Padrino decoratorPadrino decorator
Padrino decorator
 
Responsive Design - ISCTE
Responsive Design - ISCTEResponsive Design - ISCTE
Responsive Design - ISCTE
 
RubyKaja 2012
RubyKaja 2012RubyKaja 2012
RubyKaja 2012
 
RubyKaja 2013
RubyKaja 2013RubyKaja 2013
RubyKaja 2013
 
Remarkable womenseries 11september2011a
Remarkable womenseries 11september2011aRemarkable womenseries 11september2011a
Remarkable womenseries 11september2011a
 
Ruby kajaはじめてます
Ruby kajaはじめてますRuby kajaはじめてます
Ruby kajaはじめてます
 
Writing
WritingWriting
Writing
 
DR B R Ambedkar
DR B R AmbedkarDR B R Ambedkar
DR B R Ambedkar
 
Childhood obesity-Proposal
Childhood obesity-Proposal Childhood obesity-Proposal
Childhood obesity-Proposal
 

Similar a Padrino is agnostic

Socket applications
Socket applicationsSocket applications
Socket applications
João Moura
 
Sinatraonpassenger 090419090519 Phpapp01
Sinatraonpassenger 090419090519 Phpapp01Sinatraonpassenger 090419090519 Phpapp01
Sinatraonpassenger 090419090519 Phpapp01
guestcaceba
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
Jacob Kaplan-Moss
 

Similar a Padrino is agnostic (20)

Socket applications
Socket applicationsSocket applications
Socket applications
 
Padrino - the Godfather of Sinatra
Padrino - the Godfather of SinatraPadrino - the Godfather of Sinatra
Padrino - the Godfather of Sinatra
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!Rapid Prototyping FTW!!!
Rapid Prototyping FTW!!!
 
Metasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCUMetasepi team meeting #20: Start! ATS programming on MCU
Metasepi team meeting #20: Start! ATS programming on MCU
 
Introduce Django
Introduce DjangoIntroduce Django
Introduce Django
 
Intro To Django
Intro To DjangoIntro To Django
Intro To Django
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
PSGI/Plack OSDC.TW
PSGI/Plack OSDC.TWPSGI/Plack OSDC.TW
PSGI/Plack OSDC.TW
 
Sinatraonpassenger 090419090519 Phpapp01
Sinatraonpassenger 090419090519 Phpapp01Sinatraonpassenger 090419090519 Phpapp01
Sinatraonpassenger 090419090519 Phpapp01
 
Mojolicious lite
Mojolicious liteMojolicious lite
Mojolicious lite
 
Using Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in RubyUsing Sinatra to Build REST APIs in Ruby
Using Sinatra to Build REST APIs in Ruby
 
The Best (and Worst) of Django
The Best (and Worst) of DjangoThe Best (and Worst) of Django
The Best (and Worst) of Django
 
Sinatra
SinatraSinatra
Sinatra
 
Does my DIV look big in this?
Does my DIV look big in this?Does my DIV look big in this?
Does my DIV look big in this?
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Sinatra and JSONQuery Web Service
Sinatra and JSONQuery Web ServiceSinatra and JSONQuery Web Service
Sinatra and JSONQuery Web Service
 
Sprockets
SprocketsSprockets
Sprockets
 
Optimizing AngularJS Application
Optimizing AngularJS ApplicationOptimizing AngularJS Application
Optimizing AngularJS Application
 
Modern Perl
Modern PerlModern Perl
Modern Perl
 

Padrino is agnostic

  • 1. Padrino is Agnostic RubyHiroba 2013 Takeshi Yabe / @tyabe
  • 2. account: { twitter: "@tyabe", github: "tyabe" }, name: "Takeshi Yabe", organization : [ "Shibuya.rb", "Yokohama.rb", "RubyKajaTeam" ] About Me?
  • 4. What is Padrino? Web MVC framework built on Sinatra “Structured Sinatra”
  • 5. require 'sinatra/base'   class App < Sinatra::Base get '/' do 'Hello world!' end end   App.run! host: 'localhost', port: 3000 $ gem install sinatra $ vim app.rb $ ruby app.rb $ curl http://localhost:3000/ Example Sinatra App
  • 6. Padrino App Structure $ gem install padrino $ padrino g project sample_project
  • 7. Padrino App Structure sample_project !"" Gemfile !"" Rakefile !"" app #   !"" app.rb #   !"" controllers #   !"" helpers #   $"" views #   $"" layouts !"" config #   !"" apps.rb #   !"" boot.rb #   $"" database.rb !"" config.ru !"" public #   !"" favicon.ico #   !"" images #   !"" javascripts #   $"" stylesheets $"" tmp
  • 8. Example Padrino App module SampleProject class App < Padrino::Application register Padrino::Rendering register Padrino::Helpers enable :sessions   get '/' do 'Hello world!' end end end $ vim app/app.rb $ padrino s $ curl http://localhost:3000/
  • 9. class App < Sinatra::Base get '/' do 'Hello world!' end end Sinatra Comparison App File Padrino module SampleProject class App < Padrino::Application register Padrino::Rendering register Padrino::Helpers enable :sessions   get '/' do 'Hello world!' end end end
  • 10. Philosophy Simple to use Simple to hack Developer freedom Coding should be fun! Only have a very few layer between We and the Padrino.
  • 11. Major Feature Agnostic Generators Mounting Multiple Apps Admin Interface ... and much more
  • 12. Major Feature Agnostic Generators Mounting Multiple Apps Admin Interface ... and much more
  • 14. Be not bound by specific thought. What does Agnostic mean? Caution! this might lead to misunderstanding. my poor english has limitations... :-c
  • 15. Agnostic DatabaseWrapper - ActiveRecord - MiniRecord - DataMapper - Sequel - MongoMapper - Mongoid - Mongomatic - Ohm - Coachrest - Ripple Renderer - Haml - Erb - Liquid - Slim Javascripts - JQuery - Prototype - Rightjs - MooTools - ExtCore - Dojo Stylesheets - Less - Sass - Compass - Scss And tests, mocks
  • 16. Usage
  • 17. $ padrino g project [name] [options] Options: -d, [--orm=ORM] # Default: none -t, [--test=TEST] # Default: none -m, [--mock=MOCK] # Default: none -s, [--script=SCRIPT] # Default: none -e, [--renderer=RENDERER] # Default: slim -c, [--stylesheet=STYLESHEET] # Default: none Specify the options in the project generator
  • 19. Like a Rails(with RSpec) $ padrino g project example -d activerecord -t rspec -s jquery -e erb -c scss
  • 20. Very Simple Project $ padrino g project example -d minirecord -t minitest -s rightjs -e slim -c compass
  • 21. Javascript Lover(?) $ padrino g project example -d mongoid -t riot -s mootools -e liquid -c less
  • 22. Suppin $ padrino g project example -e none You can use all of the innate skills of any and all already mastered modules!
  • 23. Let's Enjoy Padrino ! Thanks @tyabe More Info Adding New Components http://www.padrinorb.com/guides/adding-new-components