Padrino is Agnostic

2c246b10eca87568dda9f431c1134cb3?s=47 Takeshi Yabe
June 02, 2013
360

Padrino is Agnostic

RubyHiroba 2013 での発表資料です

2c246b10eca87568dda9f431c1134cb3?s=128

Takeshi Yabe

June 02, 2013
Tweet

Transcript

  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?
  3. It’s Me! Padrino Contributer

  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
  13. What does Agnostic mean?

  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
  18. example

  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