곡괭이 책에 나오는 RDoc 사용 방법을 나누어 적어본다.

하나하나 설명하는 것보다 역시 소스와 결과물을 같이 두면 바로 이해가 될 것 같다.

 

#_class_ <b>comment</b> +test+
#  Indenting...
#woowang, \+good\+ method_1
#--
#Normal Comment, so it does not include to rdoc
#++
#
#So rdoc comment is back!!
#= Link Test
#
#link?? http://dev.heartsavior.net
#
#== Link => Image??
#
#http://sstatic.naver.com/search/100_thumb_nx3/71/32471.jpg
#
#My Blog[http://www.heartsavior.net]
#
#{MyBrute,fishing}[http://heartsavior.mybrute.com]
#
#= List Test
# * List1
#   (Comment on List1)
# * List2
#
# ----
#Why RDoc doesn't make line bar ?? I'm wrong??
#
#[cat]      cat is cat
#[+cat+]    command that copies stdin to stdout
# 
#cat::      cat is cat
#+cat+::    command that copies
#           stdin to stdout
#
#<tt>--output</tt> <i>name [, name]</i>::
#     output parameter
#     that you are one
#
#<tt>--output</tt> <i>name [, name]</i>:: output parameter
#                                          that you are one
#
class TestRDoc

  # test do appear RDoc
  def test
    
  end

  # method_1 doe appear RDoc
  def method_1
    
  end

  # class_method_1 do appear RDoc
  def TestRDoc.class_method_1
    
  end
end


소스 창을 띄워놓고 보기 : http://codepad.org/ZmbL2lQX

위의 코드로 RDoc 를 만들면 아래와 같이 만들어진다.

 

크리에이티브 커먼즈 라이선스
Creative Commons License

'Dev.Programming > Lang.Ruby' 카테고리의 다른 글

RDoc vol.3 from 곡괭이  (0) 2009/04/23
RDoc vol.2 from 곡괭이  (0) 2009/04/23
RDoc vol.1 from 곡괭이  (0) 2009/04/23
Hpricot 으로 XML 을 파싱하면...  (0) 2009/04/23
Ruby 로 만든 어플리케이션을 배포하는 방법  (4) 2009/04/15
신기한 Ruby 의 Fixnum  (0) 2009/04/01
Posted by Heart