sassy-math 1.3 → 1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/sassy-math.rb +7 -3
  2. data/sassy-math.gemspec +1 -1
  3. metadata +3 -3
@@ -48,8 +48,12 @@ module Sass::Script::Functions
48
48
  end
49
49
  Sass::Script::Number.new(result)
50
50
  end
51
- def random(max = Sass::Script::Number.new(100)) ## shamelessly taken from here: https://gist.github.com/1561650
52
- Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
51
+ 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
52
+ if type.value == "color"
53
+ Sass::Script::Color.new(:red => rand(255), :green => rand(255), :blue => rand(255))
54
+ else
55
+ Sass::Script::Number.new(rand(max.value), max.numerator_units, max.denominator_units)
56
+ end
53
57
  end
54
58
  def hypot(a, b)
55
59
  a = a.value.to_f
@@ -153,7 +157,7 @@ end
153
157
 
154
158
  module SassyMath
155
159
 
156
- VERSION = "1.3"
160
+ VERSION = "1.4"
157
161
  DATE = "2012-07-29"
158
162
 
159
163
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sassy-math}
5
- s.version = "1.3"
5
+ s.version = "1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
8
8
  s.authors = ["Sam Richard", "Mario Valencia", "Scott Kellum"]
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassy-math
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 3
9
- version: "1.3"
8
+ - 4
9
+ version: "1.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sam Richard