lib/inch/code_object/provider.rb in inch-0.5.0.rc3 vs lib/inch/code_object/provider.rb in inch-0.5.0.rc4
- old
+ new
@@ -7,30 +7,30 @@
# 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:
+ # converted into CodeObject::Proxy objects that form the codebase:
#
# ::YARD::CodeObject
# ↓
# ::Inch::CodeObject::Provider::YARD::Object::Base
# ↓
# (Hash)
# ↓
- # ::Inch::CodeObject::Proxy::Base
+ # ::Inch::CodeObject::Proxy
#
#
module Provider
- def self.parse(dir, config = Inch::Config.codebase, type = :YARD)
- provider_for(type).parse(dir, config)
+ # Parses a codebase to provide objects
+ #
+ # @param dir [String] the directory to parse
+ # @param config [Inch::Config::Codebase]
+ # @return [#objects]
+ def self.parse(dir, config = Inch::Config.codebase)
+ Config.namespace(config.language, :Provider)
+ .const_get(config.object_provider)
+ .parse(dir, config)
end
-
- # @return [Module]
- def self.provider_for(type)
- const_get(type)
- end
end
end
end
-
-require 'inch/code_object/provider/yard'