Webã¢ããªã¨ã³ã¸ãã¢é¤æèªæ¬ Advent Calendar 2014 - Qiita ããã®6æ¥ç®ã§ãããã§ã«7æ¥ã«ãªã£ã¦ãã¾ã大å¤æ縮ã§ãã ã¨ããã§ããã®æ¸ç±ï¼ã¿ãªãã100ä¸åèªãã§ããã¨æãã®ã§è足ã ã¨æã£ã¦ãã¾ãã!!ï¼ã§ã¯ãSinatraã使ã£ã¦ç°¡åãªWebã¢ããªã±ã¼ã·ã§ã³ãä½æãã¦ãã¾ããã¡ãªã¿ã«ãæ¸ç±ã§ä½æããWebã¢ããªã±ã¼ã·ã§ã³ã®ã½ã¼ã¹ã³ã¼ã㯠sugamasao/Shiori · GitHub ã«ããã¾ãã ãªãSinatraãªã®ã Sinatraèªä½ã¯é常ã«æ軽ã§å¦ç¿ã³ã¹ããä½ããã¨ããã®ä¸ã§ä¸æ©ãã¤çµã¿ç«ã¦ã¦ããã®ã§Webã¢ããªã±ã¼ã·ã§ã³ã¨ã¯ï¼ã¿ãããªé¡æã ã¨ããªãè¯ãã¨æã£ã¦ããã®ã§ããããWebã¢ããªã±ã¼ã·ã§ã³ã«å¿ è¦ãªæ§æè¦ç´ ã¨å¿ è¦ãªè¦ç´ ã®èª¬æããããããã§ãã ã¨ã¯è¨ããã«ãããªã¤ãããã¨æãã¨ãã¡ã¤ã«æ°ãå¢ãã¦ãç ´ç¶»ããªããããªãã£ã¬ã¯ããªæ§æçãå§ã
Paul Sobocinski Paul has over ten years of full-stack web applications development experience. He has built and scaled apps on LAMP stacks as well as on Ruby on Rails. He currently works at Nulogy as a Software Developer, where he enjoys practicing TDD and pair programming on a daily basis. 1 Introduction In this article, we're going to compare the relative merits of Ruby on Rails and Sinatra by b
RubyKaigi 2014è¡ã£ããè¯ãçºè¡¨ãããããèãããã ãã©ãæè¿ISUCONã«åãã¦webã¢ããªã®ãã¥ã¼ãã³ã°ã«èå³ããã£ãã®ã§ç¹ã«final keynoteãèå³æ·±ãã£ãã ãã®ä¸ã§ç´¹ä»ããã¦ããtmm1/rblineprofãè¡ãã¨ã®å®è¡æéã表示ãã¦ãããã®ã§ã¨ã¦ã便å©ããã ã£ããã ãã©ãGitHubã§ã¯peek/peek-rblineprofã¨ããRailsç¨ã®ãã©ã°ã¤ã³ã§rblineprofãæ´»ç¨ãã¦ããã®ã§ãISUCONã§ãããã使ç¨ãããã§ãããsinatraã§ã©ããã£ã¦ä½¿ããèãã¦ããã kainosnoema/rack-lineprofã¨ããgemããã®ç¨éã«ä¾¿å©ããã ã£ãã®ã§ç´¹ä»ãããã 使ãæ¹ rack-lineprofã¯Rack middlewareã§ãã¾ã以ä¸ã®ããã«useããå¿ è¦ãããã require 'rack-lineprof' class My
ããæ°å¹´ãWebã®éçºã¯ã»ã¨ãã©Rubyã®Rackç³»ãã¬ã¼ã ã¯ã¼ã¯ã使ã£ã¦ãã¾ããã ä¹ ã ã«ãCGIããåããªãç°å¢ãã§ã®éçºãå¼·ãããã¾ã㦠ã»ã»ã»ã¾ãããããã®ã¬ã³ã¿ã«ãµã¼ããªãã§ããΣ(ã»Ïã»ã)ã ããããè¦æ¨¡ã®ã·ã¹ãã ã§ããªãã®ã§ã å½åã¯ä¹ ã ã«ãæ®éã®CGIãã§æ¸ããã¨æã£ãã®ã§ããã éçºç°å¢æ§ç¯ã®æç¹ã§ã ãããªã£ãã¨ããã»ã»ã» ãããããæ®éã®CGIãã§æ¸ããã¨ããã¨ã Rackã®å¼·åãªã©ã¤ãã©ãªç¾¤ããã¦ãã¦ã使ããªãã®ã§ã ã»ãã¥ãªãã£çã®é¢ã§ãå¿é ã§ã ããã§ãã©ãã«ãRackã»ã»ã»ã¨ãããã Sinatraãåããæ段ãæ¢ããã¨ããã ãã¾ããã¨è¨äºãè¦ã¤ããã¾ããã½(`ï½¥Ï・´)ã ãããã¬ã³ã¿ã«ãµã¼ãã§Sinatraãèµ·åããã¾ã§ - èããã¨ããã㨠sinatraãcgiã§åããã - Hacking My Way ã itogã®hackæ¥è¨ åºæ¬çã«ã¯ä¸è¨ã®
Web2.0ã¨è¨ããå§ããæ代ã«ãAjaxã¨ããææ³ãåºã¾ãã¾ãããä»ã§ã¯Ajaxã使ã£ã¦ããªãã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ãæ¢ãã®ãé£ããããããWebéçºã®ç¾å ´ã«ã¯æµ¸éãã¦ããã¨æãã¾ãããã¡ãããAjaxãç¥ããªãã¦ãã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ã¯ä½ãã¾ãããããã¯ä½¿ãå¿å°ãæèããã°èªç¶ã¨å¿ è¦ã«ãªã£ã¦ãããã®ã§ãã ãã®è¨äºã§ã¯ãå®éã«ç°¡ç´ ãªæ²ç¤ºæ¿ã¢ããªãä½ããªãããç¾å¨ã»ã¨ãã©ã®ã¦ã§ãã¢ããªã±ã¼ã·ã§ã³ã§ä½¿ããã¦ããAjaxã¨ããææ³ãç´¹ä»ãã¦ããã¾ããã¡ãªã¿ã«ãã¿ã¤ãã«ã®ã100è¡ã§ãã¨ããã®ã¯ä»åæ¸ããapp.rbãindex.erbãschema.sqlã®ï¼ã¤ã®ãã¡ã¤ã«ã®ãã¼ã¿ã«ãããã100è¡ã ã¨ããæå³ã§ããæ°åãã¿ã¤ãã«ã«å ¥ããã¨èªãã§ããããããã¨ãã話ãã©ããã§èããã®ã§å ¥ãã¦ã¿ã¾ããã ã½ã¼ã¹ã³ã¼ãã¯Githubã«ãç½®ãã¦ããã¾ããã gaaamii/ajax_sample
require 'sinatra' ['/one', '/two', '/three'].each do |route| get rounte do "Triggered #{route} via GET" end post route do "Triggered #{route} via POST" end end RESTãªã¯ã¨ã¹ãã®ãã©ã¡ã¼ã¿ãåãåããã ä¾ãã°ãããªãªã¯ã¨ã¹ã http://my.server.address/function?key1=value1&key2=value2&key3=value3 ãããªãµãã«åãããã¨ãã§ãã
ããã°ãã¯ã麺å¦ã¾ã¤ã°å¯åºé·ã§ãã æ¬æ¥ã®éººå¦ã¾ã¤ã°ã®ã¾ããªãã¯ã天ã·ããã©ãã§ããã ãã¦ãååã®ã¡ãã¥ã¼ã¯ Hello world ã ã£ãã®ã§ ä»åã¯ããã©ã¼ã ãã hello world ã£ã¦å ¥ãã¦ãããäºã¨ãã¾ãã ã¨ãããã¨ã§ãä»åã®ã¡ãã¥ã¼ã¯ãã"hello world"ã£ã¦è¨ãããã¢ããªã ï¼¼ãªãã ãããï¼ ããã³ããããã¨ããããã¾ãï¼ã²ã¨ãä¸æï¼ ãã©ã¼ã ããéä¿¡ãããæååã ãhello worldãã¨ããæååãã©ãããå¤å®ã ãhello worldããããªãã£ããã"hello world"ã£ã¦è¨ããã ã£ã¦ãµã¦ããããã¡ãã»ã¼ã¸ã表示ããã¾ãããã ããã ãã§ãã ä½ãæ¹ã¯ãããªæãã§ã appã®ä½æ viewsã®ä½æ åä½ç¢ºèª 試é£ä¼ appã®ä½æ ã¾ãã¯ã/ã«GETããã¨ãã¨POSTããã¨ãã®ãã¸ãã¯ãæ¸ãã¾ãã GETã®ã¨ãã¯ãviewã®æå®ããã ãã P
èæ¯ ããç¨åº¦ä¸è¦æ¨¡ã®ã¢ããªã±ã¼ã·ã§ã³ãä½æããåæã§ãå ¬å¼ãµã¤ãã®ãGetting Startedãã¨ã¯æ§æãå¤ãããViewã¯å¥ãã¡ã¤ã«ã¸åãããModelã¯ã¯ã©ã¹ãåããããµã¼ãã¼å®è¡ã³ã¼ããã¢ããªã±ã¼ã·ã§ã³ã³ã¼ãããåãããã©ã¤ãã©ãªã¯bundlerã§ç®¡çãããViewã¯haml, sass, coffeescriptã使ç¨ããããã¹ãã«ã¯rspecã使ç¨ããã å®è£ ãã£ã¬ã¯ããªä½æ
ï¼2014/12/29ï¼ãã¥ã¼ããªã¢ã«åç»ãé²ç»ãã¾ããããã¡ããã©ããã Rubyã¨Sinatraã§ã¢ã³ãããµã¤ããä½ããã¥ã¼ããªã¢ã« - YouTube Rubyã¨Sinatraã§ã¢ã³ãããµã¤ãï¼Webãµã¤ãããRSSåå¾ãã¦è¡¨ç¤ºãããµã¤ãï¼ãä½ããã¥ã¼ããªã¢ã«çãªè¨äºãæ¸ãã¦ã¿ããã¨ã«ãã¾ããæ¬è¨äºã®å¯¾è±¡è ã¯ãHTMLã¯ããããã©åçãªãµã¤ãã¯ä½ã£ããã¨ãç¡ãããããã®äººã§ãã ã¾ãããããããç´ äººãæ¸ãã¦ãããã®ãªã®ã§èªèéãã説æä¸è¶³ãè¦ã¤ãããã¨æãã¾ããã³ã¡ã³ããTwitterããã³ã¡ãªã©ãããææãã ããã¨å©ããã¾ããã¡ãªã¿ã«ãç°å¢ã¯Mac OS Xãæ³å®ãã¦ãã¾ãã ã½ã¼ã¹ã³ã¼ãã¯ï¼åãã¦ï¼GitHubã«ç½®ãã¾ããã » gaaamii/sinatra_rss ç®æ¬¡ 1. ã¯ããã« å®æå Ruby Sinatra ãã©ã«ããä½ã 2. ã¨ããããHello,World
Webç³»ã§åãããã®ã§è²ã åå¼·ãã¦ãã¾ãã以åã¯åå¼·ç¨ã«Railsã§ã¢ããªãä½ãã¾ããã ä»åº¦ã¯sinatraã§ä½ã£ã¦ã¿ã¾ãããä»åº¦ã®ãã¼ãã¯ããã¹ããã ãã¨ã¢ãã³ãªç°å¢ãè²ã ã¨è©¦ãã¦ã¿ã¾ãããsinatra+sequel+slim+bootstrap+rspec+redmine+jenkinsã ã§ããã®ããã¡ãã http://www7148ue.sakura.ne.jp/todolist ã½ã¼ã¹ã¯ãã¡ããå ¬éãã¦ããã¾ãã http://github.com/arvelt/my-todo-list-with-ruby-sinatra ã¡ã¢ç¨ã«ä½¿ã£ã¦ããã±ããã¯ãããªæã http://49.212.138.162/redmine/projects/todolist-ruby-sinatra/issues ãã¨ãã®ã¸ãã®å 容ã§è²ã åå¼·ä¼ã¨ãã«åºæ²¡ãã¦LTã¨ããããã¨ãæããã§ãããå
The Armored Code A blog talking about offensive and defensive security and how to craft software in a secure way Sinatra is a powerful and easy to use ruby based DSL to create web applications and powerful APIs. In this first Hack for fun category post I will show you a simple real life rubygem project implemented in a couple of afternoons while Iâm rerecovering from a surgery. Palco: a simple way
ç 究室ã®å¾è¼©ã«Sinatraã¨hamlã¨jQueryãæããããã«ä½ã£ããã³ãã¬ã¼ãã«ã¤ãã¦ãããã«ãæ¸ãã¦ãã ã½ã¼ã¹ã³ã¼ã https://github.com/shokai/sinatra-template å®éåãã¦ãããã® http://masui.sfc.keio.ac.jp/sinatra-template/ git clone git://github.com/shokai/sinatra-template.git â Sinatraãä½ã«ä½¿ãã Sinatra+haml+jQueryã便å©ã Railsã¨ä¼¼ã¦ããã©ãã¡ãã£ã¨éãã å人çã«ã¯ Rails â HTMLã®ãã¼ã¸ããã£ã±ãä½ãã®ã«ä¾¿å© Sinatra â ç»é¢é·ç§»ãã¾ãããªãã¦ãåãURLã®ã¾ã¾jsonã®APIãjQueryã®ajaxã§åå¾ãã¦åçã«è¡¨ç¤ºãå¤ããwebãã¼ã¸ãä½ãã®ã«ã¯ä¾¿å© ã«æããã ã§ãSi
Rubyã®ãã¬ã¼ã ã¯ã¼ã¯sinatraã®ç´¹ä»ã§ãã Railãæåããã¾ãããsinatraã使ãåæãè¯ãæãã§ãã æ¬å®¶ Shinatra æ¬å®¶ ããã¥ã¡ã³ã èªåã使ã£ã¦ã¿ã¦ä¸è¨ï¼ç¹ãé常ã«ä¾¿å©ã¨æãã¾ããã æå°ã®ã³ã¼ãè¨è¿°ã§MVCã使ãã æåã¯httpãµã¼ãã¼ã®è¨å®ãªã©ç¹ã«èããªãã¦ããã ã¨ãè¨ãããã§æ©é使ãæ¹ã åºæ¬åä½ãããã¾ã§ãï¼åããããã¾ãããã¹ã´ã¤ï¼ï¼ install cmd gem install sinatra ã½ã¼ã¹ app.rb require 'sinatra' get '/' do "Hello world " end åããã¦ã¿ã ã³ãã³ãã§ããã°ã©ã èµ·å cmd ruby app.rb #çµäºã¯Ctrl-C㧠ãã©ã¦ã¶ã¼ã§ã¢ã¯ã»ã¹ URL http://localhost:4567 表示 Hello world 以ä¸ãsinatraã®åºæ¬çãªåã
ä»ãã£ã¦ãããã¸ã§ã¯ãã§Sinatraã§ã¤ãã£ãã¢ããªã±ã¼ã·ã§ã³ãRailsã¢ããªã«çµã¿è¾¼ãå¿ è¦ããã£ãã®ã§ï¼ã¢ããªãä½ãã¨ããããä½æ¥ãç°¡ç¥åãã¦ã¡ã¢ããï¼ ã¼ãã èªåã®ã±ã¼ã¹ã ã¨SinatraãjQuery Mobileãæ±ã£ã¦ã¦Railsã¯APIãµã¼ãã«ä½¿ãã¨ãããæ®ééã ãï¼ãã¨ããã³ããåãã¦ãæå¥è¨ããªãç¶æ ï¼è¨ã訳ã ãã©æåã¯APIãµã¼ãã¤ããäºå®ãããªãã£ããï¼Sinatraã®ã»ãã¯ç ´æ£ããã¤ããã ã£ãï¼ï¼Githubãªããã¯éã«Sinatraã§å®è£ ããAPIãRailsã«ãã¦ã³ããã¦ããï¼ãã¬ã¼ã ã¯ã¼ã¯ã®ç«ã¡ä½ç½®ããèããã¨ãããæ£ããã¨æã. 詳ããã¯ãã®ã¹ã©ã¤ããåç §ãããã¨ï¼ ã¾ãRailsã¢ããªãã¤ãã rails new hoge index.htmlãåé¤ãã¦ãã cd hoge rm ./public/index.html Gemfileã«sinatraã
Rubyåå¿è ãSinatraã使ãå§ãã¦ã¿ãã®ã§ãå§ãã®æ¬ãªã©ãç´¹ä»ãã¾ãã å ¬å¼ãµã¤ã http://www.sinatrarb.com/ ã¨ããããå ¬å¼ãµã¤ããè¦ãªãããHello World!ããã£ã¦ã¿ã¦ãããããªããç°¡åããï¼ãã¨æãããã®ã®ããªã«ãå¦çããã«ã¯æä½éRubyæ¸ããªãã¨ãã£ã±ããã¡ã ãªãã¨æããä¸æ¦Sinatraããé¢ãã¦Rubyã®åå¿è æ¬ãèªã¿å§ãã¾ããã ãä½ããªããå¦ã¶Rubyå ¥éããæ¬å½ã«ãªã¹ã¹ã¡ã§ãï¼ èµæ¸ç®¡çããã°ã©ã ãä½ãããã«é©å®ããã«å¿ è¦ãªç¥èãé ã追ã£ã¦å°ããã¤ç´¹ä»ãã¦ããã¦ãããã®ã§æ«æãã«ãããã¨ã ãã®æ¬ã¯è¨èªé¢ä¿ãªãããã°ã©ã åå¿è ã«ããããããããã§ãã ãªããããã°ã©ãã³ã°è¦æãªèªåã«ã§ãç解ããããã£ããã®ã§(ï¼Â´Ðï½) ããã¨ãããã¤ã³ã¹ãã¼ã«ã®Rubyå ¥éã¨Sinatraå ¥éãå¿ è¦ã§ããã http://dotinstall.
December 9, 2013Build a Sinatra API Using TDD, Heroku, and Continuous Integration with Travis This post was inspired by this brilliant video, where Konstantin Haase, the maintainer of Sinatra builds a fully working app and deploys it on Heroku with tests on Travis (where he works). I decided to do a similar example that walks through each step of building an API service that demonstrates a typical
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}