Class: Babushka::RedhatSystemProfile

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

Direct Known Subclasses

FedoraSystemProfile

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, #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

#flavourObject



159
160
161
# File 'lib/babushka/system_profile.rb', line 159

def flavour
  version_info[/^Red Hat/i] ? :redhat : version_info[/^\w+/].downcase.to_sym
end

#flavour_strObject



163
164
165
166
167
168
# File 'lib/babushka/system_profile.rb', line 163

def flavour_str
  {
    :centos => 'CentOS',
    :redhat => 'Red Hat'
  }[flavour]
end

#get_version_infoObject



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

def get_version_info; File.read('/etc/redhat-release') end

#pkg_helperObject



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

def pkg_helper; YumHelper end

#versionObject



170
171
172
# File 'lib/babushka/system_profile.rb', line 170

def version
  version_info[/release [\d\.]+ \((\w+)\)/i, 1] || version_info[/release ([\d\.]+)/i, 1]
end