Class: CoachZed::Catalog::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/coach_zed/catalog.rb

Constant Summary collapse

IGNORED_BASENAMES =
%w[INDEX.md TEMPLATE.md].freeze

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Loader

Returns a new instance of Loader.



80
81
82
# File 'lib/coach_zed/catalog.rb', line 80

def initialize(root)
  @root = Pathname(root)
end

Instance Method Details

#loadObject



84
85
86
87
88
89
90
91
# File 'lib/coach_zed/catalog.rb', line 84

def load
  Dir.glob(@root.join("**/*.md")).sort.filter_map do |file|
    path = Pathname(file)
    next if ignored?(path)

    parse_entry(path)
  end
end