Sha256: aee4088b14e2399bb34a4267c2d708abae76cf22b68344dc1e44972a04906dbf

Contents?: true

Size: 1.19 KB

Versions: 5

Compression:

Stored size: 1.19 KB

Contents

module Inch
  module CodeObject
    # Provider modules "provide" a Codebase object with code objects.
    # They are the intermediary between the raw representation that tools
    # like YARD deliver and the "interface" that Inch expects.
    #
    # YARD Example:
    #
    # YARD's SourceParser returns ::YARD::CodeObject objects, which are
    # cast to Provider::YARD::Object::Base objects that can ensure naming
    # conventions et al. follow certain rules. These objects are then again
    # converted into CodeObject::Proxy::Base objects that form the codebase:
    #
    #                        ::YARD::CodeObject
    #                               ↓
    #           ::Inch::CodeObject::Provider::YARD::Object::Base
    #                               ↓
    #                             (Hash)
    #                               ↓
    #                   ::Inch::CodeObject::Proxy::Base
    #
    #
    module Provider
      def self.parse(dir, config = Inch::Config.codebase, type = :YARD)
        provider_for(type).parse(dir, config)
      end

      # @return [Module]
      def self.provider_for(type)
        const_get(type)
      end
    end
  end
end

require 'inch/code_object/provider/yard'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inch-0.5.0.rc3 lib/inch/code_object/provider.rb
inch-0.5.0.rc2 lib/inch/code_object/provider.rb
inch-0.5.0.rc1 lib/inch/code_object/provider.rb
inch-0.4.6 lib/inch/code_object/provider.rb
inch-0.4.5 lib/inch/code_object/provider.rb