Class: PerlDoc

Inherits:
AbstractIndex show all
Defined in:
lib/langhelp/lh_perl.rb

Constant Summary

Constants inherited from AbstractIndex

AbstractIndex::SPACES

Constants included from LocalVariables

LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END

Constants included from KanjiConverter

KanjiConverter::KCONVERTERS

Instance Attribute Summary

Attributes inherited from AbstractIndex

#arg1, #conf, #title

Instance Method Summary collapse

Methods inherited from AbstractIndex

#initialize, #output_title

Methods included from LocalVariables

#insert_local_variables

Methods included from FilenameString

#abbreviate_filename, #abbreviate_filename!, #normalize_filename!

Methods included from KanjiConverter

#encoding, #kconv

Methods included from MkArray

#mkarray

Methods included from EmacsLispString

#lisp_dump_string

Constructor Details

This class inherits a constructor from AbstractIndex

Instance Method Details

#collect_filesObject



93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/langhelp/lh_perl.rb', line 93

def collect_files
  @modules = @perl_path.map {|dir|
    modules = []
    Dir.chdir(dir) do
      [ Dir["**/*.pod"]+Dir["**/*.pm"]+Dir["**/*.pl"] ].flatten.each do |pod|
        next if pod =~ /^pod\//
        modules << pod.gsub(/\//, '::').gsub(/\.[^\.]+$/,'')
      end
    end
    modules
  }.flatten.sort.uniq
end

#init(x = {}) ⇒ Object



88
89
90
91
# File 'lib/langhelp/lh_perl.rb', line 88

def init(x={})
  @perl_path = x[:perl_path]
  normalize_filename! *@perl_path
end

#to_e(out) ⇒ Object



106
107
108
109
110
111
# File 'lib/langhelp/lh_perl.rb', line 106

def to_e(out)
  collect_files
  @modules.each do |mod|
    out << format("# %-30s#{SPACES}(lh-perldoc %s)\n", mod, lisp_dump_string(mod))
  end
end