Top Level Namespace

Constant Summary collapse

SHATTERED_OGRE_DLLS =
File.expand_path(File.dirname(__FILE__)+"/"+simplified_platform)

Instance Method Summary collapse

Instance Method Details

#linux?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/platform.rb', line 24

def linux?
	PLATFORM =~ /linux/
end

#mac?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/platform.rb', line 16

def mac?
  return PLATFORM =~ /darwin/
end

#short_platformObject

Determines which build file to load

Raises:

  • (StandardError)


29
30
31
32
33
34
# File 'lib/platform.rb', line 29

def short_platform
  return "osx" if mac?
  return "windows" if windows?
  return "linux" if linux?
	raise StandardError, "Could not determine platform #{PLATFORM.inspect}, please report this at http://forum.shatteredruby.com ."
end

#simplified_platformObject

Used to create common directories for differing OS versions. (darwin8.1 vs darwin8.0.2, etc)

Raises:

  • (StandardError)


3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/platform.rb', line 3

def simplified_platform
  # intel mac
  return "universal-darwin" if PLATFORM =~ /i686-darwin/ || PLATFORM == "universal-darwin8.0" 
  # powerpc mac
  return `ruby -e "puts PLATFORM"`.chomp if mac?
  # Linux distrobutions can be i386 - i686, so just treat it as linux
  # TODO 64 bit support?
	return 'linux' if linux?
	# windows
	return 'windows' if windows?
  raise StandardError, "Could not determine platform #{PLATFORM.inspect}, please report this at http://forum.shatteredruby.com."
end

#windows?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/platform.rb', line 20

def windows?
  return PLATFORM =~ /mswin/
end