Padrino is agnostic

531 views
444 views

Published on

RubyHiroba 2013 での発表資料です

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
531
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Padrino is agnostic

  1. 1. Padrino is AgnosticRubyHiroba 2013Takeshi Yabe / @tyabe
  2. 2. account: {twitter: "@tyabe",github: "tyabe" },name: "Takeshi Yabe",organization : ["Shibuya.rb","Yokohama.rb","RubyKajaTeam" ]About Me?
  3. 3. It’s Me!Padrino Contributer
  4. 4. What is Padrino?Web MVC frameworkbuilt on Sinatra“Structured Sinatra”
  5. 5. require sinatra/base class App < Sinatra::Baseget / doHello world!endend App.run! host: localhost, port: 3000$ gem install sinatra$ vim app.rb$ ruby app.rb$ curl http://localhost:3000/Example Sinatra App
  6. 6. Padrino App Structure$ gem install padrino$ padrino g project sample_project
  7. 7. Padrino App Structuresample_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. 8. Example Padrino Appmodule SampleProjectclass App < Padrino::Applicationregister Padrino::Renderingregister Padrino::Helpersenable :sessions get / doHello world!endendend$ vim app/app.rb$ padrino s$ curl http://localhost:3000/
  9. 9. class App < Sinatra::Baseget / doHello world!endendSinatraComparison App FilePadrinomodule SampleProjectclass App < Padrino::Applicationregister Padrino::Renderingregister Padrino::Helpersenable :sessions get / doHello world!endendend
  10. 10. PhilosophySimple to useSimple to hackDeveloper freedomCoding should be fun!Only have a very few layerbetween We and the Padrino.
  11. 11. Major FeatureAgnosticGeneratorsMounting Multiple AppsAdmin Interface... and much more
  12. 12. Major FeatureAgnosticGeneratorsMounting Multiple AppsAdmin Interface... and much more
  13. 13. What does Agnostic mean?
  14. 14. Be not bound by specific thought.What does Agnostic mean?Caution!this might lead to misunderstanding.my poor english has limitations... :-c
  15. 15. AgnosticDatabaseWrapper- ActiveRecord- MiniRecord- DataMapper- Sequel- MongoMapper- Mongoid- Mongomatic- Ohm- Coachrest- RippleRenderer- Haml- Erb- Liquid- SlimJavascripts- JQuery- Prototype- Rightjs- MooTools- ExtCore- DojoStylesheets- Less- Sass- Compass- ScssAnd tests, mocks
  16. 16. Usage
  17. 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: noneSpecify the options in the project generator
  18. 18. example
  19. 19. Like a Rails(with RSpec)$ padrino g project example -d activerecord -t rspec -s jquery -e erb -c scss
  20. 20. Very Simple Project$ padrino g project example -d minirecord -t minitest -s rightjs -e slim -c compass
  21. 21. Javascript Lover(?)$ padrino g project example -d mongoid -t riot -s mootools -e liquid -c less
  22. 22. Suppin$ padrino g project example -e noneYou can use all of the innate skills of anyand all already mastered modules!
  23. 23. Lets Enjoy Padrino !Thanks@tyabeMore InfoAdding New Componentshttp://www.padrinorb.com/guides/adding-new-components

×