Slide 1

Slide 1 text

Padrino is Agnostic RubyHiroba 2013 Takeshi Yabe / @tyabe

Slide 2

Slide 2 text

account: { twitter: "@tyabe", github: "tyabe" }, name: "Takeshi Yabe", organization : [ "Shibuya.rb", "Yokohama.rb", "RubyKajaTeam" ] About Me?

Slide 3

Slide 3 text

It’s Me! Padrino Contributer

Slide 4

Slide 4 text

What is Padrino? Web MVC framework built on Sinatra “Structured Sinatra”

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Padrino App Structure $ gem install padrino $ padrino g project sample_project

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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/

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

Philosophy Simple to use Simple to hack Developer freedom Coding should be fun! Only have a very few layer between We and the Padrino.

Slide 11

Slide 11 text

Major Feature Agnostic Generators Mounting Multiple Apps Admin Interface ... and much more

Slide 12

Slide 12 text

Major Feature Agnostic Generators Mounting Multiple Apps Admin Interface ... and much more

Slide 13

Slide 13 text

What does Agnostic mean?

Slide 14

Slide 14 text

Be not bound by specific thought. What does Agnostic mean? Caution! this might lead to misunderstanding. my poor english has limitations... :-c

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

Usage

Slide 17

Slide 17 text

$ 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

Slide 18

Slide 18 text

example

Slide 19

Slide 19 text

Like a Rails(with RSpec) $ padrino g project example \ -d activerecord \ -t rspec \ -s jquery \ -e erb \ -c scss

Slide 20

Slide 20 text

Very Simple Project $ padrino g project example \ -d minirecord \ -t minitest \ -s rightjs \ -e slim \ -c compass

Slide 21

Slide 21 text

Javascript Lover(?) $ padrino g project example \ -d mongoid \ -t riot \ -s mootools \ -e liquid \ -c less

Slide 22

Slide 22 text

Suppin $ padrino g project example \ -e none You can use all of the innate skills of any and all already mastered modules!

Slide 23

Slide 23 text

Let's Enjoy Padrino ! Thanks @tyabe More Info Adding New Components http://www.padrinorb.com/guides/adding-new-components