Class: Babushka::SystemProfile
Instance Method Summary
collapse
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
#bsd? ⇒ Boolean
24
|
# File 'lib/babushka/system_profile.rb', line 24
def bsd?; system == :bsd end
|
33
34
35
36
37
38
39
|
# File 'lib/babushka/system_profile.rb', line 33
def cpu_type
shell('uname -m').tap {|result|
result.replace 'x86' if result[/^i.86$/]
result.replace 'x86_64' if result == 'amd64'
}
end
|
41
42
43
|
# File 'lib/babushka/system_profile.rb', line 41
def cpus
raise "#{self.class}#cpus is unimplemented."
end
|
#description ⇒ Object
53
54
55
56
57
58
59
60
|
# File 'lib/babushka/system_profile.rb', line 53
def description
[
(flavour_str unless flavour_str == system_str),
system_str,
version,
("(#{name_str})" unless name_str.nil?)
].compact.join(' ')
end
|
#differentiator_for(specs) ⇒ Object
13
14
15
16
|
# File 'lib/babushka/system_profile.rb', line 13
def differentiator_for(specs)
differentiator = matcher.differentiator_for(specs)
send("#{differentiator}_str") unless differentiator.nil?
end
|
#library_ext ⇒ Object
The extension that dynamic libraries are given on this system. On linux libraries are named like ‘libssl.so’; on OS X, ‘libssl.bundle’.
31
|
# File 'lib/babushka/system_profile.rb', line 31
def library_ext; 'so' end
|
#linux? ⇒ Boolean
22
|
# File 'lib/babushka/system_profile.rb', line 22
def linux?; system == :linux end
|
#match_list ⇒ Object
11
|
# File 'lib/babushka/system_profile.rb', line 11
def match_list() matcher.list end
|
6
7
8
|
# File 'lib/babushka/system_profile.rb', line 6
def matcher
@matcher ||= SystemMatcher.new(system, flavour, name, pkg_helper_key)
end
|
#matches?(specs) ⇒ Boolean
10
|
# File 'lib/babushka/system_profile.rb', line 10
def matches?(specs) matcher.matches?(specs) end
|
62
63
64
|
# File 'lib/babushka/system_profile.rb', line 62
def name
(SystemDefinitions.names[system][flavour] || {})[release]
end
|
#osx? ⇒ Boolean
23
|
# File 'lib/babushka/system_profile.rb', line 23
def osx?; system == :osx end
|
#pkg_helper_key ⇒ Object
27
|
# File 'lib/babushka/system_profile.rb', line 27
def pkg_helper_key; pkg_helper.try(:manager_key) end
|
#pkg_helper_str ⇒ Object
28
|
# File 'lib/babushka/system_profile.rb', line 28
def pkg_helper_str; pkg_helper_key.to_s.capitalize end
|
#public_ip ⇒ Object
49
50
51
|
# File 'lib/babushka/system_profile.rb', line 49
def public_ip
raise "#{self.class}#public_ip is unimplemented."
end
|
#total_memory ⇒ Object
45
46
47
|
# File 'lib/babushka/system_profile.rb', line 45
def total_memory
raise "#{self.class}#total_memory is unimplemented."
end
|
#version_info ⇒ Object
18
19
20
|
# File 'lib/babushka/system_profile.rb', line 18
def version_info
@_version_info ||= get_version_info
end
|