yardã¯åãªãããã¥ã¡ã³ãã¼ã·ã§ã³ã©ã¤ãã©ãªã§ã¯ãªã!!
ã¿ãªãã Yard ã¯ãåç¥ã§ããããåç¥ã§ãããã
RDocã¨ããRubyã§ã½ã¼ã¹ã³ã¼ãã«æ¸ãããã¥ã¡ã³ãã¼ã·ã§ã³ãã¼ã«ã§YARD(http://yardoc.org/)ã£ã¦ããã¾ãããã
ããã¸ã§ã¯ãã®ã«ã¼ãã§yard docã£ã¦ããã¨rdocã§å®è¡ããã®ã¨åãããã«ããã¥ã¡ã³ããçæãããã®ã§ãããããã ãã§æºè¶³ãã¦ã¯è¡ããªããã ãã
yard helpã£ã¦æã¤ã¨ãµãã³ãã³ããããããåºã¦ãããã ãã
% yard help Usage: yard <command> [options] Commands: config Views or edits current global configuration diff Returns the object diff of two gems or .yardoc files doc Generates documentation gems Builds YARD index for gems graph Graphs class diagram using Graphviz help Retrieves help for a command list Lists all constant and methods. Uses `yard doc --list` ri A tool to view documentation in the console like `ri` server Runs a local documentation server stats Prints documentation statistics on a set of files
ç°ãªããã¼ã¸ã§ã³ã®gemå士ãæ¯è¼ããdiffã¨ããã¹ã´ãé¢ç½ããã ããã©ãä»å㯠graph ãµãã³ãã³ãã«ã¤ãã¦ã ãã
ã§ãyard graphã¨ã¯
ç¾èã¯ä¸è¦ã«ãããã ãããä»å㯠https://github.com/esminc/tapp ãã¯ã©ã¹å³ã«ãã¦åºåãã¦ã¿ããã
ãããªæãã«ãã¦ãããããï¼æã£ã¦ããããï¼ã¡ããã¨ã¯ã©ã¹å³ã«ãªããã
ã¯ã©ã¹å³ã®ä½ææ¹æ³
yard ã§è¡ãã®ã¯ Graphviz ç¨ã® dot ãã¡ã¤ã«ãä½æããã¾ã§ãªãã ããã ãããã¾ã㯠Graphviz ãã¤ã³ã¹ãã¼ã«ããå¿ è¦ããããã
Macï¼ç¢ºèªã«ä½¿ã£ã¦ãOSã¯OSX Lionï¼ã§ã¯homebrew ã§ç°¡åã«ã¤ã³ã¹ãã¼ã«ã§ãããã
brew install Graphviz
ã¤ã³ã¹ãã¼ã«ãçµããã¨dotã³ãã³ãã使ããããã«ãªã£ã¦ããã¯ãã ãããããçæã«yard㧠dot ãã¡ã¤ã«ãä½æãã¦ããã
ä»å㯠tapp ãå
¥æãã*1ã¨ããããæ¸ãã¦ããããã©ãã½ã¼ã¹ã³ã¼ããããã°ãªãã§ã大ä¸å¤«ã ãã
% git clone https://github.com/esminc/tapp.git % cd tapp % yard doc # yard graph ãããã«ã¯ããã¥ã¡ã³ãã¼ã·ã§ã³åããå¿ è¦ãããããæ£ç¢ºã«ã¯ .yardoc ãå¿ è¦ã«ãªããã % yard graph --full -f tapp.dot # --full ãã¤ããã¨ãã¡ã½ããåãããããã£ã¾ã§åºåãã¦ãããããã«ãªããã % dot -Tpng tapp.dot -o tapp.png # dot ã³ãã³ãã§ç»ååããã
ç°¡åã ããã
ã¡ãªã¿ã«
yard diff ã使ãã¨ãããªæãã ãã
*1:ã¡ããã©æ軽ãªãµã¤ãºã ã£ãã®ã§tappã«ãããã©ãç¹ã«æå³ã¯ãªãã