Method: Train::Platforms::Detect::Helpers::Linux#lsb_release

Defined in:
lib/train/platforms/detect/helpers/os_linux.rb

#lsb_release(content) ⇒ Object



55
56
57
58
59
60
61
62
63
64
# File 'lib/train/platforms/detect/helpers/os_linux.rb', line 55

def lsb_release(content)
  id = /^Distributor ID:\s+(.+)$/.match(content)
  release = /^Release:\s+(.+)$/.match(content)
  codename = /^Codename:\s+(.+)$/.match(content)
  {
    id:       id.nil? ? nil : id[1],
    release:  release.nil? ? nil : release[1],
    codename: codename.nil? ? nil : codename[1],
  }
end