Module: Sys::Proc::Concern::System::Generic
- Defined in:
- lib/sys/proc/concern/system/generic.rb
Overview
Provides generic methods
This generic module can be used through the system/generic
helper
in other system(s) specific modules.
This is the default (included) module when specific module is missing.
Instance Method Summary collapse
-
#default_progname ⇒ String
Get default program name.
-
#progname ⇒ String
Get program name.
-
#progname=(progname) ⇒ String
Set program name.
Instance Method Details
#default_progname ⇒ String
Get default program name
38 39 40 41 42 |
# File 'lib/sys/proc/concern/system/generic.rb', line 38 def default_progname file = caller.last.split(/:[0-9]+:in\s/).fetch(0) File.basename(file, '.rb') end |
#progname ⇒ String
Get program name
31 32 33 |
# File 'lib/sys/proc/concern/system/generic.rb', line 31 def progname $PROGRAM_NAME end |
#progname=(progname) ⇒ String
Set program name
When progname
is nil
will use a default progname
23 24 25 26 |
# File 'lib/sys/proc/concern/system/generic.rb', line 23 def progname=(progname) progname ||= default_progname $PROGRAM_NAME = progname.to_s end |