Module: Kernel

Defined in:
lib/cosmos/core_ext/kernel.rb

Overview

COSMOS specific additions to the Ruby Kernel module

Instance Method Summary collapse

Instance Method Details

#calling_method(start = 1) ⇒ Symbol



35
36
37
# File 'lib/cosmos/core_ext/kernel.rb', line 35

def calling_method(start = 1)
  caller[start][/`([^']*)'/, 1].intern
end

#is_mac?Boolean



24
25
26
27
28
29
30
31
# File 'lib/cosmos/core_ext/kernel.rb', line 24

def is_mac?
  _, platform, *_ = RUBY_PLATFORM.split("-")
  result = false
  if platform =~ /darwin/
    result = true
  end
  return result
end

#is_windows?Boolean



14
15
16
17
18
19
20
21
# File 'lib/cosmos/core_ext/kernel.rb', line 14

def is_windows?
  _, platform, *_ = RUBY_PLATFORM.split("-")
  result = false
  if platform == 'mswin32' or platform == 'mingw32'
    result = true
  end
  return result
end