sassc 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  #ifndef SASS_UTIL_H
2
2
  #define SASS_UTIL_H
3
3
 
4
+ #include <cstdio>
4
5
  #include <vector>
5
6
  #include <string>
6
7
  #include "ast_fwd_decl.hpp"
@@ -12,6 +13,7 @@ namespace Sass {
12
13
  double sass_atof(const char* str);
13
14
  string string_escape(const string& str);
14
15
  string string_unescape(const string& str);
16
+ string string_eval_escapes(const string& str);
15
17
  string read_css_string(const string& str);
16
18
  string evacuate_quotes(const string& str);
17
19
  string evacuate_escapes(const string& str);
@@ -40,6 +40,8 @@ module SassC
40
40
 
41
41
  Native.delete_data_context(data_context)
42
42
 
43
+ css.force_encoding(@template.encoding)
44
+
43
45
  return css unless quiet?
44
46
  end
45
47
 
@@ -49,7 +49,7 @@ module SassC
49
49
 
50
50
  def self.native_string(string)
51
51
  string += "\0"
52
- data = Native::LibC.malloc(string.size)
52
+ data = Native::LibC.malloc(string.bytesize)
53
53
  data.write_string(string)
54
54
  data
55
55
  end
@@ -1,3 +1,3 @@
1
1
  module SassC
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -117,5 +117,12 @@ CSS
117
117
  assert_equal css, Engine.new(sass, syntax: "sass").render
118
118
  assert_raises(SyntaxError) { Engine.new(sass).render }
119
119
  end
120
+
121
+ def test_encoding_matches_input
122
+ input = "$size: 30px;"
123
+ input.force_encoding("UTF-8")
124
+ output = Engine.new(input).render
125
+ assert_equal input.encoding, output.encoding
126
+ end
120
127
  end
121
128
  end
@@ -3,12 +3,13 @@ require_relative "test_helper"
3
3
  module SassC
4
4
  module NativeTest
5
5
  SAMPLE_SASS_STRING = "$size: 30px; .hi { width: $size; }"
6
+ SPECIAL_SASS_STRING = "$sißßßßßße: 30px; .hßß©i { width: $size; }"
6
7
  SAMPLE_CSS_OUTPUT = ".hi {\n width: 30px; }\n"
7
8
  BAD_SASS_STRING = "$size = 30px;"
8
9
 
9
10
  class General < MiniTest::Test
10
11
  def test_it_reports_the_libsass_version
11
- assert_equal "3.2.0-beta.6", Native.version
12
+ assert_equal "3.2.2", Native.version
12
13
  end
13
14
  end
14
15
 
@@ -48,6 +49,14 @@ module SassC
48
49
  refute_equal 0, status
49
50
  end
50
51
 
52
+ def test_multibyte_characters_work
53
+ @data_context = Native.make_data_context(SPECIAL_SASS_STRING)
54
+ context = Native.data_context_get_context(@data_context)
55
+
56
+ status = Native.compile_data_context(@data_context)
57
+ refute_equal 0, status
58
+ end
59
+
51
60
  def test_failed_compile_gives_error_message
52
61
  end
53
62
 
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.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Boland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-25 00:00:00.000000000 Z
11
+ date: 2015-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake