Sha256: 82eeeec0b51972edf42bfd7f6f4f664d6037b07e0e7c980e9362e76a50f57533

Contents?: true

Size: 935 Bytes

Versions: 37

Compression:

Stored size: 935 Bytes

Contents

# encoding: ascii-8bit

# Copyright 2014 Ball Aerospace & Technologies Corp.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.txt

# COSMOS specific additions to the Ruby Kernel module
module Kernel
  # @return [Boolean] Whether the current platform is Windows
  def is_windows?
    Gem.win_platform?
  end

  # @return [Boolean] Whether the current platform is Mac
  def is_mac?
    _, platform, *_ = RUBY_PLATFORM.split("-")
    result = false
    if platform =~ /darwin/
      result = true
    end
    return result
  end

  # @param start [Integer] The number of stack entries to skip
  # @return [Symbol] The name of the calling method
  def calling_method(start = 1)
    caller[start][/`([^']*)'/, 1].intern
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
cosmos-4.5.2-java lib/cosmos/core_ext/kernel.rb
cosmos-4.5.2 lib/cosmos/core_ext/kernel.rb
cosmos-4.5.1-java lib/cosmos/core_ext/kernel.rb
cosmos-4.5.1 lib/cosmos/core_ext/kernel.rb
cosmos-4.5.0-java lib/cosmos/core_ext/kernel.rb
cosmos-4.5.0 lib/cosmos/core_ext/kernel.rb
cosmos-4.4.2-java lib/cosmos/core_ext/kernel.rb
cosmos-4.4.2 lib/cosmos/core_ext/kernel.rb
cosmos-4.4.1-java lib/cosmos/core_ext/kernel.rb
cosmos-4.4.1 lib/cosmos/core_ext/kernel.rb
cosmos-4.4.0-java lib/cosmos/core_ext/kernel.rb
cosmos-4.4.0 lib/cosmos/core_ext/kernel.rb
cosmos-4.3.0-java lib/cosmos/core_ext/kernel.rb
cosmos-4.3.0 lib/cosmos/core_ext/kernel.rb
cosmos-4.2.4-java lib/cosmos/core_ext/kernel.rb
cosmos-4.2.4 lib/cosmos/core_ext/kernel.rb
cosmos-4.2.3-java lib/cosmos/core_ext/kernel.rb
cosmos-4.2.3 lib/cosmos/core_ext/kernel.rb
cosmos-4.2.2-java lib/cosmos/core_ext/kernel.rb
cosmos-4.2.2 lib/cosmos/core_ext/kernel.rb