Sha256: 487aa13e343590da8a21ba27eab48205494e8308c7fdf2c1efede5dbd6fe6364
Contents?: true
Size: 1.23 KB
Versions: 9
Compression:
Stored size: 1.23 KB
Contents
module KPM module SystemProxy module EntropyAvailable class << self def fetch entropy_available = nil if OS.windows? entropy_available = fetch_windows elsif OS.linux? entropy_available = fetch_linux elsif OS.mac? entropy_available = fetch_mac end entropy_available end def get_labels labels = [{:label => :entropy}, {:label => :value}] labels end private def fetch_linux entropy_available_data = `cat /proc/sys/kernel/random/entropy_avail 2>&1`.gsub("\n",'') entropy_available = get_hash(entropy_available_data) entropy_available end def fetch_mac entropy_available = get_hash('-') entropy_available end def fetch_windows entropy_available = get_hash('-') entropy_available end def get_hash(data) entropy_available = Hash.new entropy_available['entropy_available'] = {:entropy => 'available', :value => data} entropy_available end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems