Class: Babushka::LinuxSystemProfile
Instance Method Summary
collapse
#bsd?, #codename, #codename_str, #cpu_type, #definition, #description, #differentiator_for, #flavour, #hostname, #library_ext, #linux?, #match_list, #matcher, #matches?, #osx?, #pkg_helper, #pkg_helper_key, #pkg_helper_str, #system, #system_description, #version_info
cmd_dir, current_username, log_shell, login_shell, raw_shell, shell, shell!, shell?, shell_cmd, sudo, which
Methods included from LogHelpers
debug, deprecated!, log, log_block, log_error, log_ok, log_stderr, log_warn, removed!
Instance Method Details
135
|
# File 'lib/babushka/system_profile.rb', line 135
def cpus; shell("cat /proc/cpuinfo | grep '^processor\\b' | wc -l").to_i end
|
#flavour_str ⇒ Object
132
|
# File 'lib/babushka/system_profile.rb', line 132
def flavour_str; 'Unknown' end
|
#public_ip ⇒ Object
138
139
140
141
142
|
# File 'lib/babushka/system_profile.rb', line 138
def public_ip
shell('ifconfig',
shell('netstat -nr').val_for("0.0.0.0").scan(/\w+$/).first
).val_for("inet addr").scan(/^[\d\.]+/).first
end
|
134
|
# File 'lib/babushka/system_profile.rb', line 134
def release; version end
|
#system_str ⇒ Object
131
|
# File 'lib/babushka/system_profile.rb', line 131
def system_str; 'Linux' end
|
#total_memory ⇒ Object
136
|
# File 'lib/babushka/system_profile.rb', line 136
def total_memory; shell("free -b").val_for("Mem").scan(/^\d+\b/).first.to_i end
|
133
|
# File 'lib/babushka/system_profile.rb', line 133
def version; nil end
|