sassy-maps 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39419e87906f0fe8e5bd5079057d8ce0bcd0fb04
4
- data.tar.gz: 8ff7cd006471acaf864e847baae640b60812061a
3
+ metadata.gz: 8ce9e65eba8234ecc2b838fe86c862f767912825
4
+ data.tar.gz: 022e2d453f1dbaafe0645b3f1bc3b53d617d7bcd
5
5
  SHA512:
6
- metadata.gz: b75f0cd649be75d98299da58bbd5133b100bcc3c86c163f6e87f7ad5b975a178e81251bb61db885a1a0a0918b27fba3e988bab739cdea2471e986a0045b52a5a
7
- data.tar.gz: 546dda7538bbc55dacb2361e8b20a414687351f9e422e19231c35ce35562625c200b9273dd94fe88ca045d94d31b581bde53d70381273e1f437fb39bfe1de6ac
6
+ metadata.gz: b7ab3cbabcfec2ef7504668e8948f9355b302d4ced2b65831200ee68ecec6f7ad8e661709b1ec551d131a3071b9a3e0e849e46e099843c0c6c39175cbaaee413
7
+ data.tar.gz: 0f76c8eaf043c90f1de57d5df18c8f08fda244d2c571d3839693efb15d5d6836ac3a46685413ee675121299acad936da075ec06049f62075ca0239bcff9ca388
@@ -20,8 +20,8 @@ Compass::Frameworks.register('sassy-maps', :stylesheets_directory => stylesheets
20
20
  # a prerelease version
21
21
  # Date is in the form of YYYY-MM-DD
22
22
  module SassyMaps
23
- VERSION = "0.3.1"
24
- DATE = "2013-12-15"
23
+ VERSION = "0.3.2"
24
+ DATE = "2014-03-04"
25
25
  end
26
26
 
27
27
  # This is where any custom SassScript should be placed. The functions will be
@@ -24,8 +24,8 @@ $Memoization-Table: () !default;
24
24
  @function memo-get($module, $key) {
25
25
  $module: "#{$module}";
26
26
  $key: "#{$key}";
27
- $private-sassy-maps-supress-warnings: true !global;
27
+ $private-sassy-maps-suppress-warnings: true !global;
28
28
  $result: map-get-deep($Memoization-Table, $module, $key);
29
- $private-sassy-maps-supress-warnings: false !global;
29
+ $private-sassy-maps-suppress-warnings: false !global;
30
30
  @return $result;
31
- }
31
+ }
@@ -1,5 +1,10 @@
1
- $private-sassy-maps-supress-warnings: false !default;
1
+ $private-sassy-maps-suppress-warnings: false !default;
2
2
 
3
+ //////////////////////////////
4
+ // Map Get Deep
5
+ //
6
+ // Given a map and a list of keys, find the value at the given key
7
+ //////////////////////////////
3
8
  @function map-get-deep($map, $keys...) {
4
9
  @if length($keys) == 1 {
5
10
  $keys: nth($keys, 1);
@@ -8,22 +13,38 @@ $private-sassy-maps-supress-warnings: false !default;
8
13
  $length: length($keys);
9
14
  $get: map-get($map, nth($keys, 1));
10
15
 
11
- @for $i from 2 through $length {
12
- @if $get != null and type-of($get) == 'map' {
13
- $warn: $warn + "->#{nth($keys, $i)}";
14
- $get: map-get($get, nth($keys, $i));
15
- }
16
- @else {
17
- @if not $private-sassy-maps-supress-warnings {
16
+ @if $length > 1 {
17
+ @for $i from 2 through $length {
18
+ @if $get != null and type-of($get) == 'map' {
19
+ $warn: $warn + "->#{nth($keys, $i)}";
20
+ $get: map-get($get, nth($keys, $i));
21
+
18
22
  @if $get == null {
19
- @warn "Map has no value for key search `#{$warn}`";
20
- }
21
- @else if type-of($get) != 'map' {
22
- @warn "Non-map value found for key search `#{$warn}`, cannot search for key `#{nth($keys, $i)}`";
23
+ @return map-get-deep-warning($warn, $get);
23
24
  }
24
25
  }
25
- @return null;
26
+ @else {
27
+ @return map-get-deep-warning($warn, $get);
28
+ }
26
29
  }
27
30
  }
31
+
28
32
  @return $get;
29
- }
33
+ }
34
+
35
+ //////////////////////////////
36
+ // Map Get Deep Warning
37
+ //
38
+ // Displays a warning if the retrieved value is `null`
39
+ //////////////////////////////
40
+ @function map-get-deep-warning($warn, $get) {
41
+ @if not $private-sassy-maps-suppress-warnings {
42
+ @if $get == null {
43
+ @warn "Map has no value for key search `#{$warn}`";
44
+ }
45
+ @else if type-of($get) != 'map' {
46
+ @warn "Non-map value found for key search `#{$warn}`, cannot search for key `#{nth($keys, $i)}`";
47
+ }
48
+ }
49
+ @return null;
50
+ }
@@ -11,7 +11,7 @@
11
11
  }
12
12
 
13
13
  @function map-set-deep($map, $keys, $value) {
14
- $private-sassy-maps-supress-warnings: true !global;
14
+ $private-sassy-maps-suppress-warnings: true !global;
15
15
  $length: length($keys);
16
16
  $get-keys: ();
17
17
  $map-level: ();
@@ -46,6 +46,6 @@
46
46
  }
47
47
  $map: map-merge($map, $merge);
48
48
 
49
- $private-sassy-maps-supress-warnings: false !global;
49
+ $private-sassy-maps-suppress-warnings: false !global;
50
50
  @return $map;
51
- }
51
+ }
@@ -1,6 +1,13 @@
1
1
  # Pull gems from RubyGems
2
2
  source 'https://rubygems.org'
3
- gem 'sass', '~>3.3.0.rc.2'
4
- gem 'compass', '~>1.0.0.alpha.13'
5
3
 
6
- gem 'Sassy Maps', '~>0.3.1'
4
+ gem 'sass', "~> 3.3.0.rc.6"
5
+ gem 'compass', "~> 1.0.0.alpha.18"
6
+
7
+ group :test do
8
+ gem 'rake'
9
+ gem "diffy", "~> 3.0.1"
10
+ gem "colorize", "~> 0.6.0"
11
+ end
12
+
13
+ gem 'Sassy Maps', '~>0.3.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassy-maps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Richard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-15 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -52,7 +52,6 @@ files:
52
52
  - stylesheets/sassy-maps/_map-set.scss
53
53
  - stylesheets/sassy-maps/_map-to-string.scss
54
54
  - templates/project/Gemfile.txt
55
- - templates/project/manifest.rb
56
55
  homepage: https://github.com/Snugug/Sassy-Maps
57
56
  licenses:
58
57
  - MIT
@@ -1,30 +0,0 @@
1
- description "Sassy Maps"
2
-
3
- skip_compilation!
4
-
5
- discover :javascripts
6
- discover :images
7
- discover :fonts
8
-
9
- # file 'Gemfile.txt', :to => 'Gemfile'
10
- file 'editorconfig.txt', :to => '.editorconfig'
11
- file 'jshintrc.txt', :to => '.jshintrc'
12
- file 'csslintrc.txt', :to => '.csslintrc'
13
-
14
- help %Q{
15
- Please contact Sam Richard with questions:
16
-
17
- sam@snug.ug
18
- }
19
-
20
- welcome_message %Q{
21
-
22
- Sassy Maps
23
-
24
- The awesome template for Sassy Maps.
25
-
26
- To use the Sassy Maps, include the following at the top of your Sass file:
27
-
28
- @import "sassy-maps";
29
-
30
- }