Method: Docgen::CLI.convert_comment

Defined in:
lib/docgen/cli.rb

.convert_comment(comment) ⇒ Object

convert_comment( comment )

comment - An SQL Comment

This converts and SQL comment into a JavaDoc style comment



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/docgen/cli.rb', line 100

def self.convert_comment( comment )

  # First clean off all of the '--' markers

  cleaned = ""

  comment.each_line { |line|
    line.sub!( /\s*\-\-\s*/, "" )
    line.strip!
    cleaned += "#{line}\n" if ( line.length > 0 )
  }

  # Now create a new buffer with the proper JavaDoc formatting
  # around it

  converted = "/**\n"

  cleaned.each_line { |line| converted += " * #{line}" }

  converted += " */\n"

  converted

end