ã¨ã¼ãã£ã¼ã®ã¢ããªã¨-ã¢ã©ã³ããã¯ã®é¬éè¡å¸«(Elixir/Phoenix ã®èãæ¬)ãèªãã
ãã¨ã¼ãã£ã¼ã®ã¢ããªã¨-ã¢ã©ã³ããã¯ã®é¬éè¡å¸«ããããã Elixir/Phoenix ã®èã(èããªã)æ¬ãä¸éãèªäºãã¾ãããElixir è¨èªãããããå¦ã³ãããPhoenix Framework ã§ä½ãä½ã£ã¦ã¿ããæ¹ã«ãªã¹ã¹ã¡ãªæ¸ç±ã§ããããæ°ã«ãªã£ãæ¹ã¯ãã¡ãã§é»åæ¸ç±çãè³¼å ¥ãããã¨ãã§ãã¾ãã
http://hayabusa333.tumblr.com/
ãã¦æè§ä¸éãèªãã ã®ã§ãç°¡åã«ææ³ãæ°ã«ãªã£ãç¹ãè¿°ã¹ã¾ããæãèªã¿ãªã¨ããããããè¦éãã¦ããç¹ãããã¾ããããææãã ããã
ææ³
å ¨ä½æ§æã¯4ç« ã§æãç«ã£ã¦ããã1ç« ãã¯ããã«ã2ç« ã§ Elixir çéã®ãã£ããã¢ããã3ç« ã§ Elixir è¨èªç´¹ä»ã4ç« ã§ Phoenix Framework ã«ãããµã³ãã«ã¢ããªä½æã¨ããå 容ã§ããã
3ç« ã§ã¯ Elixir è¨èªç´¹ä»ã ãã§ãªããã©ã¤ãã©ãªã® Hex ã¸ã®ãªãªã¼ã¹æ¹æ³ããã¹ããv1.2 ã®å åãæ å ±ãè¨è¼ããã¦ããããããã Elixir å§ããæ¹ã«ã¯ã¨ã£ãããæãå 容ã§ãã
4ç« ã¯æ¬æ¸ã®7å²ç¨åº¦ãå ããããªã¥ã¼ã ããããRuby on Rails Tutorial ã Phoenix Framework ã§ãã£ããã©ããªããï¼ã¨ããå 容ã¨ãªã£ã¦ãã¾ãã å®å ¨ã«åä¸ã§ã¯ãªããã®ã®ãä¸éã Phoenix Framework ãå¦ã¹ããããPhoenix Framework 触ã£ã¦ã¿ããæ¹ããä½ãä½ã£ã¦ã¿ããæ¹ã«ããªã¹ã¹ã¡ã§ããå 容ã«ãªã£ã¦ãã¾ããã
200ãã¼ã¸ã»ã©ã®åéãããã®ã§ããã大å¤ãæ±ããããä¾¡æ ¼ã«ãªã£ã¦ããã®ããªã¹ã¹ã¡ã§ããBOOTH ã¨ãããµã¤ãã§è²©å£²ããã¦ãããè²©å£²ä¾¡æ ¼ã«ä¸ä¹ããã¦è³¼å ¥ãããã¨ãã§ãã¾ããå人çã«ã¯å®éããã¨æã£ããã¨ããããä¸ä¹ããã¦è³¼å ¥ãã¦ãã¾ããçãå¿æ´ãããã
æ°ã«ãªã£ãç¹
4.6 Modeling Users ã®ãã¹ã¯ã¼ãã«ã¤ãã¦
ãã¹ã¯ã¼ãã®ç« ã§ãã¹ã¯ã¼ããæå·åãã¦ä¿åããã¦ããç¹(è¤ååã§ãã)ãæ°ã«ãªãã¾ãããSafetybox ã®ä½¿ãæ¹ã§æå·åã®éµãsalt ãããã©ã«ãã®ã¾ã¾ã使ã£ã¦ããã®ã§ããã®ã¾ã¾åèã«ãã¦å®è£ ãã¦ãã¾ã㨠DB ã®ãã¼ã¿ãè¦ãã人ãè¤ååã§ãã¦ãã¹ã¯ã¼ããåãã£ã¦ãã¾ããªã¨æ¸å¿µãã¾ãããããã¨ãã¹ã¯ã¼ããéå¶å´ã«ãç¥ãããããªãã¨ãããã¼ãºã¯ããã®ã§ããã¹ã¯ã¼ããããã·ã¥åãã¦å ã«æ»ããªãããã«ãã¦ä¿åããã¨ããæ¹æ³ã«ã¤ãã¦ã注éãããã¨è¯ãã®ããªã¨ãæãã¾ããã
4.8 Sign in out ã® Cookie ã®æ¹ããã«ã¤ãã¦
Cookieã®å¤ãæ¹ãããã¦ãå¥ã®ã¦ã¼ã¶ã§ãã°ã¤ã³ãã¦ããããã«æããã¾ããã¨ãã§ãã¦ãã¾ãã¾ãã
ã¨ããã®ã§ãããPhoenix 㯠`secret_key_base` ãè¨å®ãããã¨ã§ Cookie ã¯æå·åãç½²åãããã¦ããã®ã§ãéµãæ¼ããªãéãã¯æ¹ãããããã¨ã¯é£ããã§ãããã㯠Rails ã¨ã»ã¼åæ§ã®ä»çµã¿ãä½ã£ã¦ããããã§ã(å®éã«ã¯ãã®æ©è½ã¯ Plug ãæä¾ãã¦ãã)ããã®ãã Cookie ã®æ¹ããã«ã¤ãã¦ã¯ããã»ã©å¿é ããå¿ è¦ã¯ãªãã®ã§ã¯ãªããã¨èãã¦ãã¾ãããã éµãæ¼ããã¨çµããã¨ããç¹ãæ°ã«ããå ´åã¯ãCookie ãããªãã¦å¥ã®ã¹ãã¢ã使ãã¨ããæ¹æ³ãå¿ è¦ã§ããä¾ãã° redis, memcached ã代ããã«ä½¿ããªã©ãredis ã 㨠plug_session_redis ã¨ããã®ãããããã§ãã使ã£ããã¨ã¯ãªãã§ãã
4.9 ç« Updating Users ã®æ©è½ãã©ã°
Plug ããã©ã°ã¨èª¬æãã¦ãããã©ãã«ã¿ã«ãã«ãã Plug ã®ã¾ã¾ã§ããããªã¨æãã¾ãããæ©è½ãã©ã°ã¨ãã訳ã«é¢ãã¦ãããã¨ãã¨ã®è±èªã function plugs ã¨ããæããªã®ã§å¾®å¦ã ãã©ãæ³å®ãããã®ã¯é¢æ° Plug ããªã¨ã
function plugs ã«ã¤ãã¦ã¯ãã¡ã
4.10 User Microposts ã®ãã¤ã¯ããã¹ãä½æãåé¤æã® user_id éä¿¡
user_id ã¯éä¿¡ããã«ããã°ã¤ã³ãã¦ããã¦ã¼ã¶æ å ±ããåå¾ããæ¹ãããã§ããæå³çã«ä½ããã HTTP ãªã¯ã¨ã¹ãã«ãã£ã¦ä»ã®ã¦ã¼ã¶ã®ãã¼ã¿ãä½æ/åé¤ã§ãã¦ãã¾ãããã§ãã
æå¾ã«
ãã¨ã¼ãã£ã¼ã®ã¢ããªã¨-ã¢ã©ã³ããã¯ã®é¬éè¡å¸«ãã¯ç¾æç¹(2016/01)ã«ããã Elixir/Phoenix ã«é¢ããæè¯ã®æ¥æ¬èªæ¸ç±ã§ããä½æ ãªã PowerAssertEx ã«ã¤ãã¦ã®ç« ããã£ãããããã§ã¯ãªããElixir ã«é¢ããæ¥æ¬èªæ¸ç±ã¨ãã¦ã¯æããååºã§ãããã(ããä»ã«ãã£ããæãã¦ãã ãã)ãæ¥æ¬èªã§ã®åãã¦ã®æ¸ç±ã¨ããç´ æ´ããã試ã¿ã«ã¢ãããã®ãæãã¾ããElixir çéã¯æ´æ°é »åº¦ãé«ããããå·çä¸ããçºå£²ã¾ã§ã®æ´æ°ã¸ã®ãã£ããã¢ããã¯ç¸å½å¤§å¤ã ã£ããããªã¨æããã¾ããçºå£²å¾æ©é Elixir 1.2.0 ãåºãããPhoenix 1.1.1 ãåºããã¨è½ã¡çããè¦ãã¦ãããªã Elixir çéã§ãããé»åæ¸ç±ã®æ¹ã§ã¯è¿½å¾ããããã¨èããã®ã§ãæ°ã«ãªãæ¹ã¯ãã¡ãããè³¼å ¥ããã¨ããã¨æãã¾ãã
http://hayabusa333.tumblr.com/
èè ã®ãäºæ¹ãç´ æ´ãããæ¸ç±ããããã¨ããããã¾ãã