Class: RunConfig

Inherits:
Object show all
Defined in:
lib/langhelp/langhelp-sub.rb

Overview

run config run config

c = RunConfig.new("test")
c.run_user_config
c.run_local_config

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ RunConfig

Returns a new instance of RunConfig.



229
230
231
# File 'lib/langhelp/langhelp-sub.rb', line 229

def initialize(name)
  @name = name
end

Instance Method Details

#run_local_configObject



237
238
239
240
241
242
243
244
245
# File 'lib/langhelp/langhelp-sub.rb', line 237

def run_local_config
  rcs = []
  rcs.push ".#{@name}rc"
  rcs.push "#{@name}.rc"
  rcs.push "_#{@name}rc"
  rcs.push "$#{@name}rc"
  rcs.push "#{@name}rc"
  run_config rcs
end

#run_user_configObject



233
234
235
# File 'lib/langhelp/langhelp-sub.rb', line 233

def run_user_config
  run_config [File.expand_path("~/.#{@name}rc")] if ENV.key?("HOME")
end