mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 23:52:35 +00:00
Added monkey patch to support rubies < 2.5
This commit is contained in:
10
Gemfile.lock
10
Gemfile.lock
@@ -1,13 +1,10 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
chunky_png (1.3.10)
|
glu (8.3.0)
|
||||||
glu (8.2.2)
|
glu (8.3.0-x86-mingw32)
|
||||||
glu (8.2.2-x86-mingw32)
|
|
||||||
gosu (0.13.3)
|
gosu (0.13.3)
|
||||||
gosu (0.13.3-x86-mingw32)
|
gosu (0.13.3-x86-mingw32)
|
||||||
oily_png (1.2.1)
|
|
||||||
chunky_png (~> 1.3.7)
|
|
||||||
opengl-bindings (1.6.6)
|
opengl-bindings (1.6.6)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
@@ -17,8 +14,7 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
glu
|
glu
|
||||||
gosu
|
gosu
|
||||||
oily_png
|
|
||||||
opengl-bindings
|
opengl-bindings
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.16.1
|
1.16.2
|
||||||
|
|||||||
19
i-mic-fps.rb
19
i-mic-fps.rb
@@ -20,6 +20,25 @@ end
|
|||||||
|
|
||||||
BoundingBox = Struct.new(:min_x, :min_y, :min_z, :max_x, :max_y, :max_z)
|
BoundingBox = Struct.new(:min_x, :min_y, :min_z, :max_x, :max_y, :max_z)
|
||||||
|
|
||||||
|
if RUBY_VERSION < "2.5.0"
|
||||||
|
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
|
||||||
|
puts "|NOTICE| Ruby is #{RUBY_VERSION} not 2.5.0+..............................|Notice|"
|
||||||
|
puts "|NOTICE| Monkey Patching Float to add required '.clamp' method.|Notice|"
|
||||||
|
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
|
||||||
|
puts
|
||||||
|
class Float
|
||||||
|
def clamp(min, max)
|
||||||
|
if self < min
|
||||||
|
min
|
||||||
|
elsif self > max
|
||||||
|
max
|
||||||
|
else
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
$debug = ARGV.join.include?("--debug") ? true : false
|
$debug = ARGV.join.include?("--debug") ? true : false
|
||||||
|
|
||||||
require_relative "lib/common_methods"
|
require_relative "lib/common_methods"
|
||||||
|
|||||||
Reference in New Issue
Block a user