module System def self.detect_os case RUBY_PLATFORM when /darwin/ :macos when /linux/ if File.exist?('/etc/debian_version') :debian else :linux_other end else :unknown end end OS = detect_os case OS when :macos require_relative './system/macos' extend MacOSSystem when :debian require_relative './system/debian' extend DebianSystem else raise "Operating system not supported" end def self.os_info puts os_name end end