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

Padrino in Production

Padrino in Production

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

Hiromu Shioya

January 13, 2013
Tweet

More Decks by Hiromu Shioya

Other Decks in Technology

Transcript

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

    View full-size slide

  2. Hello,
    #tkrk10

    View full-size slide

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

    View full-size slide

  4. Presented by

    View full-size slide

  5. Next Sunday is...

    View full-size slide

  6. Second Birthday
    http:/
    /amzn.to/kwappason-wishlist

    View full-size slide

  7. Padrino
    in
    Production
    Framework beyond Rails

    View full-size slide

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

    View full-size slide

  9. Agenda
    1. What’s Padrino?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  12. 1.
    What’s
    Padrino?

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  16. Buffet Style
    Development

    View full-size slide

  17. Buffet Style
    Development

    View full-size slide

  18. ʮҰาઌΏ͘3VCZʯ
    @udzura
    http://amzn.to/VYR35r

    View full-size slide

  19. 2.
    Sub
    Application

    View full-size slide

  20. music.dwango.jp

    View full-size slide

  21. music.dwango.jp
    music.animelo.jp

    View full-size slide

  22. music.dwango.jp
    music.animelo.jp
    music.dwango.jp/melody

    View full-size slide

  23. Using
    Application

    View full-size slide

  24. Clients
    Backends

    View full-size slide

  25. Clients
    Backends

    View full-size slide

  26. Clients
    Backends

    View full-size slide

  27. Clients
    Subapps

    View full-size slide

  28. Clients
    Subapps

    View full-size slide

  29. Clients
    Subapps
    dwangojp

    View full-size slide

  30. Clients
    Subapps
    dwangojp
    jQuery
    Mobile
    Backbone

    View full-size slide

  31. Clients
    Subapps
    dwangojp
    jQuery
    Mobile
    Backbone
    Ajax

    View full-size slide

  32. Clients
    Subapps
    dwangojp
    API
    jQuery
    Mobile
    Backbone
    Ajax

    View full-size slide

  33. Clients
    Subapps
    dwangojp
    API
    jQuery
    Mobile
    Backbone
    Ajax
    JSON

    View full-size slide

  34. Clients
    Subapps
    animelo
    API
    jQuery
    Mobile
    Backbone
    Ajax
    JSON

    View full-size slide

  35. Clients
    Subapps
    melody
    API
    jQuery
    Mobile
    Backbone
    Ajax
    JSON

    View full-size slide

  36. Generating
    Application

    View full-size slide

  37. % padrino g project tkrk10

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  42. % 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

    View full-size slide

  43. 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

    View full-size slide

  44. 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

    View full-size slide

  45. Mounting
    Application

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  48. % 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")

    View full-size slide

  49. % cat config/apps.rb

    View full-size slide

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

    View full-size slide

  51. % 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\..*/)

    View full-size slide

  52. music.dwango.jp
    music.animelo.jp
    music.dwango.jp/melody

    View full-size slide

  53. 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

    View full-size slide

  54. 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

    View full-size slide

  55. Sharing Helpers and Conrollers

    View full-size slide

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

    View full-size slide

  57. 3.
    Padrino
    or
    Rails

    View full-size slide

  58. Merit
    Simple but Expandable

    View full-size slide

  59. Merit
    Simple but Expandable
    Lightweight

    View full-size slide

  60. Merit
    Simple but Expandable
    Lightweight
    Sub Application

    View full-size slide

  61. Demerit
    Lack of Information

    View full-size slide

  62. Demerit
    Lack of Information
    Conflict of Classname

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  65. Padrino is...

    View full-size slide

  66. Padrino is...
    Simple and Expandalbe

    View full-size slide

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

    View full-size slide

  68. Padrino is...
    Simple and Expandalbe
    Sub Application is nice
    Use in the right place

    View full-size slide

  69. 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/

    View full-size slide

  70. Padrino
    in
    Production
    Framework beyond Rails
    Thank you for listening! 2013-01-13 TokyoRubyKaigi10
    @kwappa / SHIOYA, Hiromu

    View full-size slide