gems.sass-3.4.24.lib.sass.util.cross_platform_random.rb Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sass-maven-plugin Show documentation
Show all versions of sass-maven-plugin Show documentation
A Maven Plugin that compiles Sass files.
module Sass
module Util
# Ruby 1.8 doesn't support an actual Random class with a settable seed.
class CrossPlatformRandom
def initialize(seed = nil)
if Sass::Util.ruby1_8?
srand(seed) if seed
else
@random = seed ? ::Random.new(seed) : ::Random.new
end
end
def rand(*args)
return @random.rand(*args) if @random
Kernel.rand(*args)
end
end
end
end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy