sassc 1.11.0 → 1.11.1

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: 7bbf189c8dd82c9e7a55454104b1ccdd03590bf0
4
- data.tar.gz: 2cee2d1a55a747b4e873079e184964c84bee4fdd
3
+ metadata.gz: 2003bd0fdc35ac8281c0f203771b9e88e3554ce6
4
+ data.tar.gz: 4181ece117d80e29ff8abf55805fc8e7710e3c3f
5
5
  SHA512:
6
- metadata.gz: a8128f57ef6fcafe9faacc7998411590c028b4946f60faddea2c9154885206707784cf20dcfabc254bb25bc47c10334e338019625ed4050f42136b32e495115e
7
- data.tar.gz: 4870de37197958d7bdbfa4b95d3f7574da5754ff93148c4f1d0a7a9c42b8070b85d28f4faa4158537b2dd2464bb7c62a11285c99a9ab118e64502e622ddabdd3
6
+ metadata.gz: 44ff8a7c1c903405f2124f670b5277fee9f47bd4f61c5c429524b1812a8c3497fd1f4c0ca6812bc886b4414bdeb70846f3a69aef2d0cfd124c5cc30c2e332773
7
+ data.tar.gz: cc5690cb269eaa0408ae7c5b6f72aa71b11530357a72b930f3bfcae95ef56df708b97ba1a0c7af6e806802479023e4a306e22ae3758fac656bec84dbb270b494
data/README.md CHANGED
@@ -6,7 +6,7 @@ This gem combines the speed of `libsass`, the [Sass C implementation](https://gi
6
6
 
7
7
  ### libsass Version
8
8
 
9
- [3.4.0](https://github.com/sass/libsass/releases/tag/3.4.0)
9
+ [3.4.1](https://github.com/sass/libsass/releases/tag/3.4.1)
10
10
 
11
11
  ## Installation
12
12
 
@@ -49,6 +49,8 @@ and [awesome contributors](https://github.com/bolandrm/sassc-ruby/graphs/contrib
49
49
 
50
50
  ## Changelog
51
51
 
52
+ - **1.11.1**
53
+ - [Update to libsass 3.4.1](https://github.com/sass/sassc-ruby/pull/61)
52
54
  - **1.11.0**
53
55
  - [Add support for lists in functions](https://github.com/sass/sassc-ruby/pull/55)
54
56
  - [Update to libsass 3.4.0](https://github.com/sass/sassc-ruby/pull/57)
@@ -611,18 +611,29 @@ namespace Sass {
611
611
  {
612
612
  if (CommaSequence_Selector* extender = dynamic_cast<CommaSequence_Selector*>(selector())) {
613
613
  Selector* s = e->selector();
614
- if (Selector_Schema* schema = dynamic_cast<Selector_Schema*>(s)) {
615
- if (schema->has_parent_ref()) s = eval(schema);
614
+ CommaSequence_Selector* sl = NULL;
615
+ // check if we already have a valid selector list
616
+ if ((sl = dynamic_cast<CommaSequence_Selector*>(s))) {}
617
+ // convert selector schema to a selector list
618
+ else if (Selector_Schema* schema = dynamic_cast<Selector_Schema*>(s)) {
619
+ if (schema->has_real_parent_ref()) {
620
+ sl = eval(schema);
621
+ } else {
622
+ selector_stack.push_back(0);
623
+ sl = eval(schema);
624
+ sl->remove_parent_selectors();
625
+ selector_stack.pop_back();
626
+ }
616
627
  }
617
- if (CommaSequence_Selector* sl = dynamic_cast<CommaSequence_Selector*>(s)) {
618
- for (Sequence_Selector* cs : *sl) {
619
- if (cs != NULL && cs->head() != NULL) {
620
- cs->head()->media_block(media_block_stack.back());
621
- }
628
+ // abort on invalid selector
629
+ if (sl == NULL) return NULL;
630
+ for (Sequence_Selector* cs : *sl) {
631
+ if (cs != NULL && cs->head() != NULL) {
632
+ cs->head()->media_block(media_block_stack.back());
622
633
  }
623
634
  }
624
635
  selector_stack.push_back(0);
625
- expand_selector_list(s, extender);
636
+ expand_selector_list(sl, extender);
626
637
  selector_stack.pop_back();
627
638
  }
628
639
  return 0;
@@ -1016,20 +1016,30 @@ namespace Sass {
1016
1016
  String_Constant* s = ARG("$string", String_Constant);
1017
1017
  double start_at = ARG("$start-at", Number)->value();
1018
1018
  double end_at = ARG("$end-at", Number)->value();
1019
+ String_Quoted* ss = dynamic_cast<String_Quoted*>(s);
1019
1020
 
1020
1021
  std::string str = unquote(s->value());
1021
1022
 
1022
1023
  size_t size = utf8::distance(str.begin(), str.end());
1023
- if (end_at <= size * -1.0 && size > 1) {
1024
- end_at += size;
1025
- if (end_at == 0) end_at = 1;
1024
+
1025
+ if (!dynamic_cast<Number*>(env["$end-at"])) {
1026
+ end_at = -1;
1027
+ }
1028
+
1029
+ if (end_at == 0 || (end_at + size) < 0) {
1030
+ if (ss && ss->quote_mark()) newstr = quote("");
1031
+ return SASS_MEMORY_NEW(ctx.mem, String_Quoted, pstate, newstr);
1026
1032
  }
1033
+
1027
1034
  if (end_at < 0) {
1028
1035
  end_at += size + 1;
1029
1036
  if (end_at == 0) end_at = 1;
1030
1037
  }
1031
1038
  if (end_at > size) { end_at = (double)size; }
1032
- if (start_at < 0) { start_at += size + 1; }
1039
+ if (start_at < 0) {
1040
+ start_at += size + 1;
1041
+ if (start_at < 0) start_at = 0;
1042
+ }
1033
1043
  else if (start_at == 0) { ++ start_at; }
1034
1044
 
1035
1045
  if (start_at <= end_at)
@@ -44,9 +44,9 @@ namespace Sass {
44
44
  const double resolution_conversion_factors[3][3] =
45
45
  {
46
46
  /* dpi dpcm dppx */
47
- /* dpi */ { 1, 2.54, 96 },
48
- /* dpcm */ { 1/2.54, 1, 96/2.54 },
49
- /* dppx */ { 1/96.0, 2.54/96, 1 }
47
+ /* dpi */ { 1, 1/2.54, 1/96.0 },
48
+ /* dpcm */ { 2.54, 1, 2.54/96 },
49
+ /* dppx */ { 96, 96/2.54, 1 }
50
50
  };
51
51
 
52
52
  UnitClass get_unit_type(UnitType unit)
@@ -1,3 +1,3 @@
1
1
  module SassC
2
- VERSION = "1.11.0"
2
+ VERSION = "1.11.1"
3
3
  end
@@ -9,7 +9,7 @@ module SassC
9
9
 
10
10
  class General < MiniTest::Test
11
11
  def test_it_reports_the_libsass_version
12
- assert_equal "3.4.0", Native.version
12
+ assert_equal "3.4.1", Native.version
13
13
  end
14
14
  end
15
15
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sassc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Boland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-16 00:00:00.000000000 Z
11
+ date: 2016-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake