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