SassyLists 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +36 -35
  3. data/lib/SassyLists.rb +13 -15
  4. data/stylesheets/SassyLists/_chunk.scss +41 -41
  5. data/stylesheets/SassyLists/_contain.scss +17 -18
  6. data/stylesheets/SassyLists/_count-values.scss +18 -18
  7. data/stylesheets/SassyLists/_debug.scss +96 -94
  8. data/stylesheets/SassyLists/_explode.scss +49 -48
  9. data/stylesheets/SassyLists/_first.scss +23 -24
  10. data/stylesheets/SassyLists/_flatten.scss +35 -36
  11. data/stylesheets/SassyLists/_insert-nth.scss +46 -45
  12. data/stylesheets/SassyLists/_intersection.scss +28 -26
  13. data/stylesheets/SassyLists/_is-symmetrical.scss +18 -19
  14. data/stylesheets/SassyLists/_last-index.scss +20 -21
  15. data/stylesheets/SassyLists/_last.scss +17 -24
  16. data/stylesheets/SassyLists/_loop.scss +35 -36
  17. data/stylesheets/SassyLists/_prepend.scss +20 -20
  18. data/stylesheets/SassyLists/_purge.scss +27 -28
  19. data/stylesheets/SassyLists/_random-value.scss +29 -31
  20. data/stylesheets/SassyLists/_remove-duplicates.scss +24 -26
  21. data/stylesheets/SassyLists/_remove-nth.scss +19 -20
  22. data/stylesheets/SassyLists/_remove.scss +20 -21
  23. data/stylesheets/SassyLists/_replace-nth.scss +24 -25
  24. data/stylesheets/SassyLists/_replace.scss +29 -27
  25. data/stylesheets/SassyLists/_reverse.scss +29 -30
  26. data/stylesheets/SassyLists/_shuffle.scss +29 -31
  27. data/stylesheets/SassyLists/_slice.scss +48 -48
  28. data/stylesheets/SassyLists/_sort.scss +40 -41
  29. data/stylesheets/SassyLists/_sum.scss +28 -28
  30. data/stylesheets/SassyLists/_tail.scss +19 -0
  31. data/stylesheets/SassyLists/_to-string.scss +25 -26
  32. data/stylesheets/SassyLists/_union.scss +21 -24
  33. data/stylesheets/SassyLists/_walk.scss +24 -0
  34. data/stylesheets/SassyLists/helpers/_str-compare.scss +24 -26
  35. data/stylesheets/SassyLists/helpers/_true.scss +10 -14
  36. data/stylesheets/_SassyLists.scss +38 -38
  37. metadata +16 -20
@@ -1,24 +1,21 @@
1
- // Returns a list of values from $lists minus duplicates
2
- // -------------------------------------------------------------------------------
3
- // @documentation http://sassylists.com/documentation/#union
4
- // -------------------------------------------------------------------------------
5
- // @alias `merge()`
6
- // -------------------------------------------------------------------------------
7
- // @dependence `flatten()`
8
- // @dependence `remove-duplicates()`
9
- // -------------------------------------------------------------------------------
10
- // @example union((a b), (b c), (a b c d)) => a b c d
11
- // -------------------------------------------------------------------------------
12
- // @param $lists [ArgList] : lists
13
- // -------------------------------------------------------------------------------
14
- // @return [List]
15
-
16
- @function union($lists...) {
17
- $result: remove-duplicates(flatten($lists));
18
- @return if(length($result) == 1, nth($result, 1), $result);
19
- }
20
-
21
- // Alias
22
- @function merge($lists...) {
23
- @return union($lists...);
24
- }
1
+ // Returns a list of values from $lists minus duplicates
2
+ //
3
+ // @ignore Documentation: http://sassylists.com/documentation/#union
4
+ //
5
+ // @requires flatten
6
+ // @requires remove-duplicates
7
+ //
8
+ // @param {ArgList} $lists - lists to unify
9
+ //
10
+ // @return {List}
11
+
12
+ @function union($lists...) {
13
+ $result: remove-duplicates(flatten($lists));
14
+ @return if(length($result) == 1, nth($result, 1), $result);
15
+ }
16
+
17
+ // @alias union
18
+
19
+ @function merge($lists...) {
20
+ @return union($lists...);
21
+ }
@@ -0,0 +1,24 @@
1
+ // Apply $function to every item from $list passing $args as parameters
2
+ //
3
+ // @ignore Documentation: http://sassylists.com/documentation/#walk
4
+ //
5
+ // @param {List} $list - list to update
6
+ // @param {String} $function - function to call on each value
7
+ // @param {ArgList} $args - optional function arguments
8
+ //
9
+ // @throws There is no $function function.
10
+ //
11
+ // @return {List | Bool}
12
+
13
+ @function walk($list, $function, $args...) {
14
+ @if not function-exists($function) {
15
+ @warn "There is no `#{$function}` function.";
16
+ @return false;
17
+ }
18
+
19
+ @for $i from 1 through length($list) {
20
+ $list: set-nth($list, $i, call($function, nth($list, $i), $args...));
21
+ }
22
+
23
+ @return $list;
24
+ }
@@ -1,27 +1,25 @@
1
- // Compares two values based on alphabetical order
2
- // -------------------------------------------------------------------------------
3
- // @private
4
- // -------------------------------------------------------------------------------
5
- // @usage sort()
6
- // -------------------------------------------------------------------------------
7
- // @param $a [Literal] : first value
8
- // @param $b [Literal] : second value
9
- // @param $matrix [List] : alphabetical order
10
- // -------------------------------------------------------------------------------
11
- // @return [Boolean]
12
-
13
- @function str-compare($a, $b, $order) {
14
- @if type-of($a) == "number" and type-of($b) == "number" {
15
- @return $a < $b;
16
- }
17
- $a: to-lower-case($a + unquote(""));
18
- $b: to-lower-case($b + unquote(""));
19
- @for $i from 1 through min(str-length($a), str-length($b)) {
20
- $char-a: str-slice($a, $i, $i);
21
- $char-b: str-slice($b, $i, $i);
22
- @if $char-a and $char-b and index($order, $char-a) != index($order, $char-b) {
23
- @return index($order, $char-a) < index($order, $char-b);
24
- }
25
- }
26
- @return str-length($a) < str-length($b);
1
+ // Compares two values based on alphabetical order
2
+ //
3
+ // @access private
4
+ //
5
+ // @param {*} $a - first value
6
+ // @param {*} $b - second value
7
+ // @param {List} $matrix - alphabetical order
8
+ //
9
+ // @return {Bool}
10
+
11
+ @function str-compare($a, $b, $order) {
12
+ @if type-of($a) == "number" and type-of($b) == "number" {
13
+ @return $a < $b;
14
+ }
15
+ $a: to-lower-case($a + unquote(""));
16
+ $b: to-lower-case($b + unquote(""));
17
+ @for $i from 1 through min(str-length($a), str-length($b)) {
18
+ $char-a: str-slice($a, $i, $i);
19
+ $char-b: str-slice($b, $i, $i);
20
+ @if $char-a and $char-b and index($order, $char-a) != index($order, $char-b) {
21
+ @return index($order, $char-a) < index($order, $char-b);
22
+ }
23
+ }
24
+ @return str-length($a) < str-length($b);
27
25
  }
@@ -1,15 +1,11 @@
1
- // Returns truthiness of a value
2
- // -------------------------------------------------------------------------------
3
- // @private
4
- // -------------------------------------------------------------------------------
5
- // @usage `insert-nth()`
6
- // @usage `prepend()`
7
- // @usage `purge()`
8
- // -------------------------------------------------------------------------------
9
- // @param $value [Literal] : value
10
- // -------------------------------------------------------------------------------
11
- // @return [Boolean]
12
-
13
- @function is-true($value) {
14
- @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
1
+ // Returns truthiness of a value
2
+ //
3
+ // @access private
4
+ //
5
+ // @param {*} $value - value to check
6
+ //
7
+ // @return {Bool}
8
+
9
+ @function is-true($value) {
10
+ @return if($value == null, false, $value and $value != null and $value != "" and $value != ());
15
11
  }
@@ -1,38 +1,38 @@
1
- // -------------------------------------------------------------------------------
2
- // SassyLists - A couple of advanced Sass list functions
3
- // -------------------------------------------------------------------------------
4
- // Official site: http://sassylists.com/
5
- // CodePen: http://codepen.io/HugoGiraudel/pen/loAgq
6
- // Repository: https://github.com/Team-Sass/SassyLists/
7
- // -------------------------------------------------------------------------------
8
-
9
- @import "SassyLists/helpers/true";
10
- @import "SassyLists/helpers/str-compare";
11
- @import "SassyLists/chunk";
12
- @import "SassyLists/contain";
13
- @import "SassyLists/count-values";
14
- @import "SassyLists/debug";
15
- @import "SassyLists/explode";
16
- @import "SassyLists/first";
17
- @import "SassyLists/flatten";
18
- @import "SassyLists/insert-nth";
19
- @import "SassyLists/intersection";
20
- @import "SassyLists/is-symmetrical";
21
- @import "SassyLists/last";
22
- @import "SassyLists/last-index";
23
- @import "SassyLists/loop";
24
- @import "SassyLists/prepend";
25
- @import "SassyLists/purge";
26
- @import "SassyLists/random-value";
27
- @import "SassyLists/remove";
28
- @import "SassyLists/remove-duplicates";
29
- @import "SassyLists/remove-nth";
30
- @import "SassyLists/replace";
31
- @import "SassyLists/replace-nth";
32
- @import "SassyLists/reverse";
33
- @import "SassyLists/shuffle";
34
- @import "SassyLists/slice";
35
- @import "SassyLists/sort";
36
- @import "SassyLists/sum";
37
- @import "SassyLists/to-string";
38
- @import "SassyLists/union";
1
+ // SassyLists - A couple of advanced Sass list functions
2
+ //
3
+ // Official site: http://sassylists.com/
4
+ // CodePen: http://codepen.io/HugoGiraudel/pen/loAgq
5
+ // Repository: https://github.com/Team-Sass/SassyLists/
6
+
7
+ @import "SassyLists/helpers/true";
8
+ @import "SassyLists/helpers/str-compare";
9
+ @import "SassyLists/chunk";
10
+ @import "SassyLists/contain";
11
+ @import "SassyLists/count-values";
12
+ @import "SassyLists/debug";
13
+ @import "SassyLists/explode";
14
+ @import "SassyLists/first";
15
+ @import "SassyLists/flatten";
16
+ @import "SassyLists/insert-nth";
17
+ @import "SassyLists/intersection";
18
+ @import "SassyLists/is-symmetrical";
19
+ @import "SassyLists/last";
20
+ @import "SassyLists/last-index";
21
+ @import "SassyLists/loop";
22
+ @import "SassyLists/prepend";
23
+ @import "SassyLists/purge";
24
+ @import "SassyLists/random-value";
25
+ @import "SassyLists/remove";
26
+ @import "SassyLists/remove-duplicates";
27
+ @import "SassyLists/remove-nth";
28
+ @import "SassyLists/replace";
29
+ @import "SassyLists/replace-nth";
30
+ @import "SassyLists/reverse";
31
+ @import "SassyLists/shuffle";
32
+ @import "SassyLists/slice";
33
+ @import "SassyLists/sort";
34
+ @import "SassyLists/sum";
35
+ @import "SassyLists/tail";
36
+ @import "SassyLists/to-string";
37
+ @import "SassyLists/union";
38
+ @import "SassyLists/walk";
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SassyLists
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Hugo Giraudel
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-03-09 00:00:00.000000000 Z
11
+ date: 2014-06-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sass
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: compass
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 0.12.1
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: 0.12.1
46
41
  description: Advanced Sass list functions
@@ -52,8 +47,7 @@ extra_rdoc_files: []
52
47
  files:
53
48
  - CHANGELOG.md
54
49
  - lib/SassyLists.rb
55
- - stylesheets/SassyLists/helpers/_str-compare.scss
56
- - stylesheets/SassyLists/helpers/_true.scss
50
+ - stylesheets/_SassyLists.scss
57
51
  - stylesheets/SassyLists/_chunk.scss
58
52
  - stylesheets/SassyLists/_contain.scss
59
53
  - stylesheets/SassyLists/_count-values.scss
@@ -80,31 +74,33 @@ files:
80
74
  - stylesheets/SassyLists/_slice.scss
81
75
  - stylesheets/SassyLists/_sort.scss
82
76
  - stylesheets/SassyLists/_sum.scss
77
+ - stylesheets/SassyLists/_tail.scss
83
78
  - stylesheets/SassyLists/_to-string.scss
84
79
  - stylesheets/SassyLists/_union.scss
85
- - stylesheets/_SassyLists.scss
80
+ - stylesheets/SassyLists/_walk.scss
81
+ - stylesheets/SassyLists/helpers/_str-compare.scss
82
+ - stylesheets/SassyLists/helpers/_true.scss
86
83
  homepage: http://sassylists.com/
87
84
  licenses: []
85
+ metadata: {}
88
86
  post_install_message:
89
87
  rdoc_options: []
90
88
  require_paths:
91
89
  - lib
92
90
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
91
  requirements:
95
- - - ! '>='
92
+ - - '>='
96
93
  - !ruby/object:Gem::Version
97
94
  version: '0'
98
95
  required_rubygems_version: !ruby/object:Gem::Requirement
99
- none: false
100
96
  requirements:
101
- - - ! '>='
97
+ - - '>='
102
98
  - !ruby/object:Gem::Version
103
99
  version: 1.3.6
104
100
  requirements: []
105
101
  rubyforge_project: SassyLists
106
- rubygems_version: 1.8.24
102
+ rubygems_version: 2.0.14
107
103
  signing_key:
108
- specification_version: 3
104
+ specification_version: 4
109
105
  summary: A collection of powerful Sass (SCSS) functions to deal with your lists.
110
106
  test_files: []