Sha256: 4b836a201e906d9774acf6c8acd1ccc123891a3a76a1c8ac78dcdcffff17ecdf
Contents?: true
Size: 494 Bytes
Versions: 20
Compression:
Stored size: 494 Bytes
Contents
# frozen_string_literal: true class UserAttr def self.get_attributes_by_name(name) attributes = nil File.readlines('/etc/user_attr').each do |line| next if line =~ /^#/ token = line.split(':') if token[0] == name attributes = {:name => name} token[4].split(';').each do |attr| key_value = attr.split('=') attributes[key_value[0].intern] = key_value[1].strip end break end end attributes end end
Version data entries
20 entries across 20 versions & 1 rubygems