sassy_hash 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTU0M2ZhYzc5ZWIzYWE5ZTJjZTBkYzVmM2FkYzdlMTViMzlhNzllZg==
4
+ NDk3ODY3MjU0ZjMwOWVkZTQ4NDlhMGNkNzRmM2FhM2JkNzE2ZjdiNw==
5
5
  data.tar.gz: !binary |-
6
- NTI4N2Y4OTBmOTRjYjI1ZWY4OTBmOWRjMTI5YTEwMjJkNzI5NmEwMw==
6
+ OTE1MDYyNmI4NGY3NmUyOWJjY2YwZGIzODJkYTY1NjhhYzJjYjk5OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzZmODUzMGMxMTNmY2M2ZjFmNDQ2OWQzNWU2NDYyNWQ0ZTI3OGYwY2M0MTFj
10
- MjIwMzAxMzVkMGRmZmQyYjA5MDdlZmU0Y2UyZWM4MTY3NmNlOTgyYWZkYTQ3
11
- MWE0MjA1ZjI1MDQ4NWZhZTBiMWQ4NTNlMmU1ODJmMTdkM2VhMjY=
9
+ ZDY3YWI5ZTRhYzUyNjdkNDg5OThkZmNmODg0MGNhZmRhZDJiMTdkZmJhNjM5
10
+ MjRmMDFhZDhjOWMyMzI3NDJlZTgwZGY0OGI3NDY2MzZjZjI4ZDdmNWRlYzBi
11
+ ODBkNTQ0ZDFhZWEwZmQ3MGZmNjkzYWQ1NDBmODVmMzYxZTUyM2Q=
12
12
  data.tar.gz: !binary |-
13
- MjlhMTkxMDk1ZmEwNDI1ZTJiOWUxMjdmN2Q3ZWVmZjk4MWQzNjE4NjdiNTFj
14
- YTgxYmNjYjZlZTE4M2IxYjBjOTg0N2EzYzc2NzkzZmYwNmQyZDdhZmM2NGNi
15
- YjIyZGRhN2IyMTYzNjA3M2JlNjNhMjlhODdlNmJjMDdkNjJiZGI=
13
+ MzUyYzU0ZWU3ZDNjOTlmN2YwY2MyN2MyMjllYTZlMmFlMzIyYWJjZjE4YTAy
14
+ OTgzYTZhNzQ2MjEwMDgwZDc3ZDQyYzgxNTAxZmIzMDRiMTBlZGE0ZTA2MGI1
15
+ MzY1MTllMGIxYzk0OTMwNmVkNGJlMTdjYjhjNzcyYjM1N2Y5YjM=
data/lib/sassy_hash.rb CHANGED
@@ -2,7 +2,7 @@ require 'sass'
2
2
  require 'sass/scss/rx'
3
3
  class SassyHashException < Exception; end
4
4
  class SassyHash < Hash
5
- VERSION = "0.0.4"
5
+ VERSION = "0.0.5"
6
6
  VALID_UNIT = %r{(?<unit>#{::Sass::SCSS::RX::NMSTART}#{::Sass::SCSS::RX::NMCHAR}|%*)}
7
7
  VALID_NUMBER = %r{(?<number>#{::Sass::SCSS::RX::NUM})#{VALID_UNIT}}
8
8
 
@@ -39,14 +39,14 @@ class SassyHash < Hash
39
39
  when Symbol
40
40
  return ::Sass::Script::Value::String.new(value.to_s)
41
41
  when String
42
- #number
43
- if matches = value.match(VALID_NUMBER)
44
- return ::Sass::Script::Value::Number.new(matches[:number], matches[:unit])
45
- end
46
42
  # color
47
43
  if value =~ ::Sass::SCSS::RX::HEXCOLOR
48
44
  return ::Sass::Script::Value::Color.from_hex(value)
49
45
  end
46
+ #number
47
+ if matches = value.match(VALID_NUMBER)
48
+ return ::Sass::Script::Value::Number.new(matches[:number], matches[:unit])
49
+ end
50
50
  #string
51
51
  return ::Sass::Script::Value::String.new(value)
52
52
  when Array
@@ -62,6 +62,7 @@ describe SassyHash do
62
62
  1.0 => ::Sass::Script::Value::Number,
63
63
  "1.0px" => ::Sass::Script::Value::Number,
64
64
  '1px' => ::Sass::Script::Value::Number,
65
+ '120px' => ::Sass::Script::Value::Number,
65
66
  :foo => ::Sass::Script::Value::String,
66
67
  true => ::Sass::Script::Value::Bool,
67
68
  false => ::Sass::Script::Value::Bool
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassy_hash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Davis