SassyLists 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1 -0
  3. data/README.md +1 -1
  4. data/lib/SassyLists.rb +2 -2
  5. data/stylesheets/SassyLists/_chunk.scss +15 -13
  6. data/stylesheets/SassyLists/_comma-list.scss +7 -5
  7. data/stylesheets/SassyLists/_contain.scss +15 -11
  8. data/stylesheets/SassyLists/_count-values.scss +10 -8
  9. data/stylesheets/SassyLists/_debug.scss +22 -18
  10. data/stylesheets/SassyLists/_every.scss +12 -8
  11. data/stylesheets/SassyLists/_explode.scss +15 -13
  12. data/stylesheets/SassyLists/_first.scss +17 -14
  13. data/stylesheets/SassyLists/_flatten.scss +16 -12
  14. data/stylesheets/SassyLists/_has-multiple-values.scss +10 -8
  15. data/stylesheets/SassyLists/_has-values.scss +9 -8
  16. data/stylesheets/SassyLists/_insert-nth.scss +16 -15
  17. data/stylesheets/SassyLists/_intersection.scss +14 -12
  18. data/stylesheets/SassyLists/_is-empty.scss +14 -10
  19. data/stylesheets/SassyLists/_is-single.scss +10 -8
  20. data/stylesheets/SassyLists/_is-symmetrical.scss +16 -12
  21. data/stylesheets/SassyLists/_last-index.scss +11 -9
  22. data/stylesheets/SassyLists/_last.scss +14 -12
  23. data/stylesheets/SassyLists/_loop.scss +21 -17
  24. data/stylesheets/SassyLists/_prepend.scss +14 -12
  25. data/stylesheets/SassyLists/_purge.scss +16 -13
  26. data/stylesheets/SassyLists/_random-value.scss +22 -16
  27. data/stylesheets/SassyLists/_range.scss +14 -12
  28. data/stylesheets/SassyLists/_remove-duplicates.scss +16 -12
  29. data/stylesheets/SassyLists/_remove-nth.scss +17 -13
  30. data/stylesheets/SassyLists/_remove.scss +18 -14
  31. data/stylesheets/SassyLists/_replace-nth.scss +18 -16
  32. data/stylesheets/SassyLists/_replace.scss +16 -14
  33. data/stylesheets/SassyLists/_reverse.scss +16 -12
  34. data/stylesheets/SassyLists/_shuffle.scss +16 -12
  35. data/stylesheets/SassyLists/_slice.scss +18 -16
  36. data/stylesheets/SassyLists/_some.scss +11 -7
  37. data/stylesheets/SassyLists/_sort.scss +19 -15
  38. data/stylesheets/SassyLists/_sum.scss +16 -14
  39. data/stylesheets/SassyLists/_tail.scss +16 -12
  40. data/stylesheets/SassyLists/_to-list.scss +15 -15
  41. data/stylesheets/SassyLists/_to-map.scss +31 -24
  42. data/stylesheets/SassyLists/_to-string.scss +18 -14
  43. data/stylesheets/SassyLists/_union.scss +17 -12
  44. data/stylesheets/SassyLists/_walk.scss +17 -15
  45. data/stylesheets/SassyLists/helpers/_is-number.scss +10 -8
  46. data/stylesheets/SassyLists/helpers/_missing-dependencies.scss +10 -8
  47. data/stylesheets/SassyLists/helpers/_str-compare.scss +12 -10
  48. data/stylesheets/SassyLists/helpers/_true.scss +10 -8
  49. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 517028d6e6e009c274b66b1025e78467ddd59045
4
- data.tar.gz: cca96bd52567ec62d864f1f78093c7f217fff3a6
3
+ metadata.gz: 01a55bc0fdfbe317688501799cf6f9eb9d139a48
4
+ data.tar.gz: 9aa64f413e0aadc25d80d190edf36bdf15706549
5
5
  SHA512:
6
- metadata.gz: e0d5ba9d1579e6c7751c41753ef8b22dc4a6124f4e2d8366cc1e073daa44125e0ed258514c75bef632d80a0598bcfbcaad33ebfb83e000de9f86ebded255c08c
7
- data.tar.gz: ca85f49704ffbe05778e41570060078915c9cf75c353f04d5866c7255e5d134d765476d5afb6a67f8246876b0f77da896bc4d825bc37d0c0f0d82953f8bad4ef
6
+ metadata.gz: 17560fb770b3445e0b8539aeea201017f65d12a84bc72c7918e526a9b22f1f7f6946bd35d143c1ed21386fcc486ac4fa82dbc3e53b61fba864061207861d528b
7
+ data.tar.gz: 9fa42d1731305ef8548d8fc83989923d9b6a1fd9d4b09645fc7c10332b2e28a98756dce1ab0b1e894ed5712a1b24adf9b426338200bd0236715d6e019974c094
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Changelog
2
2
 
3
+ * `2.2.2`: fixing a bug with aliases for `sl-to-list()` and moved all comments to C-like
3
4
  * `2.2.1`: improving `sl-to-list()`'s performance
4
5
  * `2.2.0`:
5
6
  * adding `sl-range()`, `sl-is-single()`, `sl-has-values()`, `sl-has-multiple-values()`
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # SassyLists [![Gem Version](https://badge.fury.io/rb/SassyLists.png)](http://badge.fury.io/rb/SassyLists)
1
+ # SassyLists [![Gem Version](https://badge.fury.io/rb/SassyLists.svg)](http://badge.fury.io/rb/SassyLists)
2
2
 
3
3
  Here is a powerful toolbox providing you all the functions you need to manipulate your [Sass](http://sass-lang.com/) lists. See complete documentation [here](http://sassylists.com/).
4
4
 
data/lib/SassyLists.rb CHANGED
@@ -15,7 +15,7 @@ end
15
15
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
16
16
  # Date is in the form of YYYY-MM-DD
17
17
  module SassyLists
18
- VERSION = "2.2.1"
19
- DATE = "2014-07-03"
18
+ VERSION = "2.2.2"
19
+ DATE = "2014-07-05"
20
20
  end
21
21
 
@@ -1,16 +1,18 @@
1
- // Chunks `$list` into `$size` large lists.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-chunk
4
- //
5
- // @param {List} $list - list to chunk
6
- // @param {Number} $size - length of lists
7
- //
8
- // @throws $size is not a number for `sl-chunk`.
9
- //
10
- // @requires sl-to-list
11
- //
12
- // @return {List | Null}
13
-
1
+ /**
2
+ * Chunks `$list` into `$size` large lists.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-chunk
5
+ *
6
+ * @param {List} $list - list to chunk
7
+ * @param {Number} $size - length of lists
8
+ *
9
+ * @throws $size is not a number for `sl-chunk`.
10
+ *
11
+ * @requires sl-to-list
12
+ *
13
+ * @return {List | Null}
14
+ */
15
+
14
16
  @function sl-chunk($list, $size) {
15
17
  @if sl-missing-dependencies(sl-to-list) == true { @return null; }
16
18
 
@@ -1,8 +1,10 @@
1
- // Initialize an empty comma-separated list.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-comma-list
4
- //
5
- // @return {List}
1
+ /**
2
+ * Initialize an empty comma-separated list.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-comma-list
5
+ *
6
+ * @return {List}
7
+ */
6
8
 
7
9
  @function sl-comma-list() {
8
10
  @return zip((), ());
@@ -1,19 +1,23 @@
1
- // Returns whether `$list` contains `$value`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-contain
4
- //
5
- // @param {List} $list - list to check
6
- // @param {*} $value - value to look for
7
- //
8
- // @return {Bool}
1
+ /**
2
+ * Returns whether `$list` contains `$value`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-contain
5
+ *
6
+ * @param {List} $list - list to check
7
+ * @param {*} $value - value to look for
8
+ *
9
+ * @return {Bool}
10
+ */
9
11
 
10
12
  @function sl-contain($list, $value) {
11
13
  @return not not index($list, $value);
12
14
  }
13
15
 
14
- // @requires sl-contain
15
- // @alias sl-contain
16
-
16
+ /**
17
+ * @requires sl-contain
18
+ * @alias sl-contain
19
+ */
20
+
17
21
  @function sl-include($list, $value) {
18
22
  @return sl-contain($list, $value);
19
23
  }
@@ -1,11 +1,13 @@
1
- // Counts the number of occurrences of each value of `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-count-values
4
- //
5
- // @param {List} $list - list to count values from
6
- //
7
- // @return {Map} Values mapped to their count
8
-
1
+ /**
2
+ * Counts the number of occurrences of each value of `$list`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-count-values
5
+ *
6
+ * @param {List} $list - list to count values from
7
+ *
8
+ * @return {Map} Values mapped to their count
9
+ */
10
+
9
11
  @function sl-count-values($list) {
10
12
  $map: ();
11
13
 
@@ -1,16 +1,18 @@
1
- // Returns `$list` as a string, prettified if `$pre` is set to true.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-debug
4
- //
5
- // @param {List} $list - list to debug
6
- // @param {Bool} $pre (false) - enable/disable variables type and proper indentation
7
- // @param {Number} $level (1) - internal variable for recursion
8
- //
9
- // @requires sl-is-empty
10
- // @requires sl-is-single
11
- // @requires sl-has-multiple-values
12
- //
13
- // @return {String}
1
+ /**
2
+ * Returns `$list` as a string, prettified if `$pre` is set to true.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-debug
5
+ *
6
+ * @param {List} $list - list to debug
7
+ * @param {Bool} $pre (false) - enable/disable variables type and proper indentation
8
+ * @param {Number} $level (1) - internal variable for recursion
9
+ *
10
+ * @requires sl-is-empty
11
+ * @requires sl-is-single
12
+ * @requires sl-has-multiple-values
13
+ *
14
+ * @return {String}
15
+ */
14
16
 
15
17
  @function sl-debug($list, $pre: false, $level: 1) {
16
18
  @if sl-missing-dependencies(sl-is-empty, sl-is-single, sl-has-multiple-values) == true { @return null; }
@@ -76,11 +78,13 @@
76
78
  @return quote($result);
77
79
  }
78
80
 
79
- // Mixin displaying clean debug
80
- //
81
- // @param {List} $list - list
82
- //
83
- // @requires {function} sl-debug
81
+ /**
82
+ * Mixin displaying clean debug
83
+ *
84
+ * @param {List} $list - list
85
+ *
86
+ * @requires sl-debug
87
+ */
84
88
 
85
89
  @mixin sl-debug($list) {
86
90
  body:before {
@@ -1,11 +1,15 @@
1
- // Tests whether all items from `$list` pass the test implemented by `$function`.
2
- //
3
- // @param {List} $list - list to run test against
4
- // @param {String} $function - function to run against every item from list
5
- // @param {ArgList} $args - extra arguments to pass to the function
6
- //
7
- // @return {Bool}
8
-
1
+ /**
2
+ * Tests whether all items from `$list` pass the test implemented by `$function`.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-every
5
+ *
6
+ * @param {List} $list - list to run test against
7
+ * @param {String} $function - function to run against every item from list
8
+ * @param {ArgList} $args - extra arguments to pass to the function
9
+ *
10
+ * @return {Bool}
11
+ */
12
+
9
13
  @function sl-every($list, $function, $args...) {
10
14
  @each $item in $list {
11
15
  @if not call($function, $item, $args...) {
@@ -1,16 +1,18 @@
1
- // Explodes `$string` into a list using `$delimiter` as a delimiter.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-explode
4
- //
5
- // @param {String} $string - string to explode
6
- // @param {String} $delimiter ('') - string to use as a delimiter
7
- // @param {String} $separator ('space') - list separator
8
- //
9
- // @throws $string is not a string for `sl-explode`.
10
- // @throws $delimiter is not a string for `sl-explode`.
11
- //
12
- // @return {List | Null}
13
-
1
+ /**
2
+ * Explodes `$string` into a list using `$delimiter` as a delimiter.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-explode
5
+ *
6
+ * @param {String} $string - string to explode
7
+ * @param {String} $delimiter ('') - string to use as a delimiter
8
+ * @param {String} $separator ('space') - list separator
9
+ *
10
+ * @throws $string is not a string for `sl-explode`.
11
+ * @throws $delimiter is not a string for `sl-explode`.
12
+ *
13
+ * @return {List | Null}
14
+ */
15
+
14
16
  @function sl-explode($string, $delimiter: '', $separator: "space") {
15
17
  @if type-of($string) != "string" {
16
18
  @warn "`sl-explode` function expecting a string; #{type-of($string)} given.";
@@ -1,14 +1,15 @@
1
- // Returns first element of `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-first
4
- //
5
- // @param {List} $list - list to retrieve first item from
6
- //
7
- // @throws Cannot find first item of empty list.
8
- //
9
- // @requires sl-is-empty
10
- //
11
- // @return {*}
1
+ /** Returns first element of `$list`.
2
+ *
3
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-first
4
+ *
5
+ * @param {List} $list - list to retrieve first item from
6
+ *
7
+ * @throws Cannot find first item of empty list.
8
+ *
9
+ * @requires sl-is-empty
10
+ *
11
+ * @return {*}
12
+ */
12
13
 
13
14
  @function sl-first($list) {
14
15
  @if sl-missing-dependencies(sl-is-empty) == true { @return null; }
@@ -21,9 +22,11 @@
21
22
  @return nth($list, 1);
22
23
  }
23
24
 
24
- // @requires sl-first
25
- // @alias sl-first
26
-
25
+ /**
26
+ * @requires sl-first
27
+ * @alias sl-first
28
+ */
29
+
27
30
  @function sl-head($list) {
28
31
  @return sl-first($list);
29
32
  }
@@ -1,12 +1,14 @@
1
- // Turns multidimensional `$list` into a one-level list.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#flatten
4
- //
5
- // @param {List} $list - list to flatten
6
- //
7
- // @requires sl-has-multiple-values
8
- //
9
- // @return {List}
1
+ /**
2
+ * Turns multidimensional `$list` into a one-level list.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#flatten
5
+ *
6
+ * @param {List} $list - list to flatten
7
+ *
8
+ * @requires sl-has-multiple-values
9
+ *
10
+ * @return {List}
11
+ */
10
12
 
11
13
  @function sl-flatten($list) {
12
14
  @if sl-missing-dependencies(sl-has-multiple-values) == true { @return null; }
@@ -30,9 +32,11 @@
30
32
  @return $result;
31
33
  }
32
34
 
33
- // @requires sl-flatten
34
- // @alias sl-flatten
35
+ /**
36
+ * @requires sl-flatten
37
+ * @alias sl-flatten
38
+ */
35
39
 
36
40
  @function sl-unfold($list) {
37
- @return sl-flatten($list);
41
+ @return sl-flatten($list);
38
42
  }
@@ -1,11 +1,13 @@
1
- // Tests whether `$list` has at least 2 values.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-has-multiple-values
4
- //
5
- // @param {List} $list - list to run test against
6
- //
7
- // @return {Bool}
8
-
1
+ /**
2
+ * Tests whether `$list` has at least 2 values.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-has-multiple-values
5
+ *
6
+ * @param {List} $list - list to run test against
7
+ *
8
+ * @return {Bool}
9
+ */
10
+
9
11
  @function sl-has-multiple-values($list) {
10
12
  @return length($list) > 1;
11
13
  }
@@ -1,11 +1,12 @@
1
- // Tests whether `$list` is not empty.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-has-values
4
- //
5
- // @param {List} $list - list to run test against
6
- //
7
- // @return {Bool}
8
-
1
+ /** Tests whether `$list` is not empty.
2
+ *
3
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-has-values
4
+ *
5
+ * @param {List} $list - list to run test against
6
+ *
7
+ * @return {Bool}
8
+ */
9
+
9
10
  @function sl-has-values($list) {
10
11
  @return length($list) > 0;
11
12
  }
@@ -1,18 +1,19 @@
1
- // Adds `$value` at `$index` in `$list`.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-insert-nth
4
- //
5
- // @requires sl-is-true
6
- //
7
- // @param {List} $list - list to update
8
- // @param {Number} $index - index to add
9
- // @param {*} $value - value to add
10
- //
11
- // @throws List index $index is not a number for `sl-insert-nth`.
12
- // @throws List index $index must be a non-zero integer for `sl-insert-nth`.
13
- //
14
- // @return {List | Null}
15
-
1
+ /** Adds `$value` at `$index` in `$list`.
2
+ *
3
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-insert-nth
4
+ *
5
+ * @requires sl-is-true
6
+ *
7
+ * @param {List} $list - list to update
8
+ * @param {Number} $index - index to add
9
+ * @param {*} $value - value to add
10
+ *
11
+ * @throws List index $index is not a number for `sl-insert-nth`.
12
+ * @throws List index $index must be a non-zero integer for `sl-insert-nth`.
13
+ *
14
+ * @return {List | Null}
15
+ */
16
+
16
17
  @function sl-insert-nth($list, $index, $value) {
17
18
  @if sl-missing-dependencies(sl-is-true) == true { @return null; }
18
19
 
@@ -1,15 +1,17 @@
1
- // Returns a list of shared value from `$list` and `$lists` minus duplicates.
2
- //
3
- // @ignore Documentation: http://sassylists.com/documentation.html#sl-intersection
4
- //
5
- // @requires sl-remove-duplicates
6
- // @requires sl-to-list
7
- //
8
- // @param {List} $list - first list
9
- // @param {ArgList} $lists - other lists
10
- //
11
- // @return {List}
12
-
1
+ /**
2
+ * Returns a list of shared value from `$list` and `$lists` minus duplicates.
3
+ *
4
+ * @ignore Documentation: http://sassylists.com/documentation.html#sl-intersection
5
+ *
6
+ * @requires sl-remove-duplicates
7
+ * @requires sl-to-list
8
+ *
9
+ * @param {List} $list - first list
10
+ * @param {ArgList} $lists - other lists
11
+ *
12
+ * @return {List}
13
+ */
14
+
13
15
  @function sl-intersection($list, $lists...) {
14
16
  @if sl-missing-dependencies(sl-remove-duplicates) == true { @return null; }
15
17