åºåäºæ¥é¨ã®é´æ¨éç¢ã§ããã³ã¼ãã£ã³ã°ããã¦ãã¨å¤æ°ãã¡ã½ããåã®ä»ãæ¹ã«æ©ããã¨ã£ã¦å¤ã ããã¾ããããéã«ã³ã¼ããèªãã§ããã¨åèªã®é¸æãããã§ããã®ããªã¨ããæããåè©ã®æ´»ç¨å½¢ãééã£ã¦ãã¦ããæå³ãããããªããæã«æ½ãæ¥æ¬èªã®å¤æ°åã«ãªã£ã¦ãããã¨ãè¦ããã¾ããã§ãããã°ã©ãã³ã°è¨èªã®åèªãè±èªããã¼ã¹ã«ãã¦ãã¾ãããRailsã使ã£ã¦ããå ´åã¯æ¥æ¬èªãè¦ç´ï¼Conventionï¼ã«åããªãã£ãããã¾ã(è¤æ°å½¢ãç¡ããªã©)ãããããåè©ã®æ´»ç¨å½¢ãéã£ã¦ããã¨ä¸»èªï¼åä½ã®ä¸»ä½ï¼ãå¤ãã£ã¦ãã¾ããæå³ãå¤ãã£ã¦ãã¾ãã¾ãããã®çµæã³ã¼ãã®å¯èªæ§ãè½ã¡æ··ä¹±ãæãããããªãã¾ãã
ããã¤ãã®åºæ¬çãªæ³åã ããããã¦ããã°ã³ã¼ãã£ã³ã°ä¸ã«å¯èªæ§ã®é«ãåèªã®é¸æãã§ããããã«ãªãã¾ããä»åã¯ãããç®çã«ãè±èªã®æ±ãã«é½åº¦æéãè²»ããã¦ãã¾ããããªæ¹ã«åãã¦ããã¤ãã®æ³åããç´¹ä»ãã¾ãã*1
å¤æ°ãã¡ã½ããåã®é¸å®
åèªã®æå³ã®ç¯å²
è¾æ¸ãå¼ãã¦è¦ã¤ãã£ãåèªããã®ã¾ã¾ä½¿ã£ã¦ããã±ã¼ã¹ãããè¦ããã¾ããæ¥æ¬èªã®åèªã®æå³ã®ç¯å²ã¨è¾æ¸ã§è¦ã¤ãã£ãè±åèªã®æå³ã®ç¯å²ãç°ãªãå ´åãããã®ã§æ³¨æãå¿ è¦ã§ãã
ä¾. åºåã®ãã£ã³ãã¼ã³ä¼ç»ã®æ¡ä»¶çµäºæ¥æã®çµäºæ¥ã«ä½¿ãå¤æ°ã¨ãã¦ä»¥ä¸ã®ååãã¤ããä¾
- æ¥æ¬èªï¼
æ¡ä»¶çµäºæ¥æ
- å¤æ°åï¼
issue_end_datetime
æ¡ä»¶çµäºæ¥æã¨ããåèªã¯ä¸ã¤ã®åèªã¨ãã¦ã¯è±èªè¾æ¸ã«ã¯ããã¾ãããã§ãã®ã§ãããããã®åèªãã°ãã°ãã«è¾æ¸ã§å¼ããçµæãæ¡ä»¶_çµäº_æ¥æ
ã¨ããå¤æ°åãåºæ¥ä¸ãã£ãã®ã§ã¯ãªããã¨æãããã±ã¼ã¹ã§ããæ£è§£ã¯ç¡ãã§ããç§ã®å ´åã¯campaign_ends_at
ã¨å½åããã¨æãã¾ãã*2
ããã§æµ®ãã³ä¸ããã®ãæ¡ä»¶
ã«å¯¾ãã¦issue
ã¨ããåèªãé©å½ãªã®ãã¨ããçåã§ããè¾æ¸ãå¼ãéã«åæã¨ãã¦æ³¨æãã¹ããªã®ãããæ¥æ¬èªã¨è±èªã§ã¯åèªã®æå³ã®ç¯å²ãéããã¨ãããã¨ã§ãã
ä¸ã®å³ã¯æ¡ä»¶
ã¨issue
ãããããé¡èªè¾å
¸ã§å¼ããçµæã§ããäºç¹ãåºæ¥äºãåé¡ãè«ç¹ã¨ãã£ãæå³ã§ã¯æå³ã®ç¯å²ãéãªã£ã¦ãã¾ãããã®ããissueã¨ããåèªãé¸ã°ããã®ã§ãããä»åã®ãã£ã³ãã¼ã³ä¼ç»
ãããã¸ã§ã¯ã
ã¨ããæå³ã§ã¯æå³ã®ç¯å²ãéãªã£ã¦ãã¾ãããissue
ã¨ããåèªããã®æå³ã®æ¡ä»¶
ã¨ãã¦ä½¿ãã®ã«ã¯ç¡çãããããã§ãã
ããåèªã®æå³ã®ç¯å²ãã©ãã«æ®ããããè¨ãæããã¨ã©ã®ã·ã¼ã³ãè¨ã表ãã®ã«é©å½ãªåèªã使ç¨ããã®ãã¨ããã®ã¯ã¾ãã«éåç¥ã§ãããã決ã¾ãã¾ã§å¤æã«ã¯æåçèæ¯ãæ·±ãé¢ããã¾ããããããæ¥æ¬èªã«ã¯ææ§ãªåèªãåºãå ´é¢ã§ä½¿ç¨ããçãããã¨ããã®ãç¥ã£ã¦ããã¨è¯ãã¨æãã¾ãã*3
ã¤ã¾ãããããã£ããã¨ãåæã«ããæ£ç¢ºã«è¡¨ããããã®ãã¾ãã¯åå®ç¾©ããã¨ããè¯ã訳ã«è¿ã¥ããã¨æãã¾ããããã«è±èªã®é¡èªè¾å
¸ã使ã£ã¦ããæå³ãéãªãç¯å²ãå¤ãåèªãé¸ã¶ã¨è¯ãçµæã«è¿ã¥ãã¾ãããã®å ´åã¯ä¼ç»
ãè¨ç»
ã¨ããæå³ã«è¿ãcampaign
ã¨ããåèªãé¸ã³ã¾ããã
æ¥æ¬èªå¤æ°å
æ¥æ¬èªå¤æ°åã¯ããã表ããã®ãåºæåè©ã®å ´åã¯ä½¿ã£ã¦ãè¯ãã¨æãã¾ããä¾ãã°ã¯ãã¯ãããã«ã¯ããã¬ã·ãã«å¯¾ãã¦ã¤ãã£ãããã¬ãã¼ãããã¤ããã½
ã¨ããæ©è½ãããã¾ãããããã¯èª¬æããã¨é·ãæ¦å¿µã§ãããã²ã¨ã¾ã¨ãã®åºæåè©ã¨ãã¦tsukurepo
ã¨å¼ã¶ã®ã¯è¯ãã¨æãã¾ãã
ãã以å¤ã®å ´åã¯ãå ã«ããããããã«Railsã®å ´åè¦ç´ã«åããªãã£ãããã¢ã«ãã¡ããã表è¨ã®æ¥æ¬èªããã£ã±ãããã¨å¯èªæ§ãè½ã¡ããããã®ã§åºæ¬çã«ã¯è±èªã«å¯ããã®ãè¯ãã§ãããã
åå½¢ã»ç¾å¨åè©(-ing)ã»éå»åè©(-ed)ï¼
æã è¦ãããã®ãåè©ã®æ´»ç¨å½¢ãééã£ã¦ããã±ã¼ã¹ã§ããééããã¨æå³ãå¤ãã£ã¦ãã¾ãã®ã§æ³¨æãå¿ è¦ã§ãã以ä¸ã«æãæ¨è¦ã§ããå½¢ããªã¹ããã¾ããã
ã³ãããã³ã¡ã³ã
ã³ãããã¿ã¤ãã«ï¼æåã®è¡ï¼ã¯åºæ¬çã«åè©ã®åå½¢ã§å§ãã¾ããæ¬æã¯æ®éã®æç« ã§èª¬æçã«æ¸ãã¦å¤§ä¸å¤«ã§ãã
Summarize changes in around 50 characters or less More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of the commit and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); various tools like `log`, `shortlog` and `rebase` can get confused if you run the two together.
ã³ã¼ãä¸ã®ã³ã¡ã³ã
対象ã®ã¡ã½ãããã©ã¤ã³ã主èªã¨ãã¦åè©ã®åå½¢ããããã¯ä¸äººç§°åæ°å½¢ã§æ¸ããããã¨ãå¤ãããã§ããããã¸ã§ã¯ãä¸ã§ãã®ã©ã¡ããã«çµ±ä¸ããã¦ããã°è¯ãã¨æãã¾ãã
# Converts the object into textual markup given a specific format. # # @param format [Symbol] the format type, `:text` or `:html` # @return [String] the object converted into the expected format. def to_format(format = :html) # format the object end
ã¡ã½ããå
åè¨èªã«ãã£ã¦æ £ç¿ãç°ãªãã¨æãã¾ããåºæ¬çã«ã¯ã¡ã½ãããæå±ããã¯ã©ã¹ã主èªã¨ããæã®åè©ã®æ´»ç¨å½¢ã«åããã¾ãã
class Car # A car runs # 主èª: Car def run end # A car is running? # 主èª: Car def running? end # A car has navigation system? # 主èª: Car def has_navigation_system? end # A car is permitted to be shipped? # 主èª: Car def shipping_permitted? end # Someone commands to ship a car to a country. # 主èª: 誰ãï¼æ¥åãã¸ãã¯ä¸ã®ä¸»ä½ï¼ def ship_to(country) end end
has_navigation_system?
Railsã®æ
£ç¿ã§ã¯çåç³»ã«ä¸äººç§°åæ°ã使ãã¾ããèªç¶è¨èªã¨ãã¦ã®è±èªã®çåç³»ã¯Does the car have navigation system?
ãããã¯The car has navigation system?
ã§ãããããããå¤æ°ããå¼ã³åºãã¨ãã®car.has_navigation_system?
ãããèªç¶ã«é¿ãã®ã§å¾è
ã®çåå½¢ã®ä¾ã®å½¢ã«ãªã£ã¦ããã®ã ã¨æãã¾ãã
shipping_permitted?
èªç¶è¨èªã§ã¯A car is permitted to be shipped?
ãèªç¶ã«é¿ãã®ã§permitted_to_be_shipped
ã§ãè¯ãã§ãããé·ãã®ã§permitã¨shipãä¸ã¤ã®å½¢å®¹è©çãªæè¦ã«ãã¦shipping_permitted?
ã¨ãã¦ãã¾ããï¼ãã®è¾ºã¯è³å¦ããã¨æãã¾ããï¼
ship_to(country)
è足ã§ãããæå¾ã®ship_to(country)
ã¯shipãä»åè©ãªã®ã§ï¼shipã¯èªåè©ã«ããªãããã¾ããããã®å ´åCarãä½ããåºè·ãããããã§ã¯ãªãï¼ã»ãã«ä¸»èªãããããã«æãã¾ããã ãããï¼å®éã«ã¯Car classã«ãããããªå ´åãããè¦ããã¾ããï¼ä¸»èªãCarã¨ç°ãªãã®ã§ãªãã¨ãªãå¥ã®å ´æã«å®è£
ãããã¹ãåãããã¾ãã
RSpecã®è±èª
RSpecã®è±èªã¯ç¹æ®ã§ããè±èªã®ç縮形ã«ä¼¼ã¦ãã¾ããããã£ã¨ç¬ç¹ãªæ¸ãæ¹ããã¾ããããæ°ã«ãªãã¨ãããæãã¦ã¿ã¾ããã*4
whenã®å¾ã®éå»åè©
describe Car describe "#" do context "when it is permitted to be shipped" do end # 主èªã¨beåè©ãçç¥ãã¦è¯ã context "when permitted to be shipped" do end end end
describeããã¦ãã主èª(Car)ã形容ããæè¦ã§permitted
ã使ããã¨ãã§ãã¾ããpermit
ããã®ã¯Car
ã§ã¯ãªããCar
ã¯permit
ãããã®ã§éå»åè©ã§ãã
ãã®ãããªæè¦ã§ä¸»èªãçç¥ããããcontextãçããããã¨ãã§ãã¾ããé·ãå°èª¬çãªæç« ã«ããcontextã¯å¯èªæ§ãè½ã¡ã¾ãã®ã§ãªãã¹ããã®å½¢ãã¨ãã®ãæã¾ããã§ãã
åç½®è©ã®å¾ã¯ç¾å¨åè©
ãããªã®å½ããåã ã¨æãããæ¹ãããã§ããããåç½®è©ã®å¾ã«åè©ã®åå½¢ãããã®ãããè¦ããã¾ããforãaboutãªã©ã®åç½®è©ã®ãã¨ã¯åè©çã«ç¾å¨åè©ã使ç¨ãã¾ãã
it "consumes a litre of petrol for completing a round trip"
*5
æ¥æ¬èªã®ç
åè©ãåè©çã«ä½¿ã
æ¥æ¬èªã¯ããã便å©ã§çèªçã«åèªãã¤ãªãããã¨ã§åè©ã形容çã«ä½¿ãäºç©ã表ããã¨ãã§ãã¾ããããããåããã¨ãè±èªã§è¡ãã¨å¥ã®æå³ã«ãªããã¨ããã°ãã°ããã¾ããä¾ãã°ããè¦ãããä¾ã¨ãã¦ã¯åèªããªãã§ãåè©çã«ã¤ãªãã¦å¤æ°åã¨ããã±ã¼ã¹ã§ãã
class Car def fuel complete_round_trip = true/falseãè¿ãå¦ç ... if complete_round_trip ... end end
ãã®ãããªä¸æå¤æ°åãè¦ãããå ´åã¯ã¾ã£ããã«å¾å¾©è¡ç¨ãå®äºãã
ã¨ããæå³ã®ã¡ã½ããã ã¨æã£ã¦ãã¾ãã¾ããcomplete
ãåè©ã¨ãã¦è³ã«é£ã³è¾¼ãã§ããããã§ããããããæåã«çèªçã«æ¥æ¬èªã§ã³ã³ã
ãããã¯ã³ã³ããªã¼ããã
ã®ã³ã³ããªã¼ããåè©çã«ç¾
åãããã®çµæãç´è¨³ããçµæã§ã¯ãªãã§ãããããããããè±èªã®ã·ã³ã¿ãã¯ã¹ãåè©ã¨èªé ã«æ¯é
ããã¦ãã¾ãã®ã§åå½¢ã®åè©ãå
é ã«æ¥ãã¨ã¾ãã¯å½ä»¤å½¢ã§ããå¾å¾©è¡ç¨ãå®äºãã
ã¨ããæå³ãæãæµ®ãã¹ã¦ãã¾ãã¾ããCar
ãround trip
ãå®äºããã¨ãã形容çãªæå³ã§éå»åè©ã使ç¨ãã¦round_trip_completed
ã¨ããæ¹ãè¯ãã§ãã
æ¥æ¬èªã¯ã³ã³ããã¹ãä¾åã®é«ãçç¥ã®å¤ãè¨èª
ããã¯æ¥æ¬èªã«éã£ããã¨ã§ã¯ãªãã®ã§ãããæ¥æ¬èªã¯ããã³ã³ããã¹ãã¸ã®ä¾åãé«ãæ£ç¢ºã§ãªããªãã¨ãããªãå ´é¢ã§æãã¬ééããå¼ãèµ·ãããã¨ãããã®ã§æ³¨æãå¿ è¦ã§ãã
- ç¾ã«ãã£ãopenã¨ããååã«ããåéã
ããã¯å®éã«æè¿ãã£ãã±ã¼ã¹ã§ããããªãéå»ã«ã³ã³ãã¹ãéå¬ä¸ã¨ããæå³ã§Contest.open
ã¨ããã¡ã½ãããå®ç¾©ããã¦ãã¦ããã¼ã¸ãã¥ã¼ã®éè¨ã«ãã®ã¡ã½ããã使ããã¨ããã¨ããéè¨æéã足ããªãããã¨ãããã¨ãçºè¦ããã¨ãããã¨ãããã¾ãããå®éã«ã¯ã³ã³ãã¹ãã«ã¯å
¬éä¸ã«åéæé
ã審æ»æé
ãçºè¡¨æé
ã¨ããä¸ã¤ã®æéã®æ¦å¿µãããã¾ããããopen
ãã«ãã¼ãã¦ããã®ã¯åéæé
ã®ã¿ã§ãããã«å¯¾ãã¦éè¨å¦çã¯å
¨ã¦ã®æéãéè¨å¯¾è±¡ã¨ãã¦ãã¾ããã
åéæé
ã«å¯¾ãã¦open
ã¨ããåèªãé¸æããã¦ããããã§ããä½
ãopenã ã£ãã®ã翻訳ã®éç¨ã§å¤±ããã¦ãã¾ã£ã¦ãã¾ãããåéãopenã ã£ãã®ãæ¡ä»¶ã®å
¬éç¶æ
ãopenã¨ãåããã®ã§ãããã«å
·ä½çã«æå³ãçããopen_entry
ãªã©ãããã§ã¯ååã¨ãã¦ä½¿ç¨ãã¹ãã§ããããã³ã³ãã¹ãéå¬ä¸
ã¨ã¯ã¦ã¼ã¶ããã«ã¨ã£ã¦ã¯åéæéä¸
ã§ãããå
¬éæéä¸ãéãã訪åè
æ°ãç¥ããããã£ã³ãã¼ã³ä¸»ã®ç«å ´ããããã¨å
è¿°ã®ï¼ã¤å
¨ã¦ã®æéãªã®ã§ããããã®ããã«æ¥æ¬èªã¯ã³ã³ããã¹ãã«ãã£ã¦æå³ãå¤ãããããã®ã§åèªã®é¸å®ã®éã«ã¯æ³¨æãå¿
è¦ã§ãã
便å©ãªãµã¤ã
æå³ããã¼ã«é¡èªãã°ã«ã¼ãåããã¦ããã®ã§èªåã欲ããé¡èªãæ¢ããããã§ãã
é¡èª(synonyms)ã ãã§ãªãä¸ä½èª(hypernymsãããåºç¾©ã®åèª)ãåãã³ã³ããã¹ãã§ç»å ´ããåèª(same context)ãä»èª¿ã¹ã¦ããåèªãæå³ã®è§£èª¬ã«æã¤èª(reverse dictionary)ãªã©æ§ã ãªã¢ã«ã´ãªãºã ã®é¢é£èªãæ示ãã¦ããã¾ã
Stackexchangeã®è±èªãµã¤ãã§word-choiceã®ã¿ã°ãä»ãã¦ãã質åã®åçããã解説ãã¦ãã£ãããã¦ä¾¿å©ã§ããæéããã£ã¦ã¨ãã¨ãçªãè©°ãããã¨ãã¯ãã¡ãã§è³ªåããã¨ä¾¿å©ã§ãã
ã¾ã¨ã
- ããããã®è¨èªã«ããããã®åèªã®ç¯å²ããããã¨ãæèãã¦ããç義ã®æå³ã§çãåèªãé¸å®ããã
- 主èªãã ããªã®ããæèãã¦åè©ã®æ´»ç¨å½¢ã決ããã
- æ¥æ¬èªã®çï¼ãã¤ã³ã³ããã¹ããåè©ã形容è©çã«ä½¿ãï¼ãåèªã®é¸å®ã«å½±é¿ããªãããã«æèããã
ãã®ããã«ãããã¤ãã®åºæ¬çãªæ³åãé ã«å ¥ããã°ãã¾ãè¿·ããã¨ãªãã³ã¼ãã£ã³ã°ä¸ã«è±èªãé¸å®ãããã¨ãã§ãã¾ããã¾ããå¾ã ã«ééããå¼ãèµ·ãããäºå¾å¦çã«æéã使ãã¨ãããããªééããå¼ãèµ·ããã¨ããã®ãã¯ã¼ã¹ãã±ã¼ã¹ã§ãã®ã§ãããæ£ç¢ºãªæå³ãèããã®ã«æéãè²»ããã®ã¯ãããªãã«ä¾¡å¤ããããã¨ã§ããããªãã®ç¾å ´ã®è±èªãè¦ç´ãã¦ã¿ã¦ã¯ãããã§ããããï¼
*1:ãªãæ¬è¨äºã«é¢ãã¦ãã¤ãã£ãã¹ãã¼ã«ã¼ã®ã¬ãã¥ã¼ããã¦ããã ãã¦ãã¾ãã
*2:ã¿ã¤ã ãã¼ãã«ã®ããã«æéãå®ã¾ã£ã¦ããå ´åã¯endsï¼ç¬¬ä¸äººç§°åæ°ï¼ã使ç¨ããæ¥æã表ãæã¯ããã«ç¶ãatã使ç¨ãã¾ãã
*4:ãªããBetter specs(http://betterspecs.org/)ãã¨ã¦ãåèã«ãªãã¾ãã®ã§ãã§ãã¯ãã¦ã¿ã¦ãã ããã
*5:round tripã¯å¾å¾©ï¼è¡ç¨ï¼ã¨ããæå³ã§ã