Module: Markita::Base::About

Defined in:
lib/markita/plug/about.rb

Overview

About namespace to support the /about.html route

Constant Summary collapse

ABOUT_TEXT =
<<~TEXT.freeze
  # [Markita](https://github.com/carlosjhr64/markita)

  * VERSION: #{VERSION}
  * ROOT: #{ROOT.sub(%r{^/home/\w+/}, '~/')}
  * ARGV: #{ARGV.join(' ')}
  * START_TIME: #{START_TIME}

  ## Plug.html routes:

TEXT

Class Method Summary collapse

Class Method Details

.pageObject



30
31
32
33
34
35
36
37
# File 'lib/markita/plug/about.rb', line 30

def self.page
  text = ABOUT_TEXT.dup
  plugs { |path, basename| text << "* [#{basename}](#{path})\n" }
  if defined? Favicon && Favicon::ICO
    text << "\n![Favicon](/favicon.ico)\n"
  end
  text
end

.plugsObject



21
22
23
24
25
26
27
28
# File 'lib/markita/plug/about.rb', line 21

def self.plugs
  Base.routes['GET'].each do |route|
    path = route[0].to_s
    next unless %r{^/\w+\.html$}.match? path

    yield path, File.basename(path, '.*')
  end
end