lib/hanami/view/rendering/partial_templates_finder.rb in hanami-view-0.6.1 vs lib/hanami/view/rendering/partial_templates_finder.rb in hanami-view-0.7.0
- old
+ new
@@ -5,40 +5,40 @@
module View
module Rendering
# Find partial templates in the file system
#
# @api private
- # @since x.x.x
+ # @since 0.7.0
#
# @see View::Template
class PartialTemplatesFinder
# Search pattern for partial file names
#
# @api private
- # @since x.x.x
+ # @since 0.7.0
PARTIAL_PATTERN = '_*'.freeze
# @api private
- # @since x.x.x
+ # @since 0.7.0
PARTIAL_PARTS_SEPARATOR = '.'.freeze
attr_reader :configuration
# Initializes a new PartialTemplatesFinder
#
# @param configuration [Configuration] the configuration object
#
- # @since x.x.x
+ # @since 0.7.0
def initialize(configuration)
@configuration = configuration
end
# Find partials under the given path
#
# @return [Array] array of PartialFinder objects
#
- # @since x.x.x
+ # @since 0.7.0
def find
_find_partials(configuration.root).map do |template|
partial_path, partial_base_name = Pathname(template).relative_path_from(configuration.root).split
partial_base_parts = partial_base_name.to_s.split(PARTIAL_PARTS_SEPARATOR)
@@ -56,10 +56,10 @@
#
# @param path [String] the path under which we should search for partials
#
# @return [Array] an array of strings for each matching partial template file found
#
- # @since x.x.x
+ # @since 0.7.0
# @api private
def _find_partials(path)
Dir.glob("#{ [path, TemplatesFinder::RECURSIVE, PARTIAL_PATTERN].join(::File::SEPARATOR) }.#{TemplatesFinder::FORMAT}.#{TemplatesFinder::ENGINES}")
end
end