Module: Manpage::Manpages

Defined in:
lib/langhelp/langhelp-base.rb

Overview

manipulate multiple manpages (It does not read manpage contents.)

Defined Under Namespace

Classes: Man

Instance Method Summary collapse

Instance Method Details

#manpagesObject



310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/langhelp/langhelp-base.rb', line 310

def manpages
  @sections.map {|section|
    sectdir = "man#{section}"
    @manpath.map {|dir|
      if File.directory? dir
        Dir[File.join(dir,sectdir,@glob)].map {|file|
          man = File.basename(file).sub(/\.\d\w*(\.gz)?$/,'')
          Man.new section, man
        }
      end
    }
  }.flatten.compact
end

#to_e(io) ⇒ Object



325
326
327
328
329
# File 'lib/langhelp/langhelp-base.rb', line 325

def to_e(io)
  manpages.each do |man|
    io << %Q!# (lh-man "#{man.section} #{man.man}")\n!
  end
end