sassc 2.2.1 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/CHANGELOG.md +18 -0
  4. data/Rakefile +1 -3
  5. data/ext/extconf.rb +13 -5
  6. data/ext/libsass/VERSION +1 -1
  7. data/ext/libsass/include/sass/base.h +2 -1
  8. data/ext/libsass/include/sass/context.h +4 -0
  9. data/ext/libsass/src/MurmurHash2.hpp +91 -0
  10. data/ext/libsass/src/ast.cpp +158 -168
  11. data/ext/libsass/src/ast.hpp +389 -230
  12. data/ext/libsass/src/ast_def_macros.hpp +18 -10
  13. data/ext/libsass/src/ast_fwd_decl.cpp +4 -3
  14. data/ext/libsass/src/ast_fwd_decl.hpp +98 -165
  15. data/ext/libsass/src/ast_helpers.hpp +292 -0
  16. data/ext/libsass/src/ast_sel_cmp.cpp +219 -732
  17. data/ext/libsass/src/ast_sel_super.cpp +539 -0
  18. data/ext/libsass/src/ast_sel_unify.cpp +207 -212
  19. data/ext/libsass/src/ast_sel_weave.cpp +616 -0
  20. data/ext/libsass/src/ast_selectors.cpp +594 -1026
  21. data/ext/libsass/src/ast_selectors.hpp +339 -385
  22. data/ext/libsass/src/ast_supports.cpp +36 -52
  23. data/ext/libsass/src/ast_supports.hpp +29 -29
  24. data/ext/libsass/src/ast_values.cpp +271 -84
  25. data/ext/libsass/src/ast_values.hpp +116 -107
  26. data/ext/libsass/src/backtrace.cpp +9 -9
  27. data/ext/libsass/src/backtrace.hpp +5 -5
  28. data/ext/libsass/src/base64vlq.cpp +2 -2
  29. data/ext/libsass/src/base64vlq.hpp +1 -1
  30. data/ext/libsass/src/bind.cpp +18 -18
  31. data/ext/libsass/src/bind.hpp +1 -1
  32. data/ext/libsass/src/c2ast.cpp +3 -3
  33. data/ext/libsass/src/c2ast.hpp +1 -1
  34. data/ext/libsass/src/cencode.c +4 -6
  35. data/ext/libsass/src/check_nesting.cpp +40 -41
  36. data/ext/libsass/src/check_nesting.hpp +6 -2
  37. data/ext/libsass/src/color_maps.cpp +14 -13
  38. data/ext/libsass/src/color_maps.hpp +1 -9
  39. data/ext/libsass/src/constants.cpp +5 -0
  40. data/ext/libsass/src/constants.hpp +6 -0
  41. data/ext/libsass/src/context.cpp +92 -119
  42. data/ext/libsass/src/context.hpp +41 -53
  43. data/ext/libsass/src/cssize.cpp +66 -149
  44. data/ext/libsass/src/cssize.hpp +17 -23
  45. data/ext/libsass/src/dart_helpers.hpp +199 -0
  46. data/ext/libsass/src/debugger.hpp +451 -295
  47. data/ext/libsass/src/emitter.cpp +15 -16
  48. data/ext/libsass/src/emitter.hpp +10 -12
  49. data/ext/libsass/src/environment.cpp +27 -27
  50. data/ext/libsass/src/environment.hpp +29 -24
  51. data/ext/libsass/src/error_handling.cpp +62 -41
  52. data/ext/libsass/src/error_handling.hpp +61 -51
  53. data/ext/libsass/src/eval.cpp +167 -281
  54. data/ext/libsass/src/eval.hpp +27 -29
  55. data/ext/libsass/src/eval_selectors.cpp +75 -0
  56. data/ext/libsass/src/expand.cpp +275 -222
  57. data/ext/libsass/src/expand.hpp +36 -16
  58. data/ext/libsass/src/extender.cpp +1188 -0
  59. data/ext/libsass/src/extender.hpp +399 -0
  60. data/ext/libsass/src/extension.cpp +43 -0
  61. data/ext/libsass/src/extension.hpp +89 -0
  62. data/ext/libsass/src/file.cpp +81 -72
  63. data/ext/libsass/src/file.hpp +28 -37
  64. data/ext/libsass/src/fn_colors.cpp +20 -18
  65. data/ext/libsass/src/fn_lists.cpp +30 -29
  66. data/ext/libsass/src/fn_maps.cpp +3 -3
  67. data/ext/libsass/src/fn_miscs.cpp +34 -46
  68. data/ext/libsass/src/fn_numbers.cpp +20 -13
  69. data/ext/libsass/src/fn_selectors.cpp +98 -128
  70. data/ext/libsass/src/fn_strings.cpp +47 -33
  71. data/ext/libsass/src/fn_utils.cpp +31 -29
  72. data/ext/libsass/src/fn_utils.hpp +17 -11
  73. data/ext/libsass/src/inspect.cpp +186 -148
  74. data/ext/libsass/src/inspect.hpp +31 -29
  75. data/ext/libsass/src/lexer.cpp +20 -82
  76. data/ext/libsass/src/lexer.hpp +5 -16
  77. data/ext/libsass/src/listize.cpp +23 -37
  78. data/ext/libsass/src/listize.hpp +8 -9
  79. data/ext/libsass/src/mapping.hpp +1 -0
  80. data/ext/libsass/src/memory/allocator.cpp +48 -0
  81. data/ext/libsass/src/memory/allocator.hpp +138 -0
  82. data/ext/libsass/src/memory/config.hpp +20 -0
  83. data/ext/libsass/src/memory/memory_pool.hpp +186 -0
  84. data/ext/libsass/src/memory/{SharedPtr.cpp → shared_ptr.cpp} +2 -2
  85. data/ext/libsass/src/memory/{SharedPtr.hpp → shared_ptr.hpp} +55 -9
  86. data/ext/libsass/src/memory.hpp +12 -0
  87. data/ext/libsass/src/operation.hpp +71 -61
  88. data/ext/libsass/src/operators.cpp +19 -18
  89. data/ext/libsass/src/operators.hpp +11 -11
  90. data/ext/libsass/src/ordered_map.hpp +112 -0
  91. data/ext/libsass/src/output.cpp +45 -64
  92. data/ext/libsass/src/output.hpp +6 -6
  93. data/ext/libsass/src/parser.cpp +512 -700
  94. data/ext/libsass/src/parser.hpp +89 -97
  95. data/ext/libsass/src/parser_selectors.cpp +189 -0
  96. data/ext/libsass/src/permutate.hpp +164 -0
  97. data/ext/libsass/src/plugins.cpp +7 -7
  98. data/ext/libsass/src/plugins.hpp +8 -8
  99. data/ext/libsass/src/position.cpp +7 -26
  100. data/ext/libsass/src/position.hpp +44 -21
  101. data/ext/libsass/src/prelexer.cpp +6 -6
  102. data/ext/libsass/src/remove_placeholders.cpp +55 -56
  103. data/ext/libsass/src/remove_placeholders.hpp +21 -18
  104. data/ext/libsass/src/sass.cpp +16 -15
  105. data/ext/libsass/src/sass.hpp +10 -5
  106. data/ext/libsass/src/sass2scss.cpp +4 -4
  107. data/ext/libsass/src/sass_context.cpp +91 -122
  108. data/ext/libsass/src/sass_context.hpp +2 -2
  109. data/ext/libsass/src/sass_functions.cpp +1 -1
  110. data/ext/libsass/src/sass_values.cpp +8 -11
  111. data/ext/libsass/src/settings.hpp +19 -0
  112. data/ext/libsass/src/source.cpp +69 -0
  113. data/ext/libsass/src/source.hpp +95 -0
  114. data/ext/libsass/src/source_data.hpp +32 -0
  115. data/ext/libsass/src/source_map.cpp +22 -18
  116. data/ext/libsass/src/source_map.hpp +12 -9
  117. data/ext/libsass/src/stylesheet.cpp +22 -0
  118. data/ext/libsass/src/stylesheet.hpp +57 -0
  119. data/ext/libsass/src/to_value.cpp +2 -2
  120. data/ext/libsass/src/to_value.hpp +1 -1
  121. data/ext/libsass/src/units.cpp +24 -22
  122. data/ext/libsass/src/units.hpp +8 -8
  123. data/ext/libsass/src/utf8_string.cpp +9 -10
  124. data/ext/libsass/src/utf8_string.hpp +7 -6
  125. data/ext/libsass/src/util.cpp +48 -50
  126. data/ext/libsass/src/util.hpp +20 -21
  127. data/ext/libsass/src/util_string.cpp +111 -61
  128. data/ext/libsass/src/util_string.hpp +62 -8
  129. data/ext/libsass/src/values.cpp +12 -12
  130. data/lib/sassc/engine.rb +5 -3
  131. data/lib/sassc/functions_handler.rb +8 -8
  132. data/lib/sassc/native.rb +4 -6
  133. data/lib/sassc/script.rb +4 -4
  134. data/lib/sassc/version.rb +1 -1
  135. data/test/functions_test.rb +18 -1
  136. data/test/native_test.rb +4 -4
  137. metadata +29 -15
  138. data/ext/libsass/src/extend.cpp +0 -2132
  139. data/ext/libsass/src/extend.hpp +0 -86
  140. data/ext/libsass/src/node.cpp +0 -322
  141. data/ext/libsass/src/node.hpp +0 -118
  142. data/ext/libsass/src/paths.hpp +0 -71
  143. data/ext/libsass/src/sass_util.cpp +0 -152
  144. data/ext/libsass/src/sass_util.hpp +0 -256
  145. data/ext/libsass/src/subset_map.cpp +0 -58
  146. data/ext/libsass/src/subset_map.hpp +0 -76
  147. data/lib/sassc/native/lib_c.rb +0 -21
@@ -1,19 +1,73 @@
1
1
  #ifndef SASS_UTIL_STRING_H
2
2
  #define SASS_UTIL_STRING_H
3
3
 
4
+ #include "sass.hpp"
4
5
  #include <string>
5
6
 
6
7
  namespace Sass {
7
- namespace Util {
8
+ namespace Util {
8
9
 
9
- std::string rtrim(const std::string& str);
10
+ // ##########################################################################
11
+ // Special case insensitive string matcher. We can optimize
12
+ // the more general compare case quite a bit by requiring
13
+ // consumers to obey some rules (lowercase and no space).
14
+ // - `literal` must only contain lower case ascii characters
15
+ // there is one edge case where this could give false positives
16
+ // test could contain a (non-ascii) char exactly 32 below literal
17
+ // ##########################################################################
18
+ bool equalsLiteral(const char* lit, const sass::string& test);
10
19
 
11
- std::string normalize_newlines(const std::string& str);
12
- std::string normalize_underscores(const std::string& str);
13
- std::string normalize_decimals(const std::string& str);
14
- char opening_bracket_for(char closing_bracket);
15
- char closing_bracket_for(char opening_bracket);
20
+ // ###########################################################################
21
+ // Returns [name] without a vendor prefix.
22
+ // If [name] has no vendor prefix, it's returned as-is.
23
+ // ###########################################################################
24
+ sass::string unvendor(const sass::string& name);
16
25
 
17
- } // namespace Sass
26
+ sass::string rtrim(sass::string str);
27
+ sass::string normalize_newlines(const sass::string& str);
28
+ sass::string normalize_underscores(const sass::string& str);
29
+ sass::string normalize_decimals(const sass::string& str);
30
+ char opening_bracket_for(char closing_bracket);
31
+ char closing_bracket_for(char opening_bracket);
32
+
33
+ // Locale-independent ASCII character routines.
34
+
35
+ inline bool ascii_isalpha(unsigned char c) {
36
+ return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
37
+ }
38
+
39
+ inline bool ascii_isdigit(unsigned char c) {
40
+ return (c >= '0' && c <= '9');
41
+ }
42
+
43
+ inline bool ascii_isalnum(unsigned char c) {
44
+ return ascii_isalpha(c) || ascii_isdigit(c);
45
+ }
46
+
47
+ inline bool ascii_isascii(unsigned char c) { return c < 128; }
48
+
49
+ inline bool ascii_isxdigit(unsigned char c) {
50
+ return ascii_isdigit(c) || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f');
51
+ }
52
+
53
+ inline bool ascii_isspace(unsigned char c) {
54
+ return c == ' ' || c == '\t' || c == '\v' || c == '\f' || c == '\r' || c == '\n';
55
+ }
56
+
57
+ inline char ascii_tolower(unsigned char c) {
58
+ if (c >= 'A' && c <= 'Z') return c + 32;
59
+ return c;
60
+ }
61
+
62
+ void ascii_str_tolower(sass::string* s);
63
+
64
+ inline char ascii_toupper(unsigned char c) {
65
+ if (c >= 'a' && c <= 'z') return c - 32;
66
+ return c;
67
+ }
68
+
69
+ void ascii_str_toupper(sass::string* s);
70
+
71
+ } // namespace Sass
18
72
  } // namespace Util
19
73
  #endif // SASS_UTIL_STRING_H
@@ -32,7 +32,7 @@ namespace Sass {
32
32
  const List* l = Cast<List>(val);
33
33
  union Sass_Value* list = sass_make_list(l->size(), l->separator(), l->is_bracketed());
34
34
  for (size_t i = 0, L = l->length(); i < L; ++i) {
35
- Expression_Obj obj = l->at(i);
35
+ ExpressionObj obj = l->at(i);
36
36
  auto val = ast_node_to_sass_value(obj);
37
37
  sass_list_set_value(list, i, val);
38
38
  }
@@ -42,7 +42,7 @@ namespace Sass {
42
42
  {
43
43
  const Map* m = Cast<Map>(val);
44
44
  union Sass_Value* map = sass_make_map(m->length());
45
- size_t i = 0; for (Expression_Obj key : m->keys()) {
45
+ size_t i = 0; for (ExpressionObj key : m->keys()) {
46
46
  sass_map_set_key(map, i, ast_node_to_sass_value(key));
47
47
  sass_map_set_value(map, i, ast_node_to_sass_value(m->at(key)));
48
48
  ++ i;
@@ -78,17 +78,17 @@ namespace Sass {
78
78
  switch (sass_value_get_tag(val)) {
79
79
  case SASS_NUMBER:
80
80
  return SASS_MEMORY_NEW(Number,
81
- ParserState("[C-VALUE]"),
81
+ SourceSpan("[C-VALUE]"),
82
82
  sass_number_get_value(val),
83
83
  sass_number_get_unit(val));
84
84
  case SASS_BOOLEAN:
85
85
  return SASS_MEMORY_NEW(Boolean,
86
- ParserState("[C-VALUE]"),
86
+ SourceSpan("[C-VALUE]"),
87
87
  sass_boolean_get_value(val));
88
88
  case SASS_COLOR:
89
89
  // ToDo: allow to also use HSLA colors!!
90
90
  return SASS_MEMORY_NEW(Color_RGBA,
91
- ParserState("[C-VALUE]"),
91
+ SourceSpan("[C-VALUE]"),
92
92
  sass_color_get_r(val),
93
93
  sass_color_get_g(val),
94
94
  sass_color_get_b(val),
@@ -96,15 +96,15 @@ namespace Sass {
96
96
  case SASS_STRING:
97
97
  if (sass_string_is_quoted(val)) {
98
98
  return SASS_MEMORY_NEW(String_Quoted,
99
- ParserState("[C-VALUE]"),
99
+ SourceSpan("[C-VALUE]"),
100
100
  sass_string_get_value(val));
101
101
  }
102
102
  return SASS_MEMORY_NEW(String_Constant,
103
- ParserState("[C-VALUE]"),
103
+ SourceSpan("[C-VALUE]"),
104
104
  sass_string_get_value(val));
105
105
  case SASS_LIST: {
106
106
  List* l = SASS_MEMORY_NEW(List,
107
- ParserState("[C-VALUE]"),
107
+ SourceSpan("[C-VALUE]"),
108
108
  sass_list_get_length(val),
109
109
  sass_list_get_separator(val));
110
110
  for (size_t i = 0, L = sass_list_get_length(val); i < L; ++i) {
@@ -114,7 +114,7 @@ namespace Sass {
114
114
  return l;
115
115
  }
116
116
  case SASS_MAP: {
117
- Map* m = SASS_MEMORY_NEW(Map, ParserState("[C-VALUE]"));
117
+ Map* m = SASS_MEMORY_NEW(Map, SourceSpan("[C-VALUE]"));
118
118
  for (size_t i = 0, L = sass_map_get_length(val); i < L; ++i) {
119
119
  *m << std::make_pair(
120
120
  sass_value_to_ast_node(sass_map_get_key(val, i)),
@@ -123,14 +123,14 @@ namespace Sass {
123
123
  return m;
124
124
  }
125
125
  case SASS_NULL:
126
- return SASS_MEMORY_NEW(Null, ParserState("[C-VALUE]"));
126
+ return SASS_MEMORY_NEW(Null, SourceSpan("[C-VALUE]"));
127
127
  case SASS_ERROR:
128
128
  return SASS_MEMORY_NEW(Custom_Error,
129
- ParserState("[C-VALUE]"),
129
+ SourceSpan("[C-VALUE]"),
130
130
  sass_error_get_message(val));
131
131
  case SASS_WARNING:
132
132
  return SASS_MEMORY_NEW(Custom_Warning,
133
- ParserState("[C-VALUE]"),
133
+ SourceSpan("[C-VALUE]"),
134
134
  sass_warning_get_message(val));
135
135
  default: break;
136
136
  }
data/lib/sassc/engine.rb CHANGED
@@ -16,6 +16,7 @@ module SassC
16
16
  def initialize(template, options = {})
17
17
  @template = template
18
18
  @options = options
19
+ @functions = options.fetch(:functions, Script::Functions)
19
20
  end
20
21
 
21
22
  def render
@@ -37,7 +38,7 @@ module SassC
37
38
  Native.option_set_omit_source_map_url(native_options, true) if omit_source_map_url?
38
39
 
39
40
  import_handler.setup(native_options)
40
- functions_handler.setup(native_options)
41
+ functions_handler.setup(native_options, functions: @functions)
41
42
 
42
43
  status = Native.compile_data_context(data_context)
43
44
 
@@ -54,11 +55,12 @@ module SassC
54
55
  @dependencies = Native.context_get_included_files(context)
55
56
  @source_map = Native.context_get_source_map_string(context)
56
57
 
57
- Native.delete_data_context(data_context)
58
-
59
58
  css.force_encoding(@template.encoding)
59
+ @source_map.force_encoding(@template.encoding) if @source_map.is_a?(String)
60
60
 
61
61
  return css unless quiet?
62
+ ensure
63
+ Native.delete_data_context(data_context) if data_context
62
64
  end
63
65
 
64
66
  def dependencies
@@ -6,24 +6,24 @@ module SassC
6
6
  @options = options
7
7
  end
8
8
 
9
- def setup(native_options)
9
+ def setup(native_options, functions: Script::Functions)
10
10
  @callbacks = {}
11
11
  @function_names = {}
12
12
 
13
- list = Native.make_function_list(Script.custom_functions.count)
13
+ list = Native.make_function_list(Script.custom_functions(functions: functions).count)
14
14
 
15
15
  # use an anonymous class wrapper to avoid mutations in a threaded environment
16
- functions = Class.new do
16
+ functions_wrapper = Class.new do
17
17
  attr_accessor :options
18
- include Script::Functions
18
+ include functions
19
19
  end.new
20
- functions.options = @options
20
+ functions_wrapper.options = @options
21
21
 
22
- Script.custom_functions.each_with_index do |custom_function, i|
22
+ Script.custom_functions(functions: functions).each_with_index do |custom_function, i|
23
23
  @callbacks[custom_function] = FFI::Function.new(:pointer, [:pointer, :pointer]) do |native_argument_list, cookie|
24
24
  begin
25
25
  function_arguments = arguments_from_native_list(native_argument_list)
26
- result = functions.send(custom_function, *function_arguments)
26
+ result = functions_wrapper.send(custom_function, *function_arguments)
27
27
  to_native_value(result)
28
28
  rescue StandardError => exception
29
29
  # This rescues any exceptions that occur either in value conversion
@@ -32,7 +32,7 @@ module SassC
32
32
  end
33
33
  end
34
34
 
35
- @function_names[custom_function] = Script.formatted_function_name(custom_function)
35
+ @function_names[custom_function] = Script.formatted_function_name(custom_function, functions: functions)
36
36
 
37
37
  callback = Native.make_function(
38
38
  @function_names[custom_function],
data/lib/sassc/native.rb CHANGED
@@ -6,7 +6,7 @@ module SassC
6
6
  module Native
7
7
  extend FFI::Library
8
8
 
9
- dl_ext = (RbConfig::CONFIG['host_os'] =~ /darwin/ ? 'bundle' : 'so')
9
+ dl_ext = RbConfig::MAKEFILE_CONFIG['DLEXT']
10
10
  begin
11
11
  ffi_lib File.expand_path("libsass.#{dl_ext}", __dir__)
12
12
  rescue LoadError # Some non-rvm environments don't copy a shared object over to lib/sassc
@@ -34,7 +34,6 @@ module SassC
34
34
  require_relative "native/sass_input_style"
35
35
  require_relative "native/sass_output_style"
36
36
  require_relative "native/string_list"
37
- require_relative "native/lib_c"
38
37
 
39
38
  # Remove the redundant "sass_" from the beginning of every method name
40
39
  def self.attach_function(*args)
@@ -53,10 +52,9 @@ module SassC
53
52
  end
54
53
 
55
54
  def self.native_string(string)
56
- string = "#{string}\0"
57
- data = Native::LibC.malloc(string.bytesize)
58
- data.write_string(string)
59
- data
55
+ m = FFI::MemoryPointer.from_string(string)
56
+ m.autorelease = false
57
+ m
60
58
  end
61
59
 
62
60
  require_relative "native/native_context_api"
data/lib/sassc/script.rb CHANGED
@@ -3,12 +3,12 @@
3
3
  module SassC
4
4
  module Script
5
5
 
6
- def self.custom_functions
7
- Functions.public_instance_methods
6
+ def self.custom_functions(functions: Functions)
7
+ functions.public_instance_methods
8
8
  end
9
9
 
10
- def self.formatted_function_name(function_name)
11
- params = Functions.instance_method(function_name).parameters
10
+ def self.formatted_function_name(function_name, functions: Functions)
11
+ params = functions.instance_method(function_name).parameters
12
12
  params = params.map { |param_type, name| "$#{name}#{': null' if param_type == :opt}" }.join(", ")
13
13
  return "#{function_name}(#{params})"
14
14
  end
data/lib/sassc/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SassC
4
- VERSION = "2.2.1"
4
+ VERSION = "2.4.0"
5
5
  end
@@ -140,7 +140,7 @@ module SassC
140
140
 
141
141
  assert_match /Error: error in C function function_that_raises_errors/, exception.message
142
142
  assert_match /Intentional wrong thing happened somewhere inside the custom function/, exception.message
143
- assert_equal "[SassC::FunctionsHandler] Intentional wrong thing happened somewhere inside the custom function", stderr_output
143
+ assert_match /\[SassC::FunctionsHandler\] Intentional wrong thing happened somewhere inside the custom function/, stderr_output
144
144
  end
145
145
 
146
146
  def test_function_that_returns_a_sass_value
@@ -201,6 +201,17 @@ module SassC
201
201
  end
202
202
  end
203
203
 
204
+ def test_pass_custom_functions_as_a_parameter
205
+ out = Engine.new("div { url: test-function(); }", {functions: ExternalFunctions}).render
206
+ assert_match /custom_function/, out
207
+ end
208
+
209
+ def test_pass_incompatible_type_to_custom_functions
210
+ assert_raises(TypeError) do
211
+ Engine.new("div { url: test-function(); }", {functions: Class.new}).render
212
+ end
213
+ end
214
+
204
215
  private
205
216
 
206
217
  def assert_sass(sass, expected_css)
@@ -319,5 +330,11 @@ module SassC
319
330
 
320
331
  end
321
332
 
333
+ module ExternalFunctions
334
+ def test_function
335
+ SassC::Script::Value::String.new("custom_function", :string)
336
+ end
337
+ end
338
+
322
339
  end
323
340
  end
data/test/native_test.rb CHANGED
@@ -11,7 +11,7 @@ module SassC
11
11
 
12
12
  class General < MiniTest::Test
13
13
  def test_it_reports_the_libsass_version
14
- assert_equal "3.6.1", Native.version
14
+ assert_equal "3.6.4", Native.version
15
15
  end
16
16
  end
17
17
 
@@ -185,9 +185,9 @@ module SassC
185
185
  funct = FFI::Function.new(:pointer, [:pointer, :pointer, :pointer]) do |url, prev, cookie|
186
186
  list = Native.make_import_list(2)
187
187
 
188
- str = "$var: 5px;\0"
189
- data = Native::LibC.malloc(str.size)
190
- data.write_string(str)
188
+ str = "$var: 5px;"
189
+ data = FFI::MemoryPointer.from_string(str)
190
+ data.autorelease = false
191
191
 
192
192
  entry0 = Native.make_import_entry("fake_includ.scss", data, nil)
193
193
  entry1 = Native.make_import_entry("not_included.scss", nil, nil)
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: 2.2.1
4
+ version: 2.4.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: 2019-09-18 00:00:00.000000000 Z
11
+ date: 2020-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -164,6 +164,7 @@ files:
164
164
  - ext/libsass/include/sass/values.h
165
165
  - ext/libsass/include/sass/version.h
166
166
  - ext/libsass/include/sass2scss.h
167
+ - ext/libsass/src/MurmurHash2.hpp
167
168
  - ext/libsass/src/ast.cpp
168
169
  - ext/libsass/src/ast.hpp
169
170
  - ext/libsass/src/ast2c.cpp
@@ -171,8 +172,11 @@ files:
171
172
  - ext/libsass/src/ast_def_macros.hpp
172
173
  - ext/libsass/src/ast_fwd_decl.cpp
173
174
  - ext/libsass/src/ast_fwd_decl.hpp
175
+ - ext/libsass/src/ast_helpers.hpp
174
176
  - ext/libsass/src/ast_sel_cmp.cpp
177
+ - ext/libsass/src/ast_sel_super.cpp
175
178
  - ext/libsass/src/ast_sel_unify.cpp
179
+ - ext/libsass/src/ast_sel_weave.cpp
176
180
  - ext/libsass/src/ast_selectors.cpp
177
181
  - ext/libsass/src/ast_selectors.hpp
178
182
  - ext/libsass/src/ast_supports.cpp
@@ -201,6 +205,7 @@ files:
201
205
  - ext/libsass/src/context.hpp
202
206
  - ext/libsass/src/cssize.cpp
203
207
  - ext/libsass/src/cssize.hpp
208
+ - ext/libsass/src/dart_helpers.hpp
204
209
  - ext/libsass/src/debug.hpp
205
210
  - ext/libsass/src/debugger.hpp
206
211
  - ext/libsass/src/emitter.cpp
@@ -211,10 +216,13 @@ files:
211
216
  - ext/libsass/src/error_handling.hpp
212
217
  - ext/libsass/src/eval.cpp
213
218
  - ext/libsass/src/eval.hpp
219
+ - ext/libsass/src/eval_selectors.cpp
214
220
  - ext/libsass/src/expand.cpp
215
221
  - ext/libsass/src/expand.hpp
216
- - ext/libsass/src/extend.cpp
217
- - ext/libsass/src/extend.hpp
222
+ - ext/libsass/src/extender.cpp
223
+ - ext/libsass/src/extender.hpp
224
+ - ext/libsass/src/extension.cpp
225
+ - ext/libsass/src/extension.hpp
218
226
  - ext/libsass/src/file.cpp
219
227
  - ext/libsass/src/file.hpp
220
228
  - ext/libsass/src/fn_colors.cpp
@@ -243,18 +251,23 @@ files:
243
251
  - ext/libsass/src/listize.cpp
244
252
  - ext/libsass/src/listize.hpp
245
253
  - ext/libsass/src/mapping.hpp
246
- - ext/libsass/src/memory/SharedPtr.cpp
247
- - ext/libsass/src/memory/SharedPtr.hpp
248
- - ext/libsass/src/node.cpp
249
- - ext/libsass/src/node.hpp
254
+ - ext/libsass/src/memory.hpp
255
+ - ext/libsass/src/memory/allocator.cpp
256
+ - ext/libsass/src/memory/allocator.hpp
257
+ - ext/libsass/src/memory/config.hpp
258
+ - ext/libsass/src/memory/memory_pool.hpp
259
+ - ext/libsass/src/memory/shared_ptr.cpp
260
+ - ext/libsass/src/memory/shared_ptr.hpp
250
261
  - ext/libsass/src/operation.hpp
251
262
  - ext/libsass/src/operators.cpp
252
263
  - ext/libsass/src/operators.hpp
264
+ - ext/libsass/src/ordered_map.hpp
253
265
  - ext/libsass/src/output.cpp
254
266
  - ext/libsass/src/output.hpp
255
267
  - ext/libsass/src/parser.cpp
256
268
  - ext/libsass/src/parser.hpp
257
- - ext/libsass/src/paths.hpp
269
+ - ext/libsass/src/parser_selectors.cpp
270
+ - ext/libsass/src/permutate.hpp
258
271
  - ext/libsass/src/plugins.cpp
259
272
  - ext/libsass/src/plugins.hpp
260
273
  - ext/libsass/src/position.cpp
@@ -270,14 +283,16 @@ files:
270
283
  - ext/libsass/src/sass_context.hpp
271
284
  - ext/libsass/src/sass_functions.cpp
272
285
  - ext/libsass/src/sass_functions.hpp
273
- - ext/libsass/src/sass_util.cpp
274
- - ext/libsass/src/sass_util.hpp
275
286
  - ext/libsass/src/sass_values.cpp
276
287
  - ext/libsass/src/sass_values.hpp
288
+ - ext/libsass/src/settings.hpp
289
+ - ext/libsass/src/source.cpp
290
+ - ext/libsass/src/source.hpp
291
+ - ext/libsass/src/source_data.hpp
277
292
  - ext/libsass/src/source_map.cpp
278
293
  - ext/libsass/src/source_map.hpp
279
- - ext/libsass/src/subset_map.cpp
280
- - ext/libsass/src/subset_map.hpp
294
+ - ext/libsass/src/stylesheet.cpp
295
+ - ext/libsass/src/stylesheet.hpp
281
296
  - ext/libsass/src/to_value.cpp
282
297
  - ext/libsass/src/to_value.hpp
283
298
  - ext/libsass/src/units.cpp
@@ -302,7 +317,6 @@ files:
302
317
  - lib/sassc/import_handler.rb
303
318
  - lib/sassc/importer.rb
304
319
  - lib/sassc/native.rb
305
- - lib/sassc/native/lib_c.rb
306
320
  - lib/sassc/native/native_context_api.rb
307
321
  - lib/sassc/native/native_functions_api.rb
308
322
  - lib/sassc/native/sass2scss_api.rb
@@ -360,7 +374,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
360
374
  - !ruby/object:Gem::Version
361
375
  version: '0'
362
376
  requirements: []
363
- rubygems_version: 3.0.3
377
+ rubygems_version: 3.1.2
364
378
  signing_key:
365
379
  specification_version: 4
366
380
  summary: Use libsass with Ruby!