Web      ymrl
•    •    •    ••   HTML,CSS
21.     HTML2.     JavaScript Flash
Web                (1)•    • Web   Apache, nginx    • Web   Chrome, Firefox    •
Web                              (2)•   http://example.com/hoge/fuga/    1.            URL    2.             example.com  ...
Web                              (2)•   http://example.com/hoge/fuga/    1.            URL    2.             example.com  ...
CGI(Common Gateway Interface)•   HTML••            ……
Perl   CGI
Web•   Web    →    •   Ruby : Ruby on Rails, Sinatra, etc    •   PHP : Zend Framework, symfony, CakePHP, etc    •   Python...
Sinatra• Ruby    Web• Rails•
••        UTF-8    LF•
Ruby•   Mac OS X            Developer Tools•   Windows             RubyInstaller    http://rubyinstaller.org/    Cygwin•
Sinatra• Windows  Mac• Mac       sudo
RubyGems•   Ruby    •                   Gem•   Mac                                       sudo    Gem    •   Rubyist       ...
Sinatra1.2. app.rb3.4. ruby app.rb5. http://localhost:4567/hello/world
app.rbhttps://gist.github.com/1035264
view• HTML• Sinatra     Erb   Haml• views
https://gist.github.com/1035264
app.rb
views/layout.erb
views/beer.erb
Erb•            HTML                    HTML•   <%= %>           <% %>    •   =    •   if ~ end    do ~ end•   PHP
Haml••   -       =    •   =    •   end•   Python
POST         GET• HTTP    4 GET, POST, PUT, DELETE• HTML              GET    POST •             GET •                     ...
GET  key=value   URL
•   Cookies : Web    key=value••   Sessions :    •    •    •
•   Sinatra    •   Ruby on Rails      ActiveRecord•                  OK    •   Sequel, ActiveRecord, DataMapper ...    •  ...
••       POST•••        Sequel   SQLite    •
https://gist.github.com/1035282※erb             views  ※db
Web••    •   Sinatra Rails    •   Apache    •   Passenger    ••
Ajax•   Asynchronous JavaScript + XML(HttpRequest)•                Web   HTML    •    ••   JavaScript    •
Web•   Web 0.1 : Tim Berners-Lee        90    CREN            URI•   Web 1.0 : MSIE vs Netscape       90        ~ 00      ...
XML             JSON•   Ajax      JavaScript XMLHttpRequest    •   XML    •         XML•   JSON JavaScript    ••   XMLHttp...
JSON
Sinatra JSON•      JavaScript   GET
Web API•   Web•   Twitter   Amazon   Google•   GET   POST   JSON XML•
Sinatra布教す
Sinatra布教す
Upcoming SlideShare
Loading in …5
×

Sinatra布教す

1,690 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
1,690
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Sinatra布教す

  1. 1. Web ymrl
  2. 2. • • • •• HTML,CSS
  3. 3. 21. HTML2. JavaScript Flash
  4. 4. Web (1)• • Web Apache, nginx • Web Chrome, Firefox •
  5. 5. Web (2)• http://example.com/hoge/fuga/ 1. URL 2. example.com Web 3. /hoge/fuga/ 4. /hoge/fuga/ 5. 6.
  6. 6. Web (2)• http://example.com/hoge/fuga/ 1. URL 2. example.com Web 3. /hoge/fuga/ 4. /hoge/fuga/ 5. 6.
  7. 7. CGI(Common Gateway Interface)• HTML•• ……
  8. 8. Perl CGI
  9. 9. Web• Web → • Ruby : Ruby on Rails, Sinatra, etc • PHP : Zend Framework, symfony, CakePHP, etc • Python : Django, TurboGears,
  10. 10. Sinatra• Ruby Web• Rails•
  11. 11. •• UTF-8 LF•
  12. 12. Ruby• Mac OS X Developer Tools• Windows RubyInstaller http://rubyinstaller.org/ Cygwin•
  13. 13. Sinatra• Windows Mac• Mac sudo
  14. 14. RubyGems• Ruby • Gem• Mac sudo Gem • Rubyist RVM Ruby http://d.hatena.ne.jp/mirakui/20100502/1272849327
  15. 15. Sinatra1.2. app.rb3.4. ruby app.rb5. http://localhost:4567/hello/world
  16. 16. app.rbhttps://gist.github.com/1035264
  17. 17. view• HTML• Sinatra Erb Haml• views
  18. 18. https://gist.github.com/1035264
  19. 19. app.rb
  20. 20. views/layout.erb
  21. 21. views/beer.erb
  22. 22. Erb• HTML HTML• <%= %> <% %> • = • if ~ end do ~ end• PHP
  23. 23. Haml•• - = • = • end• Python
  24. 24. POST GET• HTTP 4 GET, POST, PUT, DELETE• HTML GET POST • GET • POST
  25. 25. GET key=value URL
  26. 26. • Cookies : Web key=value•• Sessions : • • •
  27. 27. • Sinatra • Ruby on Rails ActiveRecord• OK • Sequel, ActiveRecord, DataMapper ... • SQL• SQLite
  28. 28. •• POST••• Sequel SQLite •
  29. 29. https://gist.github.com/1035282※erb views ※db
  30. 30. Web•• • Sinatra Rails • Apache • Passenger ••
  31. 31. Ajax• Asynchronous JavaScript + XML(HttpRequest)• Web HTML • •• JavaScript •
  32. 32. Web• Web 0.1 : Tim Berners-Lee 90 CREN URI• Web 1.0 : MSIE vs Netscape 90 ~ 00 HTML Java Applet, JavaScript, ActiveX, Flash• Web 2.0 : Amazon, Google and Social-Services 00 ~ Web XML Web API Ajax JavaScript ※
  33. 33. XML JSON• Ajax JavaScript XMLHttpRequest • XML • XML• JSON JavaScript •• XMLHttpRequest URL •
  34. 34. JSON
  35. 35. Sinatra JSON• JavaScript GET
  36. 36. Web API• Web• Twitter Amazon Google• GET POST JSON XML•

×