ãããžã§ã¯ãã®éçºè ãšããŠãããªãã¯å°æ¥ã®éçºè ã®ããŒãºãäºæž¬ããäžè©±ãããã®ã«å¯èœãªéãæé«ã®ç«å Žã«ããŸãã ç§ãã¡ã®ãããžã§ã¯ãã§ç§ãã¡ãäžãè¯ã決å®ã¯ãã¹ãŠããã®çç£æ§ã«æ³¢åå¹æããããããŸãã ãªããããéèŠãªã®ã§ããïŒ Bob MartinãClean Codeã§å°ããŠããããã«ããæªãã³ãŒãã§åé¡ãçºçããããšã¯ãããŸããïŒ ã§ã¯ããªããããæžããŠããã®ã§ããïŒã å°æ¥ãããžã§ã¯ãã«åãçµãããŒã ã®äžä»£ã®æ¡ä»¶ãæ¹åããã®ãšåãæŠç¥ããçŸåšã®ããŒã ã«åœ¹ç«ã¡ãŸãã 6ãæåã«ç«ã¡åŸçããã³ãŒãã®æãé ã«æ»ããšãFuture DeveloperãåããŠç®ã«ãããšãã«ç¥ãããããããå°ã詳ããç¥ã£ãŠããŸãã ããªããä»ã®éçºè ã«ä»»ãããã³ããšå æ²¢ãããããªãèªèº«ãå°æ¥å©çãåŸãã§ãããã ç¶æ ãæªããããŒã ã®æ¯æžã«ã€ãªããè²¢ç®ãé£ãããããžã§ã¯ãã äœæããŠãã補åã®å質ãšå°æ¥ã®ãµããŒãã®å®¹æãã«æè³ããããšã¯ãæªæ¥ãšçŸåšã®ããã®å¹žãã§çç£çãªè·å Žãžã®æè³ã§ãã
Future DeveloperãçŽæ¥æåã«å°ãããã«äœ¿çšã§ããããã€ãã®ãã©ã¯ãã£ã¹ïŒç¹å®ã®é åºãªãïŒãäœæããããšæããŸãã
1.å šäœçãªãªãã¡ã¯ã¿ãªã³ã°
ãããžã§ã¯ããå€ããªããèŠä»¶ãè€éã«ãªãã«ã€ããŠããã®è€éããå¶åŸ¡ããããã«æ°ãããã¿ãŒã³ãšææ³ãé©çšããããåªããŠããŸãã ãã¿ãŒã³ãŸãã¯ã¢ãããŒããå²ãåœãŠãããã¿ã¹ã¯ã«å¯ŸåŠãããã©ãããããã«èšãããšã¯ã§ããŸããã ã»ãšãã©ã®å Žåãå¥ã®éçºè ãã³ãŒãã®ãã®éšåãå€æŽããªããã°ãªããªããšãã«ããã®éèŠæ§ã®ç¢ºèªãŸãã¯åè«ãçŸããŸãã ãããã®ãã¿ãŒã³ã¯ãåé¡ã解決ããããã«åãå ¥ããããåæã«æé·ããå ŽåããããŸãã
ããã«ã¯å€§ããªå©ç¹ããããŸããããã¯ç§ãã¡ã®æå³ã説æããŠããŸãã åæ§ã®æ¹æ³ã§ã³ãŒãã®åé¡ã解決ããããšãããšãå°æ¥ã®éçºè ã¯ã³ãŒãã®æçãã©ã®ããã«é£æºããããäºæž¬ãå§ããããã«ãã£ãŠèšºæãšå€æŽã«å¿ èŠãªæéãççž®ã§ããŸãã
å€ãã®å Žåãç§ãã¡ãäºçŽããŠããã®ã¯ãåæã«è³ããªãã£ãããå€ããŽãã®ãããªã³ãŒãã§ç¡èŠããããããŠããªããã¿ãŒã³ã®ããã·ã¥ããã·ã¥ã§ãã ããã¯ããŸããŸãªçç±ã§çºçããŸããåãå ¥ããããå¥çŽããããžã§ã¯ãã®ä»ã®é åã«é©çšãããã»ã©ããŸãæ©èœããªãããæ°ããéçºè ãç®æšãéæããããã®é©åãªå¥çŽãŸãã¯ãã¿ãŒã³ã®ååšãç¥ããªãã£ãå¯èœæ§ããããŸãã
Ruby on Railsã®å éšã«ã¯ãå€ãã®åŒ·åãªãã¥ãŒãšèŠåã確ç«ãããŠããŸãã ããã«ãããéçºè ã¯ãããžã§ã¯ãã«æ¥ç¶ããããã«çç£æ§ãé«ããããšãã§ããŸãïŒãã ãã以åã«ãã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããçµéšãããã°ïŒã æã ãç§ãã¡ã¯ãããã®åæãç¡èŠããããã«ãã£ãŠãããã®åŒ·ãã匱ããŸãã ããšãã°ãééãããžã§ã¯ãã§ã¯ãããã€ãã®ç°ãªãã¹ã¿ã€ã«ã§æ§ç¯ãããã³ã³ãããŒã©ãŒã«å®æçã«æ°ä»ãããšãã§ããŸãã
resource_controller
ãããªãã®ã䜿çšããŠäœæããããã®ãããã°ãRailsã§æ¡çšãããŠããæšæºã®
resource_controller
èŠåã«åŸããã®ãããã°ãã©ã³ãã ã¢ã¯ã·ã§ã³ããã®åãªããŽããã³ãã§ãã å¥ã®äžè¬çãªã¢ã³ããã¿ãŒã³ã¯ãããžã§ã¯ãå šäœã«æ£ãã°ããå¯èœãªå Žåã¯ã©ãã§ãæ§æããŒã¿ãåæåããŸãã
ã·ã¹ãã ãæ§æããããã«åããŒã¹ã®ç°ãªãæ¹æ³ããµããŒãããå¿ èŠã¯ãªãããããžã§ã¯ãå ã§ã©ã®ååãæ§ç¯ããå¿ èŠããããã«ãã£ãŠãã·ã¹ãã ãæ確ãã€ç解å¯èœã«ããå¿ èŠã¯ãããŸããã 1ã€ã®ã¢ãããŒããè©ŠããŠåãå ¥ããåŸãæéããããŠå€ãã³ãŒãã«æ»ããæ°ããæ¹æ³ã§ãªãã¡ã¯ã¿ãªã³ã°ããŸãã ããã¯ãarbitraryæçãªå¶éã課ãå¿ èŠããããšããæå³ã§ã¯ãããŸããã ããšãã°ãæ§æã®äžéšããããžã§ã¯ãå ã«ä¿æããç°å¢å€æ°ã«äžéšãé 眮ããŠå±éãæ¯æŽããããšã¯çã«ããªã£ãŠããŸãããåæã«ãæ§æããŒã¿ã䜿çšããããã®1ã€ã®å ±éã®æ§é ãšã¢ã¯ã»ã¹ãã¿ãŒã³ãå¿ èŠã§ãã
READMEãŸãã¯ããã¥ã¡ã³ããªããžããªã«å¥çŽãè¿œå ããŸãã æåã«ãããã«ãããå°æ¥ã®éçºè ãã·ã¹ãã ã«æ°ããæ©èœãè¿œå ãããããªããã³ã³ããŒãã³ãã®æ§ç¯æ¹æ³ãç解ã§ããããã«ãªããŸãã
2.ãããã³ãŒããæ ¹çµ¶ãã
ãã°ããã®éãã§ã«ååšããŠããã·ã¹ãã ã®ãã1ã€ã®äžè¬çãªæ©èœã¯ããããã³ãŒãã®åœ¢ã®èã®å±€ã§ãã ãããã¯ãããžã§ã¯ãã®ã³ã³ããŒãã³ãã§ããã以åã¯ããžãã¹ã«ãšã£ãŠéèŠã§ããããæ代é ãã§ãããé·ãé誰ãå¿ èŠãšããŸããã§ããã ã»ãšãã©ã®å Žåããããžã§ã¯ãã§ã¯ãæ©èœã®ãã®ãããªéšåããã§ãã¯ãããã«ã¹ã¿ãã¯åãå ¥ããã¹ããå€æ°èŠã€ããããšãã§ããŸããããããã®ãã¹ãã¯æ®ãã®ééãé ãããã ãã§ãã
ãã®æ©èœãäºåºŠãšéèŠã«ãªããªãããšãåžžã«ç¢ºä¿¡ã§ãããšã¯éããªãããããã®ãããªã³ãŒããåé€ãããããªãããšããããŸãã çµå¶è ã«å°ãããšãããã€ãé¢ããŠããã€ã䟿å©ã«ãªããŸãããšãã質åã«çããŸãã ããã¯ééã£ããžã¬ã³ãã§ã-å°æ¥çã«ã¯æã®ã¹ãããã ãã§åã³äœ¿çšã§ããå¯èœæ§ãããããããã£ãããšè æããã³ãŒããç¶æããå¿ èŠããããŸãã ãã®ã³ãŒããç¡é¢ä¿ã§ããããã«ãã®ã³ãŒãããã€ãã¹ããå Žåãæãã¯ãªãã¯ããã ãã§ã倧ããªåŽåããããã«æ©èœããããã«ãªãå¯èœæ§ã¯äœããªããŸãã ããªãã¯å€ãã³ãŒããããªããäžçªäžã«åŒã£åŒµã£ãŠãããããµããŒãããã®ã«æéãè²»ããããšãå¿é ããŠããŸããããã¯ãã€ããããå¿ èŠã«ãªããšããããããªå¯èœæ§ãããããã§ãã ãã¶ãã æ°ã¥ããŸããããããã«å€ãã®æéãè²»ããããã®ãããªã³ãŒããåé€ãã代ããã«ããªããžããªã§ãã£ãããšè æãããŸãã
ãããããã®ã³ãŒãã®ååšã¯ãå°æ¥ã®éçºè ã«ãšã£ãŠæœåšçãªãã©ããã«ãªãããšãããã«ç ç²ã«ããŸãã ããã¯ãå®éã«çããŠããã·ã¹ãã ã®ã³ã³ããŒãã³ããã泚æãããããã·ã¹ãã ã®ããåŽé¢ãç解ãŸãã¯ãããã°ããããšãããšã誀ã£ããã¬ãŒã¹ã«ã€ãªããå¯èœæ§ããããŸãã ç·æ¥äºæ ã§ã¯ããã¹ãŠãèœã¡ããšãããããã³ãŒãã¯è²Žéãªæéãè²»ããããã«ãã°ããåŸ ã€ãã€ãºã§ãã ãªããžããªã§é¢é£æ§ã®ãã掻çºã§å®éã«æ©èœããã³ãŒãã®ã¿ããµããŒãããããšã«ããããããžã§ã¯ãããµããŒãããããã®å šäœçãªã³ã¹ããåæžããå°æ¥ã®éçºè ãã·ã¹ãã å šäœãããéãç解ã§ããããã«ããŸãã
é·ãéæŸæ£ãããŠããã³ãŒããåé€ããŸãã æçµçã«ã¯ãåŸã§æ»ãå¿ èŠãããå Žåã«åããŠãããŒãžã§ã³ç®¡çäžã«ãããŸãã ãåŸã§åœŒã«æ»ããå¿ èŠæ§ã«ã ãŸãããŠã¯ãããŸããã ãã®ã³ãŒãã«ãªãããã®æå³ãããå Žåããªã䜿çšãããªããªã£ãã®ã§ããïŒ
3.æ å ±ãéä¿¡ãã
å®éãç§ãã¡ã®ãããžã§ã¯ãã«å ããŠãã³ãŒããæžãããã«äœ¿çšããããŒã«ã®ããã€ãã«ãææç©ããããŸãã ããšãã°ãgit commitã§è¯ãã¡ãã»ãŒãžã®è¡çç¶æ ãæ§æãããã®ã«ã€ããŠã¯ãå€ãã®åãå ¥ããããæ £è¡ããããŸããããããžã§ã¯ãã¯ãŸã ãã®ãããªã³ãããã¹ããŒãªãŒãåéããŠããŸãã
jp@oeuf:~/workspace/blog(master*)$ git log --oneline app/controllers/application_controller.rb 8ec7f99 fuck i dunno lol ffa919a shut up, atom parser a33e9fa fixing again cecc9dc one more time 968a28f fixing 3e3aeb2 ws 1fc597e pagination edea155 adding dumb feature
å°æ¥ã®éçºè ãå¿ ç¶çã«git blameã䜿çšããŠãã®æ©èœã®ã³ã³ããã¹ããç解ããããã«ãªãå Žåã¯ããã¡ã€ã«ã§å®éã«äœãèµ·ãã£ãŠããã®ããç解ããã®ã«åœ¹ç«ã€è©³çŽ°ã圌ã«æ®ããŠãã ããã
--squash
ã
commit --amend
ã
rebase
ããã³ãã®ä»ã®ããŒã«ã䜿çšããŠããã©ã³ããçµ±åããåã«ã³ãããã䜿çšå¯èœãªç¶æ ã«ããŸãã å®äºãããã³ããããæžãçŽããŸããé©åã§ãããšæããããã¹ãŠã®ãã®ãå«ããŠãå®äºããäœæ¥ãèŠçŽããŠãã ããã æ£ããææ³ãšã€ã¥ãã ä»ã®äººãèªãã§ç解ããå¿ èŠããããã®ãå ¬éããŠããŸãã Future Developerã«ãµãŒãã¹ãæäŸããå¿ èŠãªè©³çŽ°ãå«ãããããããèšé²ã確ä¿ããŠãã ããã
jp@oeuf:~/workspace/blog(master*)$ git log app/controllers/application_controller.rb commit 8ec7f998fb74a80886ece47f0a51bd03b0460c7a Author: John Pignata <john@pignata.com> Date: Sat Nov 3 14:11:12 2012 -0400 Add Google Analytics helper commit 968a28f366e959081307e65253118a65301466f2 Author: John Pignata <john@pignata.com> Date: Sat Nov 3 13:49:50 2012 -0400 Correct ATOM feed validation issues Using the W3C Validator (http://validator.w3.org/appc/), a few trivial errors were reported: * <author> should have a <name> node within it and not text * Timestamps should be in ISO8601 format This change fixes these issues and improves the spec coverage for the XML document. commit 3e3aeb27ea99ecd612c436814c5a2b0dab69c2c3 Author: John Pignata <john@pignata.com> Date: Sat Nov 3 13:46:24 2012 -0400 Fixing whitespace We're no longer indenting methods after `private` or `protected` directives as a matter of style. This commit fixes whitespace in all remaining classes. commit 1fc597e788442e8cc774c6d11e7ac5e77b6c6e14 Author: John Pignata <john@pignata.com> Date: Sat Nov 3 12:34:50 2012 -0400 Implement Kaminari pagination Move from will_paginate to kaminari in all controllers. The motivation is to be able to paginate simple Array collections without the monkey patching that will_paginate uses. * Consolidate helpers * Clean up whitespace commit edea15560595bab044143149a7d6e528e8ae65d2 Author: John Pignata <john@pignata.com> Date: Sat Nov 3 12:27:16 2012 -0400 Add ATOM feed for RSS readers * Include Nokogiri in Gemfile for its builder * Add AtomFieldBuilder model * Add link to feed from index page
4.ã€ã³ã¿ãŒãã§ãŒã¹ã«å æ²¢ãåãã
äžéšã®ã«ããŒã¯ããªããžã§ã¯ãå ã®èŠèŠçãªã¡ãœãããé¿ããŠããŸãã ç®çã¯äœã§ããïŒ ãšã«ãããå®éã«ã¯sendãä»ããŠã¡ãœãããåŒã³åºãããŸãã ãªããããã®ããã€ããã·ã£ãã¯ã«ããŸããïŒ ã¡ãœãããä»ã®ããŒãã«è¿œå ããã ãã§ãå°æ¥ã®éçºè ãããã䜿çšãããå Žåã¯å¯èœã§ãïŒ ç§ãã¡ã¯ã¿ããªå€§äººã§ãããïŒ
ã·ã¹ãã å ã®åãªããžã§ã¯ããåãªãã¡ãœããã®ãã³ãã§ããå Žåãåã ã®ãªããžã§ã¯ããã©ã®ããã«äœ¿çšãããã©ã®ã¡ãã»ãŒãžãæå³ãããŠããããç解ããããšã¯ãããªããå«ããŠèª°ã«ãšã£ãŠãé£ãããªããŸãã ãªããžã§ã¯ãã®ãããªãã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®èšèšã§ã¯ãã·ã¹ãã å ã®ä»ã®ãªããžã§ã¯ãããªããžã§ã¯ããšã©ã®ããã«ããåãã§ããããæ確ã«ããå¿ èŠããããŸãã ã·ã¹ãã å ã®åãªããžã§ã¯ãã®åœ¹å²ãšãããã®éã®çžäºäœçšãæããã§ãªãå Žåãåãªããžã§ã¯ããåå¥ã«ç解ããã ãã§ãªããã·ã¹ãã å šäœãç解ããã®ã«ãããæéãé·ããªããŸãã
ã€ã³ã¿ãŒãã§ãŒã¹ãå°ãããéäžãããããã«ãã§ããã ãå€ãã®ã³ã³ããŒãã³ãå éšãé衚瀺ã«ããŸãã ããããã£ã®ãããªãã¯ã€ã³ã¿ãŒãã§ã€ã¹ãæ確ã§äžè²«æ§ããããååãé©åã§ããããšã確èªããããã«ãããã«åªåããŠãã ããã ããã«ãããå°æ¥ã®éçºè ã¯ãåãªããžã§ã¯ãã®äœ¿çšæ¹æ³ã«ã€ããŠç解ããããä¿¡å·ãåãåããåãªããžã§ã¯ããåå©çšããæ¹æ³ã匷調ããŸãã ãããã®åæãäŒãããããªãã¯ã€ã³ã¿ãŒãã§ã€ã¹ã®æ確ãªå¢çãå°éããããã«ãã¡ãœããã®å¯èŠæ§ãæ瀺çã«è¿°ã¹ãŸãã
5.ã³ã¡ã³ããæ®ããŸããã»ãšãã©ã¯RDocã§ãã
éçºè ãšããŠã®ã³ãŒãå ã®ã³ã¡ã³ãã«å¯Ÿããç§ãã¡ã®ææ ã¯ãççŸããŠãããšæãæ£ç¢ºã«èª¬æã§ããŸãã äžæ¹ã§ãã³ã¡ã³ãã¯èªè ãç¹å®ã®ã³ãŒããã©ã®ããã«æ©èœããããç解ããã®ã«éåžžã«åœ¹ç«ã¡ãŸãã äžæ¹ã§ããããã®æ£ç¢ºæ§ãä¿èšŒãããã®ã¯äœããããŸãã;ã³ãŒãã«é¢ããã³ã¡ã³ãã¯ãç¿Œã§åŸ ã£ãŠããåã§ãã éçºè ã«å°ãããšã圌ãã¯ããã¥ã¡ã³ããé«ãè©äŸ¡ããŠèªãã§ãããšçããŸãããã»ãšãã©ã®ãããžã§ã¯ãã«ã¯å®éã«ã¯å°ããªãã»ãšãã©å€±ãããé¢é£æ§ã®READMEãã¡ã€ã«ãšè¿ãã®ãŠã£ãå¢ããããŸãã ããã«ããªãŒãã³ãœãŒã¹ã©ã€ãã©ãªã䜿çšããå Žåã詳现ãªRDocããã¥ã¡ã³ããæ°é®®ãªREADMEãã¡ã€ã«ãåªããã³ãŒãäŸãå¿ èŠã«ãªãããšããããããŸãã ãããŒéçºè ïŒããã¥ã¡ã³ãããµããŒãããŠããŸããããããã誰ãã圌ã®ããã«ãããããããšãæåŸ ããŠããŸãã
Single Responsibility Principleã®ãããªããšã«æ³šæãæãããªããžã§ã¯ãéã®åŒ±ãæ¥ç¶ã®ãã¿ãŒã³ã䜿çšããã»ã©ãããã°ã©ã ã®æéäžã«çµåãããå€ãã®å°ããªãªããžã§ã¯ãã§æ§æãããã·ã¹ãã ãèŠãå§ããŸãã ããã«ãããã·ã¹ãã ã¯ããæè»ã«ãªãããªããžã§ã¯ããäœåºŠã䜿ãããããªããŸããã劥åç¹ããããŸãã倧èŠæš¡ã·ã¹ãã å ã®ãªããžã§ã¯ãã®å Žæãç解ããã®ãé£ãããªããããå€ãã®åŽåãšæéãå¿ èŠã«ãªããŸãã éåžžã®ãªãã¡ã¯ã¿ãªã³ã°ææ³ããã¹ãŠé©çšããŠãé¢åãªè¡éã³ã¡ã³ããåé€ãããªããžã§ã¯ããã§ããéãèªã¿ãããããããšãã§ããŸãããã·ã¹ãã å ã§ãªããžã§ã¯ããã©ã®ããã«çžäºäœçšãããã¯ãFuture Developerãæ··ä¹±ãããå¯èœæ§ããããŸãã
RDocã¹ã¿ã€ã«ã®ããã¥ã¡ã³ãã¯ãå€ãã®ãªãŒãã³ãœãŒã¹ãããžã§ã¯ãã«ãããŸãã Googleã䜿çšããŠ
update_attribute
ãã³ãŒã«ããã¯ãåŒã³åºããã©ãããããã³
select_tag
ã·ã°ããã£ãç解ãããšãéåžžãRuby On Railsã®RDocããŒãžã衚瀺ãããŸãã ãããžã§ã¯ãã®åæ§ã®ããã¥ã¡ã³ããäœæãããšãå°æ¥ã®éçºè ã¯ãã·ã¹ãã ã®åºå€§ãªã³ã³ããã¹ãã§ãªããžã§ã¯ãã®åœ¹å²ã決å®ããããšãããšãã«ãããç解ããããšãã§ããŸãã ã¯ã©ã¹ããã³/ãŸãã¯ã¡ãœããã®äžéšã«çã宣èšæãããããšã¯ãã³ãŒãã®èªè ã«ãšã£ãŠéèŠãªããšã§ãã ãããããããã®ã³ã¡ã³ãã®é¢é£æ§ããµããŒããã確ç«ãããæåããªããã°ãã³ãŒããªãŒããŒã®èŠåœèãæãªããã€ãã¹ã®å¹æããããŸãã ããã¥ã¡ã³ããŒã·ã§ã³ã®æ¬ åŠãããæªãããšã¯ãããã¥ã¡ã³ããŒã·ã§ã³ã®è³ªãæªãããšã ãã ãšããããšãå¿ããªãã§ãã ããã
6.æå³ãæããã«ãããã¹ããäœæããŸãã
ãããžã§ã¯ãã«ããã¥ã¡ã³ããæäŸãã1ã€ã®æ¹æ³ã¯ããã¹ãã䜿çšããããšã§ãã ãã¹ãã§ã¯ãã³ã³ããŒãã³ãã®åäœãèšè¿°ããã ãã§ãªãããã®ãããªããã¥ã¡ã³ãã次ã®ããã«é«å質ã§ããããšã確èªããŸãã 圌女ã¯åŠåãããŠããŸãã ã³ã¡ã³ããšã¯ç°ãªãããã¹ãã«ãããã€ãããšã¯ã§ããŸããã ãããã¯ç·ãããã§ãªããã®ã©ã¡ããã§ãã RSpecãminitest / specãªã©ã®ããŒã«ã¯ããã®ãµã€ãããã¥ã¡ã³ãã®çæã«åœ¹ç«ã¡ããã¹ãã±ãŒã¹ãããã¯å ã®æ£æã奚å±ããŸãã æ®å¿µãªãããèµ€ç·ç·ã®ãªãã¡ã¯ã¿ãªã³ã°ãµã€ã¯ã«äžã«åäœããã³ãŒããååŸããããšããŠãéå»ã®è±èªã®åèªãèŠãããšããããŸãã è±èªã®èšè¿°ãç¡èŠããçµæããã¹ãã§ã¯ãªããžã§ã¯ãã®åäœãèããããŠããã»ã©è¡šç€ºãããªãããšããããŸãã
ãã¹ãããŸã£ãããªããããžã§ã¯ããèŠã€ããã®ãšåããããèŠçã§ãããã¹ããã·ã¹ãã ã®åäœãç解ããã®ã«åœ¹ç«ããªããããžã§ã¯ããèŠã€ããã®ã§ãã ãã¹ãããµããŒããå¿ èŠãšããã³ãŒãã§ãããããå°æ¥ã®èªè ã«ãã®ç®çãéåžžã«æ確ã«èª¬æããå¿ èŠããããŸãã
it "works" do data = File.open("fixtures/projects.txt").read index = ProjectIndex.new(data) index.should have(40).projects last_project = projects.last last_project.title.should eq("ORCA") last_project.customer.should eq("Romney-Ryan 2012") last_project.deploy_date.should eq(Date.parse("2012-11-06")) end
ããŠãããã§äœãæ©èœããŸããïŒ ãã®èª¬æã¯äžèšã§ã¯æå³ããªãããã®äŸã§ã¯è€æ°ã®ãã§ãã¯ãäžåºŠã«å®è¡ãããŸããããŸã£ããæå³ããããŸããã
ä»æ§ã®ã¹ã¿ã€ã«ã§ãã¹ããäœæããå Žåãè±èªã®èª¬æã¯ããªããšäžç·ã«è¡ãå¿ èŠããããŸãã ãããå®çŸãã1ã€ã®æ¹æ³ã¯ãããã¥ã¡ã³ã圢åŒã§RSpecãå®è¡ããããšã§ãã
jp@oeuf:~/workspace/project-manager(master)$ be rspec --format documentation spec ProjectIndex .new instantiates an index given the contents of a project CSV file #projects returns a collection of projects from the index Project #title returns the project title #customer returns the Customer record for the project #deploy_date calculates the deploy date from the latest project status
ç·è²ã®ãããã®æ£®ã®ä»£ããã«ãããã¥ã¡ã³ã圢åŒã¯ãã¹ãããã説æãã³ã³ããã¹ããããã³æå®ããäŸã®èŠåºããæäŸããŸãã ããã«ããããã¹ãããªããžã§ã¯ãã®å®éã®åäœãã©ã®çšåºŠå®å šã«æããã«ãããããã°ããè©äŸ¡ã§ããŸãã ãã®åœ¢åŒã®åºåã«çŠç¹ãåœãŠãããšã«ããããã¹ãã¹ã€ãŒãã®é信䟡å€ãå€§å¹ ã«åäžãããããšãã§ããŸãã èµ€ç·ç·ã®ãªãã¡ã¯ã¿ãªã³ã°ãµã€ã¯ã«ã®ãªãã¡ã¯ã¿ãªã³ã°ã¹ãããã䜿çšããŠããã¹ããããªããžã§ã¯ãã®ååšçç±ãåäœãããã³ãã®ããã«å®è¡ããçç±ã®æ確ãªèª¬æã«å€ããŸãã
å°æ¥ã®éçºè ã¯åãã§
ãããã¯ãä»ã®èª°ããè«æ±æžãæ¯æããšããåççãªä»®å®ã®äžã§ãå€æŽã«åããŠãããžã§ã¯ããæºåããæ¹æ³ã®ã»ãã®äžéšã§ãã äœæ¥äžã®çŸåšã®ãããžã§ã¯ãã®æ§ç¯ãšéçšãæ åœãã次ã®ç®ã«ã€ããŠèããŠãã ããã ãµããŒãã®é£ããããªãªãŒã¹ãããã®ã®è³ªã®äœããããç§ãã¡å šå¡ãåŸæãæããŠããŸãã ãããã£ãŠãã³ãŒãã«æ®ãããã¹ãŠã®ããããçæã«å¯ŸããŠæž©ããæ°æã¡ãæ±ãããšãããã代ããã«ãå°æ¥ã®éçºè ãå°çã®ããã«å°é¢ãã©ãã ãæºåãããã«ãã£ãŠããªãã«æ¯æãã¹ãé ã®éããã£ããèšç®ãå§ããŸãã
ãæªæ¥ã®éçºè ããšããèšèãåããïŒèªãã ïŒçãã ïŒDave Yeuã«æè¬ããŸãã
èãã質åãã³ã¡ã³ãã¯ãããŸããïŒ ããããå ±æããŠãã ããïŒ Twitterã§ã¯@jpignataãšããããã¯ããŒã ã§èŠã€ããããšãã§ããŸãããŸããjohn @ pignata.comã§é»åã¡ãŒã«ãåãåãããšãã§ããŸãã èªãã§ãããŠããããšãïŒ
ããã¯ç¿»èš³ã§ãããäžèšã®åº§æšã¯å ã®èšäºã®èè ãæããŠããããšãæãåºãããŠãã ããã PMã§ã³ã¡ã³ããã³ã¡ã³ãããå¯ãããã ããã°å¹žãã§ãã ããããšã