Sha256: 2eee2b87db58286d0acd9fef14f1a6201332efaf41fe5a5c5650ede19a62c0f0

Contents?: true

Size: 570 Bytes

Versions: 9

Compression:

Stored size: 570 Bytes

Contents

require 'win32/registry'

module Logirel::VS
  class Environment
    attr_reader :owner
    attr_reader :organization

    def initialize
      @owner = registry_get 'SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'RegisteredOwner' || 'OWNER'
      @organization = registry_get 'SOFTWARE\Microsoft\Windows NT\CurrentVersion', 'RegisteredOrganization' || 'ORGANIZATION'
    end

    private
    def registry_get(path, key)
      Win32::Registry::HKEY_LOCAL_MACHINE.open(path) do |reg|
        reg_typ, reg_val = reg.read(key)
        reg_val
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logirel-0.1.6 lib/logirel/vs/environment.rb
logirel-0.1.5 lib/logirel/vs/environment.rb
logirel-0.1.4 lib/logirel/vs/environment.rb
logirel-0.1.3 lib/logirel/vs/environment.rb
logirel-0.1.2 lib/logirel/vs/environment.rb
logirel-0.1.1 lib/logirel/vs/environment.rb
logirel-0.1.0 lib/logirel/vs/environment.rb
logirel-0.0.18 lib/logirel/vs/environment.rb
logirel-0.0.17 lib/logirel/vs/environment.rb