Sha256: d57e2b3f1d6ecc75c612db002ba34e39ef38584f09c1b473e45a84391590b89d

Contents?: true

Size: 1002 Bytes

Versions: 1

Compression:

Stored size: 1002 Bytes

Contents

module YARD
  module RSpecExamples
    class ModuleHandler < YARD::Handlers::Ruby::Base
      handles :module

      def process
        # param = statement.parameters.first
        #
        # subject = nil
        #
        # # A class is being declared
        # if param.type == :var_ref && param.children.first.type == :const
        #   subject = param.children.first.source
        # end
        #
        # # A class is being declared (with a nested name)
        # if param.type == :const_path_ref
        #   subject = param.children.map { |i| i.source }.join("::")
        # end
        #
        # # A method is being declared
        # if param.type == :string_literal && param.source =~ /^"#/
        #   subject = param.source.delete('"|\ ')
        # end
        #
        #TODO: probably thave to strip namespace from the module
        ParserTrace.path.push(statement.module_name.path)
        parse_block(statement.last.last)
        ParserTrace.path.pop
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yard-rspec_examples-0.0.1 lib/yard/rspec_examples/module_handler.rb