Class: PerlFunc
- Inherits:
-
AbstractIndex
- Object
- AbstractIndex
- PerlFunc
- Defined in:
- lib/langhelp/lh_perl.rb
Constant Summary collapse
- FUNCLIST_BEGINS_FROM =
/Alphabetical Listing of Perl Functions/- REJECT_REGEXP =
/^\*$/
Constants inherited from AbstractIndex
Constants included from LocalVariables
LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END
Constants included from KanjiConverter
Instance Attribute Summary
Attributes inherited from AbstractIndex
Instance Method Summary collapse
Methods inherited from AbstractIndex
Methods included from LocalVariables
Methods included from FilenameString
#abbreviate_filename, #abbreviate_filename!, #normalize_filename!
Methods included from KanjiConverter
Methods included from MkArray
Methods included from EmacsLispString
Constructor Details
This class inherits a constructor from AbstractIndex
Instance Method Details
#extract_funcs(pod_source) ⇒ Object
69 70 71 72 73 74 75 76 |
# File 'lib/langhelp/lh_perl.rb', line 69 def extract_funcs(pod_source) _, text = pod_source.split(FUNCLIST_BEGINS_FROM, 2) @funcs = text.scan(/^=item (.+)$/).flatten.reject{|func| func =~ REJECT_REGEXP }.map {|usage| name = usage.split(/[\s\(]/)[0] name.sub!(/\/.+$/,'') [ name, usage ] } end |
#init(x = {}) ⇒ Object
62 63 64 65 |
# File 'lib/langhelp/lh_perl.rb', line 62 def init(x={}) @perlfunc_pod = x[:perlfunc_pod] normalize_filename! @perlfunc_pod end |
#to_e(out) ⇒ Object
78 79 80 81 82 83 |
# File 'lib/langhelp/lh_perl.rb', line 78 def to_e(out) extract_funcs File.read(@perlfunc_pod) @funcs.each do |name, usage| out << format("# %-30s#{SPACES}(lh-perlfunc %s)\n", usage, lisp_dump_string(name)) end end |