Class: Specinfra::Helper::DetectOs::Clearlinux
- Inherits:
-
Specinfra::Helper::DetectOs
- Object
- Specinfra::Helper::DetectOs
- Specinfra::Helper::DetectOs::Clearlinux
- Defined in:
- lib/specinfra/helper/detect_os/clearlinux.rb
Instance Method Summary collapse
Methods inherited from Specinfra::Helper::DetectOs
detect, #initialize, #run_command
Constructor Details
This class inherits a constructor from Specinfra::Helper::DetectOs
Instance Method Details
#detect ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/specinfra/helper/detect_os/clearlinux.rb', line 2 def detect swupd_info = run_command('swupd info') if swupd_info.success? release = nil swupd_info.stdout.each_line do |line| release = line.gsub(/\s+/, '').split(':').last if line =~ /^Installed version:/ end { :family => 'clearlinux', :release => release } end end |