Sha256: ec010dab13b3cf167636775d5b7ad94a65c2036c073fba335d3fc7352ca4de71

Contents?: true

Size: 428 Bytes

Versions: 3

Compression:

Stored size: 428 Bytes

Contents

# LinuxAdmin /etc/issue Representation
#
# Copyright (C) 2014 Red Hat Inc.
# Licensed under the MIT License

require 'singleton'

class LinuxAdmin
  class EtcIssue
    include Singleton

    PATH = '/etc/issue'

    def include?(osname)
      data.downcase.include?(osname.to_s.downcase)
    end

    def data
      @data ||= File.exist?(PATH) ? File.read(PATH) : ""
    end

    def refresh
      @data = nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
linux_admin-0.9.4 lib/linux_admin/etc_issue.rb
linux_admin-0.9.3 lib/linux_admin/etc_issue.rb
linux_admin-0.9.2 lib/linux_admin/etc_issue.rb