Class: Trifle::Docs::Harvester::Markdown::Sieve

Inherits:
Sieve
  • Object
show all
Defined in:
lib/trifle/docs/harvester/markdown.rb

Instance Attribute Summary

Attributes inherited from Sieve

#file, #path

Instance Method Summary collapse

Methods inherited from Sieve

#initialize

Constructor Details

This class inherits a constructor from Trifle::Docs::Harvester::Sieve

Instance Method Details

#match?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/trifle/docs/harvester/markdown.rb', line 17

def match?
  file.end_with?('.md')
end

#to_urlObject



21
22
23
24
25
# File 'lib/trifle/docs/harvester/markdown.rb', line 21

def to_url
  file.gsub(%r{^#{path}/}, '')
      .gsub(%r{/?index\.md}, '')
      .gsub(/\.md/, '')
end