Module: ElibMgmt::Cli

Includes:
TR::CondUtils
Defined in:
lib/elib_mgmt/cli.rb,
lib/elib_mgmt/cli/config.rb,
lib/elib_mgmt/cli/version.rb,
lib/elib_mgmt/cli/file_filter.rb

Defined Under Namespace

Classes: Config, ConfigError, Error, FileFilter

Constant Summary collapse

VERSION =
"0.1.12"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.is_user_debug_on?Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/elib_mgmt/cli.rb', line 26

def self.is_user_debug_on?
  val = ENV["ELIBMGMT_DEBUG"]
  (not_empty?(val) and val == "true")
end

.loggerObject



19
20
21
22
23
24
# File 'lib/elib_mgmt/cli.rb', line 19

def self.logger
  if @_logger.nil?
    @_logger = TeLogger::Tlogger.new
  end
  @_logger
end

.move_to_int_bin(root, file) ⇒ Object



31
32
33
34
35
36
37
38
# File 'lib/elib_mgmt/cli.rb', line 31

def self.move_to_int_bin(root, file)
  if @_bin.nil?
    @_bin = File.join(root, ".elBin") 
    FileUtils.mkdir_p(@_bin) if not File.exist?(@_bin)
  end

  FileUtils.mv(file, File.join(@_bin, File.basename(file)))
end

Instance Method Details

#udebug(msg) ⇒ Object



16
17
18
# File 'lib/elib_mgmt/cli.rb', line 16

def udebug(msg)
  logger.tdebug(:elib, msg) if is_user_debug_on?
end