ä¼å¡äºæ¥é¨ã®ãã¤ã§ãã
ã¯ãã¯ãããã«ãRubyMineæ好家ã¯ãã¾ãã®ã§ã社å ã§å ±æãããTipsãå«ã RubyMineã®ä¾¿å©ãªæ©è½ãç´¹ä»ãããã¨æãã¾ãã
â» æ²è¼ãã¦ããç»åã¯å®éã®ãµã¼ãã¹ã»ããã¸ã§ã¯ãã¨ã¯ä¸åé¢ä¿ããã¾ããã(blogç¨ã§ã)
Remote Debugging
ãã®ããã«ä½¿ã£ã¦ããã¨è¨ã£ã¦ãéè¨ã§ã¯ãªãã®ã Remote Debugging æ©è½ã§ãã
ã©ããªãµã¼ãã¹ã§ãè¤éãªè¦ä»¶ã§æ§æããããã¼ã¸ã¯åå¨ãããã®ã§ãã¯ãã¯ããããåæ§ã§ãã
æ´å²ãéããcontrollerã®before_actionãå
¥ãçµãã partialãªã©ã®ãããã°ã¯å¤§å¤ã§ãã
binding.pry
ã logger
ã§é å¼µã£ã¦ãããã¨ãããã¾ããremote debugã¯åªç§ã§ãã
1. Gemã®ã¤ã³ã¹ãã¼ã«
Gemfile
ã«æ¸ãã¦ãããã®ã§ãããIDEã§Debugããªã人ã«ã¯å¿
è¦ãªãã®ã§å¥éã¤ã³ã¹ãã¼ã«ãã¦ãã¾ãã
gem install ruby-debug-ide gem install debase
2. RubyMineã®è¨å®
- Run -> Edit Configurations -> [+] -> Ruby Remote debug
äºåã«èµ·åãããããµã¼ãã¹ã¯å¥ã«ç»é²ãã¦ããã¨ãBefore launch: Another Configuration
ã«è¨å®ã§ãã¾ãã
ã¯ãã¯ãããã§ãäºåã«èµ·åãããããµã¼ãã¹ã¯ãã¤ãããã®ã§Bash
çã§ç»é²ãã¦ããã¾ãã
RubyMineã使ç¨ããªãå ´åã¯foremanã§èµ·åããã¦ãã¾ãã
3. ãããã°
ãããã°ãµã¼ãã¼ãèµ·å
Terminalããå®è¡ãã¦ãããã§ãããTools -> External Tools ã«ç»é²ãã¦ããã¨ä¾¿å©ã§ãã
ãããã°ãããã¼ã¸ã«ã¢ã¯ã»ã¹
表示ã«é¢é£ãããããã°ä»¥å¤ã¯ãTools -> Test RESTful Web Service ãå©ç¨ããã¨ä¾¿å©ã§ãã
REST Client ã¯ãããã¼ããã©ã¡ã¼ã¿ã¼ãcookieã容æã«å¤æ´ã§ããã®ã§APIãã¹ãã«å©ç¨ãã¦ãã¾ããã ãã©ã¦ã¶ã¨éããã¼ã¸ä»¥å¤ã®ãªã½ã¼ã¹ã«ã¢ã¯ã»ã¹ããªãã®ã§ãããã°ã§ãæ´»èºãã¾ãã
ãã¬ã¤ã¯ãã¤ã³ã
ã³ã¼ã«ã¹ã¿ãã¯ãã¹ã³ã¼ãå ã®å¤æ°ãå¤æ°ã®ç£è¦ãªã©ã表示ããã¾ãã
ã³ã¼ã«ã¹ã¿ãã¯ããã¯ãããã¸ã§ã¯ãã®ãã¡ã¤ã«ã§ãGemå ã®ãã¡ã¤ã«ã§ãåç §ã§ãã¾ãã
ãã¬ã¤ã¯ãã¤ã³ãã¯ControllerãModelãViewã«éãããroutes.rb ãªã©ã®configãgemå ã®ãã¡ã¤ã«ã«ãè¨å®ã§ãã¾ãã
便å©ãªæ©è½
便å©ãªæ©è½ã¯ããããããã¾ãããã»ãã®ä¸é¨ã ãç´¹ä»ãããã¨æãã¾ãã
ç´¹ä»ããæ©è½ã«ã¯ä¸é¨ãã©ã°ã¤ã³ãæä¾ãã¦ãããã®ãããã¾ãã
Search Everywhere
ããã¸ã§ã¯ãã大ãããªãã°ãã¡ã¤ã«ãæ¢ãã®ãä¸è¦å´ã§ãããSearch Everywhere ã¯å¼·åã«ç©ºæ°ãèªãã§æ¢ãã¦ããã¾ãã é »ç¹ã«åç §ãããã©ã«ãããã¡ã¤ã«ã¯ Favorites ã«ç»é²ãã¦ããã¨ããããããã¾ããã
ããã©ã«ãã§ã¯ãã¤ã¬ã¯ããªã·ã§ã¼ãã«ãããã¼ã¯å²ãå½ã¦ããã¦ãã¾ããã shift
2åã§ãã¤ã¢ãã°ã表ãã¾ãã
no new line at end of file
ãã¾ã«ãããªæ®å¿µãªcommitããã¦ãã¾ããã¨ãããã¾ãã
Ensure line feed at file end on Save
ããã§ãã¯ãã¦ããã¨ä¿åæãã¡ã¤ã«æ«å°¾ã«æ¹è¡ã追å ãã¦ããã¾ãã
Ruby Style Guid
rubyåå¿è ã«ããããããRoboCopã® inspection æ©è½ã§ããIDEã¯å¦ã¶æ©ä¼ãä¸ãã¦ããã¾ãã
Ruby Style Guid ã§ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã«çµ±ä¸ãããã¨ã¯å¯èªæ§ãé«ããä¿å®æ§ãåä¸ãããã¨ã«ã¤ãªããã¾ãã 以åã¯commit hookã«è¨å®ãã¦ãããã¾ããããã³ã¼ããæ¸ãã¦ããæä¸ã«åããæ¹ãå¹ççã ã¨æãã¾ãã
keymap
èªåã¯"é·ã«å¾ã"æ´¾ãªã®ã§å¤æ´ãã¾ããããvim, emacs ãªã©ä»ã¨ãã£ã¿ããã®ç§»è¡ãã使ãæ £ãããã¼ãã¤ã³ãã§ï¼ã¨è¨ãæ¹ã«ã¯åãã¼ããããããªã»ããããã¦ãã¾ãã
RubyMineã¯é ãæ©è½ï¼é ãã¦ããã®ã§ã¯ãªãæ¢ããªãã ãï¼ãè±å¯ã§ãããã®ãã¼ããããæ¢ãã¨ä¾¿å©æ©è½ãè¦ã¤ãããã¨ãããã¾ãããã²ã¨ãæ¢è¨ªãã¦é ãããè¨å®ã§ãã
Tasks & Contexts
- Tools -> Tasks & Contexts -> Configure Servers
ãã¼ã éçºã§ã¯ä½ãããã®ã¿ã¹ã¯ç®¡çãã¼ã«ã使ãããã¨æãã¾ãããã¡ã¸ã£ã¼ãªToolã¨ã¯é£æºãã§ãã¾ãã
ã¿ã¹ã¯ãããã©ã³ããä½æããããã§ãã¾ãã ã¿ã¹ã¯ãã¨ã«ã¯ã¼ã¯ã¹ãã¼ã¹ï¼éãã¦ãããã¡ã¤ã«ãã¦ã¤ã³ãã¦åå²ãªã©ï¼ãä¿æãããã®ã§ã¿ã¹ã¯ããã¾ãåãæãã¦éç¨ããã¨ä¾¿å©ã§ãã
Terminal
iTermã§ãããã®ã§ãããIDEå ã§å®çµãããã¨ãã§ãã¾ããè¥å¹²ã®ã¯ã»(æ¥æ¬èªè¡¨ç¤º)ãããã®ã§æ³¨æãå¿ è¦ã§ãã ãã°ã®åç §ãconsoleã«ä½¿ç¨ãã¦ãã¾ãã
PlantUML
ã¡ãã£ã¨ããã·ã¼ã±ã³ã¹å³ãã¯ã©ã¹å³ãæ¸ããããããã¨ã㯠PlantUML ã便å©ã§ãã
ã·ã³ãã«ãªææ³ãªã®ã§ãããã¹ãç·¨éã§ããã£ã¨æ¸ãã¦ãã¾ãã®ãç¹å¾´ã§ããpng, svgå½¢å¼ã§ä¿åãåºæ¥ã¾ãã 社å ã®å ±æãã¼ã«ã§ãPlantUMLã使ç¨ã§ããã®ã§ããã®ã¾ã¾å ±æè³æã¨ãã¦ä½¿ç¨ãããã¨ãããã¾ãã
Gfm
ãã¼ã¯ãã¦ã³ãGitHubã®ãã©ã¼ãããã§ãã¬ãã¥ã¼ãã¦ãããã®ã§ä»ä¸ããããã¼ã«ã«ã§ãããã¾ãã åå²ãã¦ã©ã¤ããã¬ãã¥ã¼ã§ããã®ã¯ãããããã§ãã Pull RequestãIssueã®ä¸æ¸ãã§å©ç¨ããã¨ä¾¿å©ã§ãã
æ®æ®µããã¡ã¢å¸³ã¨ãã¦ãIDEã使ã£ã¦ãã¾ã£ã¦ãã¾ãã(ãã¼ãã£ã³ã°ãIDE)
ã¾ã¨ã
é·å¹´JetBrains製åã§éçºãã¦ãã¾ãããæªã ã«æªéã®æ©è½ãããããããã¾ãã
IDEã«éã£ã話ã§ã¯ããã¾ããããéå ·ã¯ä¸æã«ä½¿ã£ã¦ããçããã®ã ã¨æãã¾ãããããããä¸æã«IDEã¨ã¤ããã£ã¦ããããã¨æãã¾ãã