Class: Babushka::DebianSystemProfile

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

Instance Method Summary collapse

Methods inherited from LinuxSystemProfile

#cpus, #public_ip, #release, #system, #system_str, #total_memory

Methods inherited from SystemProfile

#bsd?, #cpu_type, #cpus, #description, #differentiator_for, #library_ext, #linux?, #match_list, #matcher, #matches?, #name_str, #osx?, #pkg_helper_key, #pkg_helper_str, #public_ip, #total_memory, #version_info

Methods included from ShellHelpers

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

#ensure_lsb_releaseObject



151
152
153
154
155
# File 'lib/babushka/system_profile.rb', line 151

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

#flavourObject



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

def flavour; flavour_str.downcase.to_sym end

#flavour_strObject



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

def flavour_str; version_info.val_for 'Distributor ID' end

#get_version_infoObject



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

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

#nameObject



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

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

#pkg_helperObject



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

def pkg_helper; AptHelper end

#versionObject



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

def version; version_info.val_for 'Release' end