Class: MkLangHelp
- Includes:
- GeneratedMessage, LocalVariables
- Defined in:
- lib/langhelp/mklanghelp.rb
Constant Summary
Constants included from LocalVariables
LocalVariables::ANCHOR_BEGIN, LocalVariables::ANCHOR_END
Instance Attribute Summary collapse
-
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
-
#eval_expr ⇒ Object
Returns the value of attribute eval_expr.
-
#index_suffix ⇒ Object
Returns the value of attribute index_suffix.
-
#init_script ⇒ Object
Returns the value of attribute init_script.
-
#langhelp_home ⇒ Object
Returns the value of attribute langhelp_home.
-
#langs ⇒ Object
readonly
Returns the value of attribute langs.
-
#no_init ⇒ Object
Returns the value of attribute no_init.
-
#output_stdout ⇒ Object
Returns the value of attribute output_stdout.
Instance Method Summary collapse
-
#initialize ⇒ MkLangHelp
constructor
A new instance of MkLangHelp.
- #write(langs_to_output) ⇒ Object
Methods included from GeneratedMessage
Methods included from FilenameString
#abbreviate_filename, #abbreviate_filename!, #normalize_filename!
Methods included from LocalVariables
Constructor Details
#initialize ⇒ MkLangHelp
Returns a new instance of MkLangHelp.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/langhelp/mklanghelp.rb', line 29 def initialize @langs = [] @make_index_proc = {} @conf = ConfigScript.new("~/.langhelp/config") $langhelp_home = @conf.LANGHELP_HOME # GLOBAL! @index_suffix = ".e" @init_script = File. "~/.langhelp/mklanghelp-init.rb" @no_init = false @langs = @conf.lang.keys.map{|l| l.to_s} end |
Instance Attribute Details
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
43 44 45 |
# File 'lib/langhelp/mklanghelp.rb', line 43 def debug_mode @debug_mode end |
#eval_expr ⇒ Object
Returns the value of attribute eval_expr.
44 45 46 |
# File 'lib/langhelp/mklanghelp.rb', line 44 def eval_expr @eval_expr end |
#index_suffix ⇒ Object
Returns the value of attribute index_suffix.
43 44 45 |
# File 'lib/langhelp/mklanghelp.rb', line 43 def index_suffix @index_suffix end |
#init_script ⇒ Object
Returns the value of attribute init_script.
43 44 45 |
# File 'lib/langhelp/mklanghelp.rb', line 43 def init_script @init_script end |
#langhelp_home ⇒ Object
Returns the value of attribute langhelp_home.
42 43 44 |
# File 'lib/langhelp/mklanghelp.rb', line 42 def langhelp_home @langhelp_home end |
#langs ⇒ Object (readonly)
Returns the value of attribute langs.
41 42 43 |
# File 'lib/langhelp/mklanghelp.rb', line 41 def langs @langs end |
#no_init ⇒ Object
Returns the value of attribute no_init.
43 44 45 |
# File 'lib/langhelp/mklanghelp.rb', line 43 def no_init @no_init end |
#output_stdout ⇒ Object
Returns the value of attribute output_stdout.
44 45 46 |
# File 'lib/langhelp/mklanghelp.rb', line 44 def output_stdout @output_stdout end |
Instance Method Details
#write(langs_to_output) ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/langhelp/mklanghelp.rb', line 55 def write(langs_to_output) prepare FileUtils.cd(langhelp_home, :verbose=> !output_stdout) do langs_to_output.each do |lang| @make_index_proc[lang][] end end end |