SassyLists 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Changelog
2
2
 
3
+ * `0.3.2`: removed dependence to `purge()` from `replace()`
3
4
  * `0.3.1`: added aliases and cleaned `to-string()`
4
5
  * `0.3.0`: adding `contains()`, `flatten()`, `union()`
5
6
  * `0.2.4`: improving `debug()`
data/lib/SassyLists.rb CHANGED
@@ -5,7 +5,7 @@ Compass::Frameworks.register('SassyLists', :path => extension_path)
5
5
  # Version is a number. If a version contains alphas, it will be created as a prerelease version
6
6
  # Date is in the form of YYYY-MM-DD
7
7
  module SassyLists
8
- VERSION = "0.3.1"
8
+ VERSION = "0.3.2"
9
9
  DATE = "2013-11-05"
10
10
  end
11
11
 
@@ -18,7 +18,7 @@
18
18
  // @return [List]
19
19
 
20
20
  @function remove($list, $value, $recursive: false) {
21
- @return replace($list, $value, "", $recursive);
21
+ @return replace($list, $value, null, $recursive);
22
22
  }
23
23
 
24
24
  // Alias
@@ -2,8 +2,6 @@
2
2
  // -------------------------------------------------------------------------------
3
3
  // @documentation http://sassylists.com/documentation.html#replace
4
4
  // -------------------------------------------------------------------------------
5
- // @dependence `purge()`
6
- // -------------------------------------------------------------------------------
7
5
  // @example replace( (a, b, c), b, z ) => a, z, c
8
6
  // @example replace( (a, b, c), y, z ) => a, b, c
9
7
  // @example replace( (a, b, c a), a, z ) => z, b, c z
@@ -20,14 +18,20 @@
20
18
  $result: ();
21
19
 
22
20
  @each $item in $list {
23
- @if length($item) > 1 and $recursive {
21
+ @if $item == $old-value {
22
+ @if $new-value != '' and $new-value != null {
23
+ $result: append($result, $new-value);
24
+ }
25
+ }
26
+
27
+ @else if length($item) > 1 and $recursive {
24
28
  $result: append($result, replace($item, $old-value, $new-value, $recursive));
25
29
  }
26
30
 
27
31
  @else {
28
- $result: append($result, if($item == $old-value, $new-value, $item));
32
+ $result: append($result, $item);
29
33
  }
30
34
  }
31
35
 
32
- @return purge($result);
36
+ @return $result;
33
37
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SassyLists
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: