Class: Babushka::OSXSystemProfile
Instance Method Summary
collapse
#bsd?, #cpu_type, #description, #differentiator_for, #linux?, #match_list, #matcher, #matches?, #name, #name_str, #osx?, #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
91
|
# File 'lib/babushka/system_profile.rb', line 91
def cpus; shell('sysctl -n hw.ncpu').to_i end
|
85
|
# File 'lib/babushka/system_profile.rb', line 85
def flavour; system end
|
#flavour_str ⇒ Object
86
|
# File 'lib/babushka/system_profile.rb', line 86
def flavour_str; system_str end
|
#get_version_info ⇒ Object
89
|
# File 'lib/babushka/system_profile.rb', line 89
def get_version_info; shell 'sw_vers' end
|
#library_ext ⇒ Object
82
|
# File 'lib/babushka/system_profile.rb', line 82
def library_ext; 'bundle' end
|
#pkg_helper ⇒ Object
90
|
# File 'lib/babushka/system_profile.rb', line 90
def pkg_helper; BrewHelper end
|
#public_ip ⇒ Object
94
95
96
97
98
|
# File 'lib/babushka/system_profile.rb', line 94
def public_ip
shell('ifconfig',
shell('netstat -nr').val_for("default").scan(/\w+$/).first
).val_for("inet").scan(/^[\d\.]+/).first
end
|
88
|
# File 'lib/babushka/system_profile.rb', line 88
def release; version.match(/^\d+\.\d+/).to_s end
|
83
|
# File 'lib/babushka/system_profile.rb', line 83
def system; :osx end
|
#system_str ⇒ Object
84
|
# File 'lib/babushka/system_profile.rb', line 84
def system_str; 'Mac OS X' end
|
#total_memory ⇒ Object
92
|
# File 'lib/babushka/system_profile.rb', line 92
def total_memory; shell("sysctl -a").val_for("hw.memsize").to_i end
|
87
|
# File 'lib/babushka/system_profile.rb', line 87
def version; version_info.val_for 'ProductVersion' end
|