Class: Babushka::LinuxSystemProfile
Instance Method Summary
collapse
#bsd?, #cpu_type, #description, #differentiator_for, #library_ext, #linux?, #match_list, #matcher, #matches?, #name, #name_str, #osx?, #pkg_helper, #pkg_helper_key, #pkg_helper_str, #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
133
|
# File 'lib/babushka/system_profile.rb', line 133
def cpus; shell("cat /proc/cpuinfo | grep '^processor\\b' | wc -l").to_i end
|
129
|
# File 'lib/babushka/system_profile.rb', line 129
def flavour; :unknown end
|
#flavour_str ⇒ Object
130
|
# File 'lib/babushka/system_profile.rb', line 130
def flavour_str; 'Linux' end
|
#public_ip ⇒ Object
136
137
138
139
140
|
# File 'lib/babushka/system_profile.rb', line 136
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
|
132
|
# File 'lib/babushka/system_profile.rb', line 132
def release; version end
|
127
|
# File 'lib/babushka/system_profile.rb', line 127
def system; :linux end
|
#system_str ⇒ Object
128
|
# File 'lib/babushka/system_profile.rb', line 128
def system_str; 'Linux' end
|
#total_memory ⇒ Object
134
|
# File 'lib/babushka/system_profile.rb', line 134
def total_memory; shell("free -b").val_for("Mem").scan(/^\d+\b/).first.to_i end
|
131
|
# File 'lib/babushka/system_profile.rb', line 131
def version; 'unknown' end
|