lib/ffi/clang/comment.rb in ffi-clang-0.3.0 vs lib/ffi/clang/comment.rb in ffi-clang-0.5.0
- old
+ new
@@ -1,6 +1,5 @@
-# -*- coding: utf-8 -*-
# Copyright, 2013, by Carlos MartÃn Nieto <cmn@dwim.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@@ -17,13 +16,13 @@
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'ffi/clang/lib/cursor'
-require 'ffi/clang/lib/comment'
-require 'ffi/clang/source_location'
+require_relative 'lib/cursor'
+require_relative 'lib/comment'
+require_relative 'source_location'
module FFI
module Clang
class Comment
@@ -203,10 +202,11 @@
end
def text
self.map(&:text).join("")
end
+
alias_method :comment, :text
def valid_index?
Lib.param_command_comment_is_param_index_valid(@comment) != 0
end
@@ -270,9 +270,13 @@
Lib.extract_string Lib.full_comment_get_as_html(@comment)
end
def to_xml
Lib.extract_string Lib.full_comment_get_as_xml(@comment)
+ end
+
+ def text
+ self.children.collect{|child| child.text.strip}.join("\n")
end
end
end
end