Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Padrino is Agnostic

Takeshi Yabe
June 02, 2013
700

Padrino is Agnostic

RubyHiroba 2013 での発表資料です

Takeshi Yabe

June 02, 2013
Tweet

Transcript

  1. account: { twitter: "@tyabe", github: "tyabe" }, name: "Takeshi Yabe",

    organization : [ "Shibuya.rb", "Yokohama.rb", "RubyKajaTeam" ] About Me?
  2. 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
  3. 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
  4. 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/
  5. 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
  6. Philosophy Simple to use Simple to hack Developer freedom Coding

    should be fun! Only have a very few layer between We and the Padrino.
  7. Be not bound by specific thought. What does Agnostic mean?

    Caution! this might lead to misunderstanding. my poor english has limitations... :-c
  8. 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
  9. $ 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
  10. Like a Rails(with RSpec) $ padrino g project example \

    -d activerecord \ -t rspec \ -s jquery \ -e erb \ -c scss
  11. Very Simple Project $ padrino g project example \ -d

    minirecord \ -t minitest \ -s rightjs \ -e slim \ -c compass
  12. Javascript Lover(?) $ padrino g project example \ -d mongoid

    \ -t riot \ -s mootools \ -e liquid \ -c less
  13. Suppin $ padrino g project example \ -e none You

    can use all of the innate skills of any and all already mastered modules!
  14. Let's Enjoy Padrino ! Thanks @tyabe More Info Adding New

    Components http://www.padrinorb.com/guides/adding-new-components