Permalink
Browse files

not totally happy with harsh variable system.

  • Loading branch information...
1 parent e599c42 commit fb9cdbe1c234e104eae27aacb889a9a4f6153734 @scottkellum scottkellum committed Jan 13, 2013
View
@@ -48,12 +48,8 @@ def factorial(number)
end
Sass::Script::Number.new(result)
end
- def random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ## https://gist.github.com/1561650 and modified by https://github.com/bookcasey
- if type.value == "color"
- Sass::Script::Color.new(:red => rand(255), :green => rand(255), :blue => rand(255))
- else
- Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
- end
+ def random(max = Sass::Script::Number.new(100)) ## shamelessly taken from here: https://gist.github.com/1561650
+ Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
end
def hypot(a, b)
a = a.value.to_f
@@ -157,7 +153,7 @@ def atanh(rad)
module SassyMath
- VERSION = "1.4"
+ VERSION = "1.5"
DATE = "2012-07-29"
end
View
Binary file not shown.
View
Binary file not shown.
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{sassy-math}
- s.version = "1.4"
+ s.version = "1.5"
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
s.authors = ["Sam Richard", "Mario Valencia", "Scott Kellum"]
View
@@ -73,12 +73,8 @@ def factorial(number)
end
Sass::Script::Number.new(result)
end
- def random(type = Sass::Script::String.new("number"), max = Sass::Script::Number.new(100)) ## https://gist.github.com/1561650 and modified by https://github.com/bookcasey
- if type.value == "color"
- Sass::Script::Color.new(:red => rand(255), :green => rand(255), :blue => rand(255))
- else
- Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
- end
+ def random(max = Sass::Script::Number.new(100)) ## shamelessly taken from here: https://gist.github.com/1561650
+ Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
end
def hypot(a, b)
a = a.value.to_f
View
@@ -11,7 +11,7 @@ $e: 2.71828182845904523536028747135266249775724709369995;
$iter: 50;
-@debug random(color);
+@debug random(999);
//////////////////////////////
// Random Number

0 comments on commit fb9cdbe

Please sign in to comment.