Sha256: fbbab64ceecfa447c422627280fa4e0ad922f5e06ef2fbb5faf064b908f3201b

Contents?: true

Size: 737 Bytes

Versions: 3

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module Yardcheck
  class Documentation
    include Concord.new(:yardocs), Memoizable

    # mutest:disable
    def self.parse
      load_yard
      new(YARD::Registry.all(:method))
    end

    # This is just YARD implementation details so I don't want to mutation cover this
    # mutest:disable
    def self.load_yard
      # YARD doesn't write to .yardoc/ without this lock_for_writing and save
      YARD::Registry.lock_for_writing do
        YARD.parse(['lib/**/*.rb'], [], YARD::Logger::ERROR)
        YARD::Registry.save(true)
      end

      YARD::Registry.load!
    end

    def method_objects
      yardocs.map { |yardoc| MethodObject.new(yardoc) }
    end
  end # Documentation
end # Yardcheck

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yardcheck-0.0.3 lib/yardcheck/documentation.rb
yardcheck-0.0.2 lib/yardcheck/documentation.rb
yardcheck-0.0.1 lib/yardcheck/documentation.rb