Sinatra+æºå¸¯+çµµæå
ããã°ãæ¾ç½®ããããªã®ã§ç´¹ä»ãã¾ãã
ããå æ¸é£½ãã¦ããæãã®ããSinatraã§æºå¸¯ãµã¤ããéçºããã¨ãã®çµµæåExtensionã§ãã
èªãµã¤ãã§çµµæåã®ã¿ä½¿ãããã£ãã®ã§å®è£
ãã¾ããã
ç¾å¨ã¯åºæ¬çµµæåã®ã¿ï¼ãã¾ããã¹ããã¦ãªãã¨ããé©å½ä»æ§ã§ãã
rack-ketaiã使ããã°ããã§è¯ãã£ã¦è©±ãããã¾ãã
http://github.com/gioext/sinatra-emoji
使ãæ¹ã¯READMEãè¦ãã°æ¦ãåãããã¨æãã¾ãã念ã®ãããããã«ãè¼ãã¦ããã¾ãã
注æç¹ã¯é常ã®erb,hamlãç½®ãæãã¦ãæåã³ã¼ããå¤æãã¦ããã®ã§ãã®ã§ãå¤æãå¿
è¦ãªãå ´åã¯__erb__,__haml__ã使ãã¾ãããã
sudo gem install gioext-sinatra-emoji
require 'rubygems' require 'sinatra' require 'sinatra/emoji' get '/' do erb :index end helpers do # use __erb__ def partial(sym) __erb__ sym, :layout => false end end configure do # default set :output_encoding_sjis, true end __END__ @@ layout <html> <head><title>test</title></head> <body> <%= yield %> </body> </html> @@ index <%= emoji(0) %> <%= partial(:parts) %> @@parts <%= emoji(1) %> <br /> ã¯ãã¼
ããã¾ã