module FortMux

Public Class Methods

config_file_path(config_name) click to toggle source
# File lib/FortMux.rb, line 138
def self.config_file_path config_name
  File.join FortMux::config_folder, "#{config_name}.yaml"
end
config_files() click to toggle source
# File lib/FortMux.rb, line 141
def self.config_files
  files = []
  Dir.foreach(FortMux::config_folder) do |f|
    f_path = File.join(FortMux::config_folder,f)
    if File.file?(f_path) && File.extname(f) == ".yaml"
      files << File.basename(f,".yaml")
    end
  end
  files
end
config_folder() click to toggle source
# File lib/FortMux.rb, line 151
def self.config_folder
  folder_path = File.join(Dir.home,".fortmux")
  Dir.mkdir(folder_path) unless File.directory? folder_path
  folder_path
end
load(config_name,options) click to toggle source
# File lib/FortMux.rb, line 156
def self.load(config_name,options)
  options = options || {}
  execute = options[:execute] || true
  config_file_path = FortMux::config_file_path config_name
  FortMux::Log::logger "load #{config_file_path}"
  raise IOError, "Config #{config_name} not found" unless File.exist? config_file_path
  loader = FortMux::Config.new config_file_path
  loader.load
end
log_file_path() click to toggle source
# File lib/FortMux.rb, line 165
def self.log_file_path
  folder_path = File.join(FortMux::config_folder,"log")
  Dir.mkdir(folder_path) unless File.directory? folder_path
  File.join folder_path,"fortmux.log"
end