Class: Babushka::DebianSystemProfile

Inherits:
LinuxSystemProfile show all
Defined in:
lib/babushka/system_profile.rb

Instance Method Summary (collapse)

Methods inherited from LinuxSystemProfile

for_flavour, #linux?, #release, #system, #system_str

Methods inherited from SystemProfile

#bsd?, #cpu_type, #description, #differentiator_for, #first_nonmatch_for, #flavour_str_map, for_flavour, for_host, #library_ext, #linux?, #match_list, #matches?, #name_str, #osx?, #our_flavour_names, #our_flavours, #pkg_helper_key, #pkg_helper_str, #version_info

Methods included from ShellHelpers

#cmd_dir, #failable_shell, #log_shell, #login_shell, #raw_shell, #shell, #shell!, #shell?, #sudo, #which

Methods included from LogHelpers

#debug, #log, #log_block, #log_error, #log_ok, #log_verbose, #log_warn

Instance Method Details

- (Object) ensure_lsb_release



188
189
190
191
192
# File 'lib/babushka/system_profile.rb', line 188

def ensure_lsb_release
  which('lsb_release') or log("Babushka uses `lsb_release` to learn about debian-based systems.") {
    AptHelper.install!('lsb-release')
  }
end

- (Object) flavour



183
# File 'lib/babushka/system_profile.rb', line 183

def flavour; flavour_str.downcase.to_sym end

- (Object) flavour_str



184
# File 'lib/babushka/system_profile.rb', line 184

def flavour_str; version_info.val_for 'Distributor ID' end

- (Object) get_version_info



187
# File 'lib/babushka/system_profile.rb', line 187

def get_version_info; ensure_lsb_release and shell('lsb_release -a') end

- (Object) name



186
# File 'lib/babushka/system_profile.rb', line 186

def name; version_info.val_for('Codename').to_sym end

- (Object) pkg_helper



193
# File 'lib/babushka/system_profile.rb', line 193

def pkg_helper; AptHelper end

- (Object) total_memory



194
# File 'lib/babushka/system_profile.rb', line 194

def total_memory; shell("free -b").val_for("Mem").scan(/^\d+\b/).first.to_i end

- (Object) version



185
# File 'lib/babushka/system_profile.rb', line 185

def version; version_info.val_for 'Release' end