1. Rubyãšã¯ïŒ
Rubyã¯ãå€ãã®ããã°ã©ããŒãéçºè ã«æãããŠããããã°ã©ãã³ã°èšèªã®äžã€ã§ãããã®é åãç¹åŸŽãç解ããããã«ã¯ãRubyãã©ã®ãããªèæ¯ã§èªçããã®ãããããŠãã®åºæ¬çãªç¹åŸŽã¯äœããç¥ãããšãéèŠã§ãã
1.1 Rubyã®èªçèæ¯
1990幎代åé ãæ¥æ¬ã®ããã°ã©ããŒã§ãããŸã€ããšããã²ãæ°ã«ãã£ãŠRubyã¯çã¿åºãããŸããã圌ã®ç®çã¯ãã·ã³ãã«ã§äººéäžå¿ã®ããã°ã©ãã³ã°èšèªãäœæããããšã§ããããã®çµæãRubyã¯éåžžã«çŽæçã§èªã¿ãããã³ãŒããæã€èšèªãšããŠèªçããŸããããŸã€ããšæ°ã¯ãä»ã®èšèªã®è¯ãéšåãåãå ¥ãã€ã€ãæ°ããã¢ã€ãã£ã¢ãæŠå¿µãåãå ¥ããŠRubyãèšèšããŸããã
1.2 Rubyã®åºæ¬çãªç¹åŸŽ
Rubyã®æãé¡èãªç¹åŸŽã¯ããã®ã·ã³ãã«ããšçŽæçãªææ³ã§ããããã«ãããåå¿è ã§ãæ¯èŒççãæéã§Rubyã®åºæ¬ãåŠã¶ããšãã§ããŸãããŸããRubyã¯ãªããžã§ã¯ãæåã®èšèªã§ãããããã«ããããŒã¿ãšæ©èœãäžã€ã®åäœã«ãŸãšããããšãã§ããŸãããã®ç¹æ§ã¯ã倧èŠæš¡ãªããã°ã©ã ã®éçºãã¡ã³ããã³ã¹ã容æã«ããŸãã
2. Rubyã®é åãšç¹åŸŽ
ããã°ã©ãã³ã°èšèªã¯å€çš®å€æ§ã«ååšããŸãããRubyã¯ãã®äžã§ãç¹ã«å€ãã®éçºè ããæãããŠããŸãããã®çç±ã¯ãRubyãæã€ç¬ç¹ã®é åãšç¹åŸŽã«ãããŸãã
2.1 ã·ã³ãã«ã§ããããããææ³
Rubyã®æ倧ã®é åã®äžã€ã¯ããã®ã·ã³ãã«ã§ããããããææ³ã§ããå€ãã®ããã°ã©ãã³ã°èšèªãè€éãªææ³ãç¬èªã®ã«ãŒã«ãæã€äžãRubyã¯çŽæçã«ç解ããããææ³ãæã£ãŠããŸããããã«ãããåããŠããã°ã©ãã³ã°ãåŠã¶äººã§ããRubyã®ã³ãŒããèªãããšã§ãã®æå³ãããã«ææ¡ããããšãã§ããŸãããŸãããã®ã·ã³ãã«ãã¯ã³ãŒãã®å¯èªæ§ãé«ããä»ã®äººãæžããã³ãŒããç解ããããããŸãã
2.2 ãªããžã§ã¯ãæåã®åŒ·ã¿
Rubyã¯ãªããžã§ã¯ãæåã®ããã°ã©ãã³ã°èšèªãšããŠèšèšãããŠããŸããããã¯ãããŒã¿ãšæ©èœãäžã€ã®ããªããžã§ã¯ãããšããŠãŸãšããããšãã§ãããšããç¹æ§ãæå³ããŸãããªããžã§ã¯ãæåã®ã¢ãããŒãã¯ã倧èŠæš¡ãªããã°ã©ã ã®éçºãã¡ã³ããã³ã¹ã容æã«ããã³ãŒãã®åå©çšæ§ãé«ããŸããç¹ã«ãè€éãªã·ã¹ãã ãã¢ããªã±ãŒã·ã§ã³ãéçºããéã«ããã®ç¹æ§ã¯éåžžã«æå¹ã§ãã
2.3 é«ãæ¡åŒµæ§ãšæè»æ§
Rubyã®ããäžã€ã®å€§ããªç¹åŸŽã¯ããã®é«ãæ¡åŒµæ§ãšæè»æ§ã§ããRubyã¯åçãªåä»ããæ¡çšããŠãããããã«ããéçºè ã¯æè»ã«ã³ãŒããæžãããšãã§ããŸãããŸããRubyã®ã³ãã¥ããã£ã¯éåžžã«æŽ»çºã§ãå€ãã®ã©ã€ãã©ãªããã¬ãŒã ã¯ãŒã¯ãæäŸãããŠããŸããããã«ãããæ§ã ãªçšéãããŒãºã«å¿ããŠRubyãã«ã¹ã¿ãã€ãºããããšãã§ããŸãã
ãããã®ç¹åŸŽãåããããšãRubyã¯åå¿è ããçµéšè±å¯ãªéçºè ãŸã§ãå¹ åºãå±€ã®äººã ã«éžã°ããçç±ãããããŸããã·ã³ãã«ã§ããããããææ³ããªããžã§ã¯ãæåã®åŒ·ã¿ããããŠé«ãæ¡åŒµæ§ãšæè»æ§ããRubyã®é åãšç¹åŸŽã圢æããŠããŸãã
3. Rubyã®äž»ãªçšé
Rubyã¯ãã®æè»æ§ãšåŒ·åãªæ©èœã«ãããããŸããŸãªçšéã§å©çšãããŠããŸãããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyãã©ã®ãããªåéããããžã§ã¯ãã§æŽ»èºããŠããã®ãã詳ãã解説ããŸãã
3.1 WebãµãŒãã¹ã»ãµã€ãå¶äœ
Rubyã¯WebãµãŒãã¹ããµã€ãã®å¶äœã«éåžžã«é©ããŠããŸããç¹ã«ãRuby on Railsãšãããã¬ãŒã ã¯ãŒã¯ã䜿çšããããšã§ãå¹ççã«é«å質ãªWebãµã€ããã¢ããªã±ãŒã·ã§ã³ãéçºããããšãã§ããŸãããã®ãã¬ãŒã ã¯ãŒã¯ã¯ãConvention over Configurationããšããååã«åºã¥ããŠãããéçºè ãå€ãã®èšå®ãã³ãŒããæžãæéãçãããšãã§ããŸãã
3.2 Webã¢ããªéçº
Webã¢ããªã±ãŒã·ã§ã³ã®éçºãRubyã®äž»ãªçšéã®äžã€ã§ããRubyã®ã·ã³ãã«ãªææ³ãè±å¯ãªã©ã€ãã©ãªããè¿ éãªéçºããµããŒãããŸãããŸããRuby on Railsãã¯ãããšããå€ãã®ãã¬ãŒã ã¯ãŒã¯ãååšãããããæ©èœçãªWebã¢ããªã±ãŒã·ã§ã³ãçæéã§æ§ç¯ããããšãå¯èœã§ãã
3.3 ã¹ããã¢ããªéçº
è¿å¹Žãã¹ããã¢ããªã®éçºã«ãRubyãå©çšãããããšãå¢ããŠããŸãããRubyã䜿çšããããšã§ãiOSãAndroidã®ã¢ããªãå¹ççã«éçºããããšãã§ããŸããç¹ã«ãRubyMotionãšããããŒã«ã䜿çšãããšãRubyã®ã³ãŒãããã€ãã£ãã¢ããªã®ã³ãŒãã«å€æããããšãã§ããäžåºŠã®éçºã§è€æ°ã®ãã©ãããã©ãŒã ã«å¯Ÿå¿ããã¢ããªããªãªãŒã¹ããããšãå¯èœãšãªããŸãã
3.4 APIéçºãšã¹ã¯ã¬ã€ãã³ã°
Rubyã¯APIã®éçºãWebã¹ã¯ã¬ã€ãã³ã°ã®åéã§ãåªããããã©ãŒãã³ã¹ãçºæ®ããŸããRubyã®ã©ã€ãã©ãªãGemãšåŒã°ããããã±ãŒãžã«ã¯ãAPIã®éçºãããŒã¿ã®ååŸãå©ããå€ãã®ããŒã«ãå«ãŸããŠããŸããããã«ãããããŒã¿ã®åéãå€éšãµãŒãã¹ãšã®é£æºãç°¡åã«å®çŸããããšãã§ããŸãã
以äžã®ããã«ãRubyã¯ãã®ç¹æ§ãæ©èœã掻ãããŠãå€å²ã«ãããåéã§ã®éçºã«å©çšãããŠããŸãããããã®çšéãç¥ãããšã§ãRubyã®å¯èœæ§ã掻çšæ¹æ³ãããæ·±ãç解ããããšãã§ããŸãã
4. RubyãšRuby on Railsã®é¢ä¿
ããã°ã©ãã³ã°ã®äžçã§ãRubyããšããèšèãèããšãå€ãã®äººããRuby on Railsããšãããã¬ãŒã ã¯ãŒã¯ã®ããšãæãæµ®ãã¹ãã§ããããå®éãRubyãšRuby on Railsã¯å¯æ¥ã«é¢é£ããŠããŸãããããããç°ãªããã®ã§ãããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyãšRuby on Railsã®é¢ä¿ãšããªãRuby on Railsãããã»ã©ãŸã§ã«äººæ°ãéããŠããã®ãã詳ãã解説ããŸãã
4.1 Ruby on Railsãšã¯
Ruby on RailsãéåžžãRailsããšãåŒã°ãããã¯Rubyã§æžããããªãŒãã³ãœãŒã¹ã®Webã¢ããªã±ãŒã·ã§ã³ãã¬ãŒã ã¯ãŒã¯ã§ããRailsã¯ãConvention over ConfigurationãïŒèšå®ããèŠçŽïŒãšãDon’t Repeat YourselfãïŒç¹°ãè¿ããé¿ããïŒãšãã2ã€ã®äž»èŠãªååã«åºã¥ããŠèšèšãããŠããŸããããã«ãããéçºè ã¯åé·ãªèšå®ãã³ãŒãã®èšè¿°ãé¿ããããšãã§ããè¿ éãã€å¹ççã«ã¢ããªã±ãŒã·ã§ã³ãéçºããããšãå¯èœãšãªããŸãã
Railsã¯ãããŒã¿ããŒã¹ã®ã¹ããŒãèšèšãWebããŒãžã®ã¬ã³ããªã³ã°ããŠãŒã¶ãŒèªèšŒãªã©ãWebã¢ããªã±ãŒã·ã§ã³éçºã«å¿ èŠãªå€ãã®æ©èœãæäŸããŠããŸããããã«ãããéçºè ã¯åºæ¬çãªæ©èœã®å®è£ ããå§ããããšãªããæ¬æ¥ã®ããžãã¹ããžãã¯ã®éçºã«éäžããããšãã§ããŸãã
4.2 ãªãRuby on Railsã人æ°ãªã®ã
Ruby on Railsã®äººæ°ã®çç±ã¯ããã€ããããŸãããŸããéçºã®è¿ éæ§ãæããããŸããRailsã®ãConvention over Configurationãã®ååã«ãããéçºè ã¯å€ãã®èšå®ãçç¥ã§ããã¢ããªã±ãŒã·ã§ã³ã®ãããã¿ã€ããçæéã§äœæããããšãã§ããŸããããã¯ãã¹ã¿ãŒãã¢ããäŒæ¥ãæ°ãããããžã§ã¯ããè¿ éã«ç«ã¡äžãããéçºè ã«ãšã£ãŠãéåžžã«é åçã§ãã
ãŸããRuby on Railsã¯è±å¯ãªã©ã€ãã©ãªãGemãšåŒã°ããããã±ãŒãžãååšããŸããããã«ãããæ§ã ãªæ©èœãæ¡åŒµãç°¡åã«è¿œå ããããšãã§ããŸããããã«ãRailsã®ã³ãã¥ããã£ã¯éåžžã«æŽ»çºã§ãå€ãã®æ å ±ããµããŒããæäŸãããŠããŸãããã®ãããªèæ¯ãããRuby on Railsã¯äžçäžã®å€ãã®éçºè ãäŒæ¥ã«æ¡çšãããŠããŸãã
ç·ããŠãRubyãšRuby on Railsã¯ããããç¬èªã®é åãšç¹åŸŽãæã£ãŠããŸãããäž¡è ã®çµã¿åããã«ãããå¹ççã§é«å質ãªWebã¢ããªã±ãŒã·ã§ã³ã®éçºãå¯èœãšãªã£ãŠããŸãã
5. Rubyã®åŠã³æ¹ãšé²ãæ¹
ããã°ã©ãã³ã°èšèªãåŠã¶éãæåã®äžæ©ãæãé£ãããšèšãããŸããRubyãäŸå€ã§ã¯ãããŸãããããããé©åãªã¢ãããŒããšãªãœãŒã¹ãç¥ã£ãŠããã°ãåŠç¿ã®ããã»ã¹ã¯æ Œæ®µã«ã¹ã ãŒãºã«ãªããŸãããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyãåŠã¶éã®ãã€ã³ããããããã®ãªãœãŒã¹ãå®è·µçãªãããžã§ã¯ãã®ææ¡ã«ã€ããŠè§£èª¬ããŸãã
5.1 åå¿è ãå§ããåã«ç¥ã£ãŠããã¹ãããš
ãŸããRubyãåŠã¶åã«ç¥ã£ãŠããã¹ãæãéèŠãªããšã¯ãç¶ç¶çãªåŠç¿ã®éèŠæ§ã§ããæ¯æ¥å°ããã€åŠã¶ããšã§ãç¥èãå®çãããããªããŸãããŸããããã°ã©ãã³ã°ã¯å®è·µçãªã¹ãã«ã§ãããããåŠãã ããšãããã«å®éã®ã³ãŒãã«åãå ¥ããããšãéèŠã§ãã
次ã«ãRubyã®åºæ¬çãªææ³ãæŠå¿µãç解ããããšã倧åã§ããå€æ°ãé åãã¡ãœãããªã©ã®åºæ¬çãªæŠå¿µããã£ãããšç解ããããšã§ãããé«åºŠãªãããã¯ãžã®ç§»è¡ãã¹ã ãŒãºã«ãªããŸãã
5.2 ããããã®åŠç¿ãªãœãŒã¹ãšåèæž
RubyãåŠã¶ããã®ãªãœãŒã¹ã¯æ°å€ãååšããŸãããç¹ã«ãããããªã®ã¯å ¬åŒããã¥ã¡ã³ãããªã³ã©ã€ã³ãã¥ãŒããªã¢ã«ã§ããå ¬åŒããã¥ã¡ã³ãã¯æãä¿¡é Œæ§ãé«ããææ°ã®æ å ±ãæ²èŒãããŠããŸãããŸããå€ãã®ãªã³ã©ã€ã³ãã¥ãŒããªã¢ã«ã¯åå¿è åãã«äœæãããŠãããæãåãããªããåŠã¶ããšãã§ããŸãã
åèæžã«é¢ããŠã¯ããããã°ã©ãã³ã°RubyãããRuby on Railsãã¥ãŒããªã¢ã«ããªã©ãå€ãã®åªããæžç±ãååšããŸãããããã®æžç±ã¯ãåºæ¬çãªå 容ããå¿çšçãªå 容ãŸã§å¹ åºãã«ããŒããŠãããæ·±ãç解ãåŸãã®ã«åœ¹ç«ã¡ãŸãã
5.3 å®è·µçãªãããžã§ã¯ãã®ææ¡
Rubyã®åŠç¿ãé²ããäžã§ãå®éã«äœããäœæããããšã¯éåžžã«æå¹ã§ããäŸãã°ãç°¡åãªWebã¢ããªã±ãŒã·ã§ã³ãã¿ã¹ã¯ç®¡çããŒã«ã®éçºãªã©ãèªåã®èå³ãããŒãºã«åãããŠãããžã§ã¯ããéžã¶ããšãã§ããŸãããŸãããªãŒãã³ãœãŒã¹ã®ãããžã§ã¯ãã«åå ããããšã§ãå®éã®éçºã®çŸå Žã§ã®çµéšãç©ãããšãå¯èœã§ãã
6. Rubyã®å°æ¥æ§ãšåžå Žã®éèŠ
ããã°ã©ãã³ã°èšèªã®éžæã¯ããã®èšèªã®æè¡çãªç¹æ§ã ãã§ãªããåžå Žã®éèŠãå°æ¥æ§ã«ã圱é¿ãããŸããRubyã¯ãã®ç¬ç¹ã®é åãšå ±ã«ãå€ãã®äŒæ¥ããããžã§ã¯ãã§ã®æ¡çšå®çžŸãæã£ãŠããŸãããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyã®å°æ¥æ§ãåžå Žã§ã®éèŠã«ã€ããŠè©³ãã解説ããŸãã
6.1 åœå å€ã§ã®æ¡çšå®çžŸ
Rubyã¯ãåœå å€ã®å€ãã®äŒæ¥ããããžã§ã¯ãã§æ¡çšãããŠããŸããç¹ã«Ruby on Railsã®ç»å Žä»¥éãã¹ã¿ãŒãã¢ããäŒæ¥ãäžå¿ã«ãè¿ éãªéçºãæ±ãããããããžã§ã¯ãã§ã®æ¡çšãå¢ããŠããŸããæµ·å€ã§ã¯ãTwitterãGitHubãAirbnbãªã©ã®å€§æäŒæ¥ãRubyãRuby on Railsãæ¡çšããŠããããã®å®çžŸã¯éåžžã«é«ãè©äŸ¡ãåããŠããŸãã
åœå ã§ããå€ãã®WebãµãŒãã¹ãã¢ããªã±ãŒã·ã§ã³ãRubyãããŒã¹ã«éçºãããŠããŸãããã®ãããªæ¡çšå®çžŸã¯ãRubyã®æè¡çãªåªããç¹ã ãã§ãªããã³ãã¥ããã£ã®æŽ»çºããè±å¯ãªã©ã€ãã©ãªãæè²ãªãœãŒã¹ã®ååšã«ãæ¯ããããŠããŸãã
6.2 Webéçºåéã§ã®éèŠ
Webéçºåéã«ãããRubyã®éèŠã¯ãä»åŸãé«ãŸããšäºæ³ãããŸããç¹ã«Webã¢ããªã±ãŒã·ã§ã³ã®éçºãAPIã®æ§ç¯ã«ãããŠãRubyãRuby on Railsã®æ¡çšãé²ãããšãæåŸ ãããŠããŸããRubyã®ã·ã³ãã«ã§çŽæçãªææ³ã¯ãæ°ããæè¡ããã¬ã³ããè¿ éã«åãå ¥ããããšãå¯èœã«ããŸãããŸããRubyã®ã³ãã¥ããã£ã¯éåžžã«æŽ»çºã§ãæ°ããæè¡ãããŒã«ã®æ å ±äº€æãçãã«è¡ãããŠããŸãã
ãã®ãããªèæ¯ãããWebéçºåéã«ãããRubyã®éèŠã¯ãä»åŸãç¶ç¶çã«é«ãŸããšäºæ³ãããŸããRubyãåŠã¶ããšã¯ãçŸåšã®åžå Žã§ã®ç«¶äºåãé«ããã ãã§ãªããå°æ¥ã®ãã£ãªã¢å±æã«ãå¯äžããã§ãããã
ç·ããŠãRubyã¯ãã®æè¡çãªé åãšåžå Žã§ã®é«ãéèŠã«ãããä»åŸãå€ãã®éçºè ãäŒæ¥ã«éžã°ãç¶ããããšã§ãããã
7. ãŸãšã
Rubyã¯ããã®èªçããçŸåšã«ãããŠãå€ãã®éçºè ãäŒæ¥ã«æããç¶ããŠããããã°ã©ãã³ã°èšèªã§ãããã®èšäºãéããŠãRubyã®é åãç¹åŸŽãåŠã³æ¹ããããŠåžå Žã§ã®éèŠã«ã€ããŠæ·±ãæ¢ãããšãã§ããŸããã
ãŸããRubyã®ã·ã³ãã«ã§äººéäžå¿ã®èšèšææ³ã¯ãåå¿è ããçµéšè±å¯ãªéçºè ãŸã§ãå€ãã®äººã ã«ãšã£ãŠé åçã§ãããŸããRuby on Railsãšãã匷åãªãã¬ãŒã ã¯ãŒã¯ãšã®çµã¿åããã«ãããè¿ éãªWebã¢ããªã±ãŒã·ã§ã³ã®éçºãå¯èœãšãªã£ãŠããŸãã
次ã«ãRubyãåŠã¶éã®ã¢ãããŒãããªãœãŒã¹ã«ã€ããŠã觊ããŸãããç¶ç¶çãªåŠç¿ãšå®è·µãéããŠãRubyã®æ·±ãç解ãåŸãããšãã§ããŸãããŸããåœå å€ã§ã®æ¡çšå®çžŸãWebéçºåéã§ã®é«ãéèŠã¯ãRubyã®å°æ¥æ§ã瀺ããã®ãšèšããã§ãããã
æåŸã«ãRubyã®åŠç¿ããã£ãªã¢å±æã«é¢ããŠãäžã€ã®èšèªã«çžãããããšãªããåžžã«æ°ããæè¡ããã¬ã³ãã«ã¢ã³ããã匵ãç¶ããããšãéèŠã§ããããããRubyã®æã€ç¬ç¹ã®é åãå²åŠããããŠåŒ·åãªã³ãã¥ããã£ã®ãµããŒãã¯ãä»åŸãå€ãã®éçºè ã«ãšã£ãŠå€§ããªé åãšãªãã§ãããã
ãã®èšäºããRubyã«é¢ããç¥èãèå³ãæ·±ããäžå©ãšãªãã°å¹žãã§ãã