Sha256: c246f65a307f27fa84a7522c983bfdbb9dee46895f74a138baea4139335a9421

Contents?: true

Size: 649 Bytes

Versions: 11

Compression:

Stored size: 649 Bytes

Contents

# Helper methods here and in the required files can be used by Origen during the bootup process.
# (e.g., in site config ERB files)
# This can be expanded as needed to provide more helpers.
module Origen
  # NOTE: Gems are not allowed to be required here, only Ruby stlibs
  require 'socket'
  require_relative '../operating_systems'

  # Platform independent means of retrieving the hostname
  def self.hostname
    # gethostbyname is deprecated in favor of Addrinfo#getaddrinfo
    # rubocop:disable Lint/DeprecatedClassMethods
    Socket.gethostbyname(Socket.gethostname).first.downcase
    # rubocop:enable Lint/DeprecatedClassMethods
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
origen-0.60.19 lib/origen/boot/api.rb
origen-0.60.18 lib/origen/boot/api.rb
origen-0.60.17 lib/origen/boot/api.rb
origen-0.60.16 lib/origen/boot/api.rb
origen-0.60.14 lib/origen/boot/api.rb
origen-0.60.13 lib/origen/boot/api.rb
origen-0.60.12 lib/origen/boot/api.rb
origen-0.60.11 lib/origen/boot/api.rb
origen-0.60.10 lib/origen/boot/api.rb
origen-0.60.9 lib/origen/boot/api.rb
origen-0.60.8 lib/origen/boot/api.rb