Padrino in Production

Padrino in Production

2012-01-13 TokyoRubyKaigi10 #tkrk10
"Padrino in Production"
by kwappa

8fea11f3454c94cb5a5599ff03021471?s=128

SHIOYA, Hiromu

January 13, 2013
Tweet

Transcript

  1. Padrino in Production 2013-01-13 TokyoRubyKaigi10 @kwappa / SHIOYA, Hiromu Framework

    beyond Rails
  2. Hello, #tkrk10

  3. http:/ /www.kwappa.net/ kwappa SHIOYA, Hiromu

  4. Presented by

  5. Notice

  6. Next Sunday is...

  7. None
  8. Second Birthday http:/ /amzn.to/kwappason-wishlist

  9. that aside

  10. Padrino in Production Framework beyond Rails

  11. http://www.padrinorb.com/ Padrino

  12. Agenda

  13. Agenda 1. What’s Padrino?

  14. Agenda 1. What’s Padrino? 2. Sub Application

  15. Agenda 1. What’s Padrino? 2. Sub Application 3. Padrino or

    Rails?
  16. 1. What’s Padrino?

  17. Sinatra

  18. Sinatra http://www.sinatrarb.com/ get '/hi' do "Hello World!" end

  19. Sinatra

  20. Sinatra Helpers Generaors Rake Tasks Console Admin Mailer Cache Sub

    Application
  21. Sinatra Helpers Generaors Rake Tasks Console Admin Mailer Cache Sub

    Application
  22. Buffet Style Development

  23. Buffet Style Development

  24. None
  25. None
  26. ʮҰาઌΏ͘3VCZʯ @udzura http://amzn.to/VYR35r

  27. 2. Sub Application

  28. None
  29. None
  30. None
  31. None
  32. None
  33. None
  34. None
  35. music.dwango.jp

  36. music.dwango.jp music.animelo.jp

  37. music.dwango.jp music.animelo.jp music.dwango.jp/melody

  38. Using Application

  39. Clients Backends

  40. Clients Backends

  41. Clients Backends

  42. Clients Subapps

  43. Clients Subapps

  44. Clients Subapps dwangojp

  45. Clients Subapps dwangojp jQuery Mobile Backbone

  46. Clients Subapps dwangojp jQuery Mobile Backbone Ajax

  47. Clients Subapps dwangojp API jQuery Mobile Backbone Ajax

  48. Clients Subapps dwangojp API jQuery Mobile Backbone Ajax JSON

  49. Clients Subapps animelo API jQuery Mobile Backbone Ajax JSON

  50. Clients Subapps melody API jQuery Mobile Backbone Ajax JSON

  51. Generating Application

  52. % padrino g project tkrk10

  53. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp % padrino g project tkrk10
  54. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp
  55. % padrino g app kuro_kaigi tkrk10 ├── Gemfile ├── app

    │ ├── app.rb │ ├── controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp
  56. % padrino g app kuro_kaigi tkrk10 ├── Gemfile ├── app

    │ ├── app.rb │ ├── controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi
  57. % padrino g app kuro_kaigi tkrk10 ├── Gemfile ├── app

    │ ├── app.rb │ ├── controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi kurokaigi ├── app.rb ├── controllers ├── helpers └── views └── layouts
  58. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi kurokaigi ├── app.rb ├── controllers ├── helpers └── views └── layouts Common Bootstrap Config Models Libs
  59. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi kurokaigi ├── app.rb ├── controllers ├── helpers └── views └── layouts Exclusive Common Bootstrap Config Models Libs Public Dir Controllers Helpers Views
  60. Mounting Application

  61. % cat config/apps.rb Padrino.mount("Tkrk10").to('/')

  62. % cat config/apps.rb Padrino.mount("Tkrk10").to('/') # mount to path # http://localhost/kurokaigi

    Padrino.mount("KuroKaigi") .to("/kurokaigi")
  63. % cat config/apps.rb Padrino.mount("Tkrk10").to('/') # mount to path # http://localhost/kurokaigi

    Padrino.mount("KuroKaigi") .to("/kurokaigi") # mount to hostname # http://kurokaigi.example.com/ Padrino.mount("KuroKaigi") .to("/") .host("kurokaigi.example.com")
  64. % cat config/apps.rb

  65. % cat config/apps.rb # both path and host can be

    used # http://example.com/kurokaigi Padrino.mount("KuroKaigi") .to("/kurokaigi") .host("example.com")
  66. % cat config/apps.rb # both path and host can be

    used # http://example.com/kurokaigi Padrino.mount("KuroKaigi") .to("/kurokaigi") .host("example.com") # also Regular expressions can be used # http://kurokaigi.{host_name} Padrino.mount("KuroKaigi") .to("/") .host(/kurokaigi\..*/)
  67. music.dwango.jp music.animelo.jp music.dwango.jp/melody

  68. Tips

  69. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi kurokaigi ├── app.rb ├── controllers ├── helpers └── views └── layouts Exclusive Common Bootstrap Config Models Libs Public Dir Controllers Helpers Views
  70. tkrk10 ├── Gemfile ├── app │ ├── app.rb │ ├──

    controllers │ ├── helpers │ └── views │ └── layouts ├── config ├── config.ru ├── log ├── public └── tmp ├── kurokaigi │ └── kurokaigi kurokaigi ├── app.rb ├── controllers ├── helpers └── views └── layouts Exclusive Common Bootstrap Config Models Libs Public Dir Controllers Helpers Views
  71. Sharing Helpers and Conrollers

  72. Sharing Helpers and Conrollers http://qa.atmarkit.co.jp/q/51

  73. 3. Padrino or Rails

  74. Merit

  75. Merit Simple but Expandable

  76. Merit Simple but Expandable Lightweight

  77. Merit Simple but Expandable Lightweight Sub Application

  78. Demerit

  79. Demerit Lack of Information

  80. Demerit Lack of Information Conflict of Classname

  81. Demerit Lack of Information Conflict of Classname Shortage of Engineer

  82. దࡐదॴ Right Man in the Right Place

  83. Conclusion

  84. Padrino is...

  85. Padrino is... Simple and Expandalbe

  86. Padrino is... Simple and Expandalbe Sub Application is nice

  87. Padrino is... Simple and Expandalbe Sub Application is nice Use

    in the right place
  88. Links The Elegant Ruby Web Framework - Padrino Ruby Web

    Framework http:/ /www.padrinorb.com/ Padrino Ͱૉఢͳ΢Σϒ։ൃΛ - Padrino Ruby Web Framework http:/ /jp.padrinorb.com/ Rubyist Magazine - Sinatra ࠶ೖ໳ɺ Padrino / Rack / ͦͷઌͷԿ͔ http:/ /jp.rubyist.net/magazine/?0036-SinatraReintroduction Amazon.co.jpɿ WEB+DB PRESS Vol.69 http:/ /amzn.to/VYR35r λά padrino ͕෇͚ΒΕ࣭ͨ໰ - QA@IT http:/ /qa.atmarkit.co.jp/q/tagged/padrino Padrino framework jp (Facebook Group) https:/ /www.facebook.com/groups/105007729664623 O'Reilly Japan - ೖ໳ Sinatra http:/ /www.oreilly.co.jp/books/9784873115597/
  89. Padrino in Production Framework beyond Rails Thank you for listening!

    2013-01-13 TokyoRubyKaigi10 @kwappa / SHIOYA, Hiromu