sassc 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.gitmodules +3 -0
- data/.travis.yml +9 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +24 -0
- data/Rakefile +21 -0
- data/ext/libsass/.editorconfig +15 -0
- data/ext/libsass/.gitattributes +2 -0
- data/ext/libsass/.gitignore +61 -0
- data/ext/libsass/.travis.yml +38 -0
- data/ext/libsass/COPYING +25 -0
- data/ext/libsass/INSTALL +1 -0
- data/ext/libsass/LICENSE +25 -0
- data/ext/libsass/Makefile +223 -0
- data/ext/libsass/Makefile.am +145 -0
- data/ext/libsass/Readme.md +93 -0
- data/ext/libsass/appveyor.yml +76 -0
- data/ext/libsass/ast.cpp +581 -0
- data/ext/libsass/ast.hpp +1949 -0
- data/ext/libsass/ast_def_macros.hpp +16 -0
- data/ext/libsass/ast_factory.hpp +87 -0
- data/ext/libsass/ast_fwd_decl.hpp +72 -0
- data/ext/libsass/b64/cencode.h +32 -0
- data/ext/libsass/b64/encode.h +77 -0
- data/ext/libsass/backtrace.hpp +81 -0
- data/ext/libsass/base64vlq.cpp +43 -0
- data/ext/libsass/base64vlq.hpp +28 -0
- data/ext/libsass/bind.cpp +187 -0
- data/ext/libsass/bind.hpp +18 -0
- data/ext/libsass/cencode.c +102 -0
- data/ext/libsass/color_names.hpp +324 -0
- data/ext/libsass/configure.ac +130 -0
- data/ext/libsass/constants.cpp +144 -0
- data/ext/libsass/constants.hpp +145 -0
- data/ext/libsass/context.cpp +507 -0
- data/ext/libsass/context.hpp +150 -0
- data/ext/libsass/contextualize.cpp +157 -0
- data/ext/libsass/contextualize.hpp +65 -0
- data/ext/libsass/copy_c_str.cpp +13 -0
- data/ext/libsass/copy_c_str.hpp +5 -0
- data/ext/libsass/debug.hpp +39 -0
- data/ext/libsass/environment.hpp +75 -0
- data/ext/libsass/error_handling.cpp +28 -0
- data/ext/libsass/error_handling.hpp +28 -0
- data/ext/libsass/eval.cpp +1149 -0
- data/ext/libsass/eval.hpp +80 -0
- data/ext/libsass/expand.cpp +430 -0
- data/ext/libsass/expand.hpp +77 -0
- data/ext/libsass/extconf.rb +6 -0
- data/ext/libsass/extend.cpp +1962 -0
- data/ext/libsass/extend.hpp +50 -0
- data/ext/libsass/file.cpp +291 -0
- data/ext/libsass/file.hpp +18 -0
- data/ext/libsass/functions.cpp +1565 -0
- data/ext/libsass/functions.hpp +187 -0
- data/ext/libsass/inspect.cpp +727 -0
- data/ext/libsass/inspect.hpp +108 -0
- data/ext/libsass/json.cpp +1411 -0
- data/ext/libsass/json.hpp +117 -0
- data/ext/libsass/kwd_arg_macros.hpp +23 -0
- data/ext/libsass/m4/.gitkeep +0 -0
- data/ext/libsass/mapping.hpp +17 -0
- data/ext/libsass/memory_manager.hpp +54 -0
- data/ext/libsass/node.cpp +251 -0
- data/ext/libsass/node.hpp +122 -0
- data/ext/libsass/operation.hpp +153 -0
- data/ext/libsass/output_compressed.cpp +401 -0
- data/ext/libsass/output_compressed.hpp +95 -0
- data/ext/libsass/output_nested.cpp +364 -0
- data/ext/libsass/output_nested.hpp +108 -0
- data/ext/libsass/parser.cpp +2016 -0
- data/ext/libsass/parser.hpp +264 -0
- data/ext/libsass/paths.hpp +69 -0
- data/ext/libsass/position.hpp +22 -0
- data/ext/libsass/posix/getopt.c +562 -0
- data/ext/libsass/posix/getopt.h +95 -0
- data/ext/libsass/prelexer.cpp +688 -0
- data/ext/libsass/prelexer.hpp +513 -0
- data/ext/libsass/remove_placeholders.cpp +59 -0
- data/ext/libsass/remove_placeholders.hpp +43 -0
- data/ext/libsass/res/resource.rc +35 -0
- data/ext/libsass/sass.cpp +33 -0
- data/ext/libsass/sass.h +60 -0
- data/ext/libsass/sass2scss.cpp +834 -0
- data/ext/libsass/sass2scss.h +110 -0
- data/ext/libsass/sass_context.cpp +709 -0
- data/ext/libsass/sass_context.h +120 -0
- data/ext/libsass/sass_functions.cpp +137 -0
- data/ext/libsass/sass_functions.h +90 -0
- data/ext/libsass/sass_interface.cpp +277 -0
- data/ext/libsass/sass_interface.h +97 -0
- data/ext/libsass/sass_util.cpp +136 -0
- data/ext/libsass/sass_util.hpp +259 -0
- data/ext/libsass/sass_values.cpp +337 -0
- data/ext/libsass/sass_values.h +124 -0
- data/ext/libsass/script/bootstrap +10 -0
- data/ext/libsass/script/branding +10 -0
- data/ext/libsass/script/ci-build-libsass +72 -0
- data/ext/libsass/script/ci-install-compiler +4 -0
- data/ext/libsass/script/ci-install-deps +19 -0
- data/ext/libsass/script/ci-report-coverage +25 -0
- data/ext/libsass/script/coveralls-debug +32 -0
- data/ext/libsass/script/spec +5 -0
- data/ext/libsass/script/tap-driver +652 -0
- data/ext/libsass/script/tap-runner +1 -0
- data/ext/libsass/source_map.cpp +133 -0
- data/ext/libsass/source_map.hpp +46 -0
- data/ext/libsass/subset_map.hpp +145 -0
- data/ext/libsass/support/libsass.pc.in +11 -0
- data/ext/libsass/test-driver +127 -0
- data/ext/libsass/test/test_node.cpp +98 -0
- data/ext/libsass/test/test_paths.cpp +29 -0
- data/ext/libsass/test/test_selector_difference.cpp +28 -0
- data/ext/libsass/test/test_specificity.cpp +28 -0
- data/ext/libsass/test/test_subset_map.cpp +472 -0
- data/ext/libsass/test/test_superselector.cpp +71 -0
- data/ext/libsass/test/test_unification.cpp +33 -0
- data/ext/libsass/to_c.cpp +61 -0
- data/ext/libsass/to_c.hpp +44 -0
- data/ext/libsass/to_string.cpp +29 -0
- data/ext/libsass/to_string.hpp +32 -0
- data/ext/libsass/token.hpp +32 -0
- data/ext/libsass/units.cpp +54 -0
- data/ext/libsass/units.hpp +10 -0
- data/ext/libsass/utf8.h +34 -0
- data/ext/libsass/utf8/checked.h +327 -0
- data/ext/libsass/utf8/core.h +329 -0
- data/ext/libsass/utf8/unchecked.h +228 -0
- data/ext/libsass/utf8_string.cpp +102 -0
- data/ext/libsass/utf8_string.hpp +36 -0
- data/ext/libsass/util.cpp +189 -0
- data/ext/libsass/util.hpp +26 -0
- data/ext/libsass/win/libsass.filters +291 -0
- data/ext/libsass/win/libsass.sln +28 -0
- data/ext/libsass/win/libsass.vcxproj +255 -0
- data/lib/sassc.rb +6 -0
- data/lib/sassc/engine.rb +13 -0
- data/lib/sassc/native.rb +44 -0
- data/lib/sassc/native/native_context_api.rb +140 -0
- data/lib/sassc/native/native_functions_api.rb +41 -0
- data/lib/sassc/native/sass_input_style.rb +11 -0
- data/lib/sassc/native/sass_output_style.rb +10 -0
- data/lib/sassc/native/sass_value.rb +95 -0
- data/lib/sassc/native/string_list.rb +8 -0
- data/lib/sassc/version.rb +3 -0
- data/sassc.gemspec +43 -0
- data/test/smoke_test.rb +171 -0
- data/test/test_helper.rb +4 -0
- metadata +281 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
module SassC
|
2
|
+
module Native
|
3
|
+
# Creators for sass function list and function descriptors
|
4
|
+
# ADDAPI Sass_C_Function_List ADDCALL sass_make_function_list (size_t length);
|
5
|
+
# ADDAPI Sass_C_Function_Callback ADDCALL sass_make_function (const char* signature, Sass_C_Function fn, void* cookie);
|
6
|
+
attach_function :sass_make_function_list, [:size_t], :sass_c_function_list_ptr
|
7
|
+
attach_function :sass_make_function, [:string, :sass_c_function, :pointer], :sass_c_function_callback_ptr
|
8
|
+
|
9
|
+
# Setters and getters for callbacks on function lists
|
10
|
+
# ADDAPI Sass_C_Function_Callback ADDCALL sass_function_get_list_entry(Sass_C_Function_List list, size_t pos);
|
11
|
+
# ADDAPI void ADDCALL sass_function_set_list_entry(Sass_C_Function_List list, size_t pos, Sass_C_Function_Callback cb);
|
12
|
+
attach_function :sass_function_get_list_entry, [:sass_c_function_list_ptr, :size_t], :sass_c_function_callback_ptr
|
13
|
+
attach_function :sass_function_set_list_entry, [:sass_c_function_list_ptr, :size_t, :sass_c_function_callback_ptr], :void
|
14
|
+
|
15
|
+
# ADDAPI union Sass_Value* ADDCALL sass_make_number (double val, const char* unit);
|
16
|
+
attach_function :sass_make_number, [:double, :string], :sass_value_ptr
|
17
|
+
attach_function :sass_make_string, [:string], :sass_value_ptr
|
18
|
+
|
19
|
+
|
20
|
+
# ADDAPI enum Sass_Tag ADDCALL sass_value_get_tag (const union Sass_Value* v);
|
21
|
+
attach_function :sass_value_get_tag, [:sass_value_ptr], SassTag
|
22
|
+
|
23
|
+
# ADDAPI const char* ADDCALL sass_string_get_value (const union Sass_Value* v);
|
24
|
+
attach_function :sass_string_get_value, [:sass_value_ptr], :string
|
25
|
+
|
26
|
+
|
27
|
+
# Getters for custom function descriptors
|
28
|
+
# ADDAPI const char* ADDCALL sass_function_get_signature (Sass_C_Function_Callback fn);
|
29
|
+
# ADDAPI Sass_C_Function ADDCALL sass_function_get_function (Sass_C_Function_Callback fn);
|
30
|
+
# ADDAPI void* ADDCALL sass_function_get_cookie (Sass_C_Function_Callback fn);
|
31
|
+
attach_function :sass_function_get_signature, [:sass_c_function_callback_ptr], :string
|
32
|
+
attach_function :sass_function_get_function, [:sass_c_function_callback_ptr], :sass_c_function
|
33
|
+
attach_function :sass_function_get_cookie, [:sass_c_function_callback_ptr], :pointer
|
34
|
+
|
35
|
+
|
36
|
+
#callback :sass_c_function, [SassValue.ptr, :pointer], SassValue.ptr
|
37
|
+
Callback = FFI::Function.new(:pointer, [:pointer, :pointer]) do |s_args, cookie|
|
38
|
+
SassC::Native.make_number(43, "px")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module SassC
|
2
|
+
module Native
|
3
|
+
class SassValue < FFI::Union; end
|
4
|
+
|
5
|
+
SassTag = enum(
|
6
|
+
:sass_boolean,
|
7
|
+
:sass_number,
|
8
|
+
:sass_color,
|
9
|
+
:sass_string,
|
10
|
+
:sass_list,
|
11
|
+
:sass_map,
|
12
|
+
:sass_null,
|
13
|
+
:sass_error,
|
14
|
+
:sass_warning
|
15
|
+
)
|
16
|
+
|
17
|
+
SassSeparator = enum(
|
18
|
+
:sass_comma,
|
19
|
+
:sass_space
|
20
|
+
)
|
21
|
+
|
22
|
+
class SassUnknown < FFI::Struct
|
23
|
+
layout :tag, SassTag
|
24
|
+
end
|
25
|
+
|
26
|
+
class SassBoolean < FFI::Struct
|
27
|
+
layout :tag, SassTag,
|
28
|
+
:value, :bool
|
29
|
+
end
|
30
|
+
|
31
|
+
class SassNumber < FFI::Struct
|
32
|
+
layout :tag, SassTag,
|
33
|
+
:value, :double,
|
34
|
+
:unit, :string
|
35
|
+
end
|
36
|
+
|
37
|
+
class SassColor < FFI::Struct
|
38
|
+
layout :tag, SassTag,
|
39
|
+
:r, :double,
|
40
|
+
:g, :double,
|
41
|
+
:b, :double,
|
42
|
+
:a, :double
|
43
|
+
end
|
44
|
+
|
45
|
+
class SassString < FFI::Struct
|
46
|
+
layout :tag, SassTag,
|
47
|
+
:value, :string
|
48
|
+
end
|
49
|
+
|
50
|
+
class SassList < FFI::Struct
|
51
|
+
layout :tag, SassTag,
|
52
|
+
:separator, SassSeparator,
|
53
|
+
:length, :size_t,
|
54
|
+
:values, :pointer
|
55
|
+
end
|
56
|
+
|
57
|
+
class SassMapPair < FFI::Struct
|
58
|
+
layout :key, SassValue.ptr,
|
59
|
+
:value, SassValue.ptr
|
60
|
+
end
|
61
|
+
|
62
|
+
class SassMap < FFI::Struct
|
63
|
+
layout :tag, SassTag,
|
64
|
+
:length, :size_t,
|
65
|
+
:pairs, SassMapPair.ptr
|
66
|
+
end
|
67
|
+
|
68
|
+
class SassNull < FFI::Struct
|
69
|
+
layout :tag, SassTag
|
70
|
+
end
|
71
|
+
|
72
|
+
class SassError < FFI::Struct
|
73
|
+
layout :tag, SassTag,
|
74
|
+
:messsage, :string
|
75
|
+
end
|
76
|
+
|
77
|
+
class SassWarning < FFI::Struct
|
78
|
+
layout :tag, SassTag,
|
79
|
+
:messsage, :string
|
80
|
+
end
|
81
|
+
|
82
|
+
class SassValue # < FFI::Union
|
83
|
+
layout :unknown, SassUnknown,
|
84
|
+
:boolean, SassBoolean,
|
85
|
+
:number, SassNumber,
|
86
|
+
:color, SassColor,
|
87
|
+
:string, SassString,
|
88
|
+
:list, SassList,
|
89
|
+
:map, SassMap,
|
90
|
+
:null, SassNull,
|
91
|
+
:error, SassError,
|
92
|
+
:warning, SassWarning
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
data/sassc.gemspec
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'sassc/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "sassc"
|
8
|
+
spec.version = SassC::VERSION
|
9
|
+
spec.authors = ["Ryan Boland"]
|
10
|
+
spec.email = ["bolandryanm@gmail.com"]
|
11
|
+
spec.summary = "Use Libsass with Ruby!"
|
12
|
+
spec.description = "Use Libsass with Ruby!"
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib", "ext"]
|
20
|
+
|
21
|
+
spec.extensions = ["Rakefile"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "minitest", "~> 5.5.1"
|
26
|
+
spec.add_development_dependency "minitest-around"
|
27
|
+
spec.add_development_dependency "test_construct"
|
28
|
+
|
29
|
+
spec.add_dependency "ffi", "~> 1.9.6"
|
30
|
+
|
31
|
+
gem_dir = File.expand_path(File.dirname(__FILE__)) + "/"
|
32
|
+
`git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
|
33
|
+
Dir.chdir(submodule_path) do
|
34
|
+
submodule_relative_path = submodule_path.sub gem_dir, ""
|
35
|
+
# issue git ls-files in submodule's directory and
|
36
|
+
# prepend the submodule path to create absolute file paths
|
37
|
+
`git ls-files`.split($\).each do |filename|
|
38
|
+
spec.files << "#{submodule_relative_path}/#{filename}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
data/test/smoke_test.rb
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
require_relative "test_helper"
|
2
|
+
require "sassc"
|
3
|
+
|
4
|
+
module SmokeTest
|
5
|
+
SAMPLE_SASS_STRING = "$size: 30px; .hi { width: $size; }"
|
6
|
+
SAMPLE_CSS_OUTPUT = ".hi {\n width: 30px; }\n"
|
7
|
+
BAD_SASS_STRING = "$size = 30px;"
|
8
|
+
|
9
|
+
class General < MiniTest::Test
|
10
|
+
def test_it_reports_the_libsass_version
|
11
|
+
assert_equal "3.1.0", SassC::Native.version
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class DataContext < MiniTest::Test
|
16
|
+
def teardown
|
17
|
+
SassC::Native.delete_data_context(@data_context)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_compile_status_is_zero_when_successful
|
21
|
+
@data_context = SassC::Native.make_data_context(SAMPLE_SASS_STRING)
|
22
|
+
context = SassC::Native.data_context_get_context(@data_context)
|
23
|
+
|
24
|
+
status = SassC::Native.compile_data_context(@data_context)
|
25
|
+
assert_equal 0, status
|
26
|
+
|
27
|
+
status = SassC::Native.context_get_error_status(context)
|
28
|
+
assert_equal 0, status
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_compiled_css_is_correct
|
32
|
+
@data_context = SassC::Native.make_data_context(SAMPLE_SASS_STRING)
|
33
|
+
context = SassC::Native.data_context_get_context(@data_context)
|
34
|
+
SassC::Native.compile_data_context(@data_context)
|
35
|
+
|
36
|
+
css = SassC::Native.context_get_output_string(context)
|
37
|
+
assert_equal SAMPLE_CSS_OUTPUT, css
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_compile_status_is_one_if_failed
|
41
|
+
@data_context = SassC::Native.make_data_context(BAD_SASS_STRING)
|
42
|
+
context = SassC::Native.data_context_get_context(@data_context)
|
43
|
+
|
44
|
+
status = SassC::Native.compile_data_context(@data_context)
|
45
|
+
refute_equal 0, status
|
46
|
+
|
47
|
+
status = SassC::Native.context_get_error_status(context)
|
48
|
+
refute_equal 0, status
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_failed_compile_gives_error_message
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_custom_function
|
55
|
+
data_context = SassC::Native.make_data_context("foo { margin: foo(); }")
|
56
|
+
context = SassC::Native.data_context_get_context(data_context)
|
57
|
+
options = SassC::Native.context_get_options(context)
|
58
|
+
|
59
|
+
random_thing = FFI::MemoryPointer.from_string("hi")
|
60
|
+
|
61
|
+
callback = SassC::Native.make_function(
|
62
|
+
"foo()",
|
63
|
+
SassC::Native::Callback,
|
64
|
+
random_thing
|
65
|
+
)
|
66
|
+
|
67
|
+
list = SassC::Native.make_function_list(1)
|
68
|
+
SassC::Native::function_set_list_entry(list, 0, callback);
|
69
|
+
SassC::Native::option_set_c_functions(options, list)
|
70
|
+
|
71
|
+
assert_equal SassC::Native.option_get_c_functions(options), list
|
72
|
+
|
73
|
+
first_list_entry = SassC::Native.function_get_list_entry(list, 0)
|
74
|
+
assert_equal SassC::Native.function_get_function(first_list_entry),
|
75
|
+
SassC::Native::Callback
|
76
|
+
assert_equal SassC::Native.function_get_signature(first_list_entry),
|
77
|
+
"foo()"
|
78
|
+
assert_equal SassC::Native.function_get_cookie(first_list_entry),
|
79
|
+
random_thing
|
80
|
+
|
81
|
+
#string = SassC::Native.make_string("hello")
|
82
|
+
string = SassC::Native.make_string("hello")
|
83
|
+
assert_equal :sass_string, SassC::Native.value_get_tag(string)
|
84
|
+
assert_equal "hello", SassC::Native.string_get_value(string)
|
85
|
+
|
86
|
+
SassC::Native.compile_data_context(data_context)
|
87
|
+
|
88
|
+
css = SassC::Native.context_get_output_string(context)
|
89
|
+
assert_equal "foo {\n margin: 43px; }\n", css
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class FileContext < MiniTest::Test
|
94
|
+
include TestConstruct::Helpers
|
95
|
+
|
96
|
+
def around
|
97
|
+
within_construct do |construct|
|
98
|
+
@construct = construct
|
99
|
+
yield
|
100
|
+
end
|
101
|
+
|
102
|
+
@construct = nil
|
103
|
+
end
|
104
|
+
|
105
|
+
def teardown
|
106
|
+
SassC::Native.delete_file_context(@file_context)
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_compile_status_is_zero_when_successful
|
110
|
+
@construct.file("style.scss", SAMPLE_SASS_STRING)
|
111
|
+
|
112
|
+
@file_context = SassC::Native.make_file_context("style.scss")
|
113
|
+
context = SassC::Native.file_context_get_context(@file_context)
|
114
|
+
|
115
|
+
status = SassC::Native.compile_file_context(@file_context)
|
116
|
+
assert_equal 0, status
|
117
|
+
|
118
|
+
status = SassC::Native.context_get_error_status(context)
|
119
|
+
assert_equal 0, status
|
120
|
+
end
|
121
|
+
|
122
|
+
def test_compiled_css_is_correct
|
123
|
+
@construct.file("style.scss", SAMPLE_SASS_STRING)
|
124
|
+
|
125
|
+
@file_context = SassC::Native.make_file_context("style.scss")
|
126
|
+
context = SassC::Native.file_context_get_context(@file_context)
|
127
|
+
SassC::Native.compile_file_context(@file_context)
|
128
|
+
|
129
|
+
css = SassC::Native.context_get_output_string(context)
|
130
|
+
assert_equal SAMPLE_CSS_OUTPUT, css
|
131
|
+
end
|
132
|
+
|
133
|
+
def test_invalid_file_name
|
134
|
+
@construct.file("style.scss", SAMPLE_SASS_STRING)
|
135
|
+
|
136
|
+
@file_context = SassC::Native.make_file_context("style.jajaja")
|
137
|
+
context = SassC::Native.file_context_get_context(@file_context)
|
138
|
+
status = SassC::Native.compile_file_context(@file_context)
|
139
|
+
|
140
|
+
refute_equal 0, status
|
141
|
+
|
142
|
+
error = SassC::Native.context_get_error_message(context)
|
143
|
+
|
144
|
+
assert_match "Error: File to read not found or unreadable: style.jajaja",
|
145
|
+
error
|
146
|
+
end
|
147
|
+
|
148
|
+
def test_file_import
|
149
|
+
@construct.file("not_included.scss", "$size: 30px;")
|
150
|
+
@construct.file("import_parent.scss", "$size: 30px;")
|
151
|
+
@construct.file("import.scss", "@import 'import_parent'; $size: 30px;")
|
152
|
+
@construct.file("styles.scss", "@import 'import.scss'; .hi { width: $size; }")
|
153
|
+
|
154
|
+
@file_context = SassC::Native.make_file_context("styles.scss")
|
155
|
+
context = SassC::Native.file_context_get_context(@file_context)
|
156
|
+
status = SassC::Native.compile_file_context(@file_context)
|
157
|
+
|
158
|
+
assert_equal 0, status
|
159
|
+
|
160
|
+
css = SassC::Native.context_get_output_string(context)
|
161
|
+
assert_equal SAMPLE_CSS_OUTPUT, css
|
162
|
+
|
163
|
+
included_files = SassC::Native.context_get_included_files(context)
|
164
|
+
included_files.sort!
|
165
|
+
|
166
|
+
assert_match /import.scss/, included_files[0]
|
167
|
+
assert_match /import_parent.scss/, included_files[1]
|
168
|
+
assert_match /styles.scss/, included_files[2]
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,281 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sassc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan Boland
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 5.5.1
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 5.5.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: minitest-around
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: test_construct
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: ffi
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 1.9.6
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.9.6
|
97
|
+
description: Use Libsass with Ruby!
|
98
|
+
email:
|
99
|
+
- bolandryanm@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions:
|
102
|
+
- Rakefile
|
103
|
+
extra_rdoc_files: []
|
104
|
+
files:
|
105
|
+
- ".gitignore"
|
106
|
+
- ".gitmodules"
|
107
|
+
- ".travis.yml"
|
108
|
+
- Gemfile
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.md
|
111
|
+
- Rakefile
|
112
|
+
- ext/libsass/.editorconfig
|
113
|
+
- ext/libsass/.gitattributes
|
114
|
+
- ext/libsass/.gitignore
|
115
|
+
- ext/libsass/.travis.yml
|
116
|
+
- ext/libsass/COPYING
|
117
|
+
- ext/libsass/INSTALL
|
118
|
+
- ext/libsass/LICENSE
|
119
|
+
- ext/libsass/Makefile
|
120
|
+
- ext/libsass/Makefile.am
|
121
|
+
- ext/libsass/Readme.md
|
122
|
+
- ext/libsass/appveyor.yml
|
123
|
+
- ext/libsass/ast.cpp
|
124
|
+
- ext/libsass/ast.hpp
|
125
|
+
- ext/libsass/ast_def_macros.hpp
|
126
|
+
- ext/libsass/ast_factory.hpp
|
127
|
+
- ext/libsass/ast_fwd_decl.hpp
|
128
|
+
- ext/libsass/b64/cencode.h
|
129
|
+
- ext/libsass/b64/encode.h
|
130
|
+
- ext/libsass/backtrace.hpp
|
131
|
+
- ext/libsass/base64vlq.cpp
|
132
|
+
- ext/libsass/base64vlq.hpp
|
133
|
+
- ext/libsass/bind.cpp
|
134
|
+
- ext/libsass/bind.hpp
|
135
|
+
- ext/libsass/cencode.c
|
136
|
+
- ext/libsass/color_names.hpp
|
137
|
+
- ext/libsass/configure.ac
|
138
|
+
- ext/libsass/constants.cpp
|
139
|
+
- ext/libsass/constants.hpp
|
140
|
+
- ext/libsass/context.cpp
|
141
|
+
- ext/libsass/context.hpp
|
142
|
+
- ext/libsass/contextualize.cpp
|
143
|
+
- ext/libsass/contextualize.hpp
|
144
|
+
- ext/libsass/copy_c_str.cpp
|
145
|
+
- ext/libsass/copy_c_str.hpp
|
146
|
+
- ext/libsass/debug.hpp
|
147
|
+
- ext/libsass/environment.hpp
|
148
|
+
- ext/libsass/error_handling.cpp
|
149
|
+
- ext/libsass/error_handling.hpp
|
150
|
+
- ext/libsass/eval.cpp
|
151
|
+
- ext/libsass/eval.hpp
|
152
|
+
- ext/libsass/expand.cpp
|
153
|
+
- ext/libsass/expand.hpp
|
154
|
+
- ext/libsass/extconf.rb
|
155
|
+
- ext/libsass/extend.cpp
|
156
|
+
- ext/libsass/extend.hpp
|
157
|
+
- ext/libsass/file.cpp
|
158
|
+
- ext/libsass/file.hpp
|
159
|
+
- ext/libsass/functions.cpp
|
160
|
+
- ext/libsass/functions.hpp
|
161
|
+
- ext/libsass/inspect.cpp
|
162
|
+
- ext/libsass/inspect.hpp
|
163
|
+
- ext/libsass/json.cpp
|
164
|
+
- ext/libsass/json.hpp
|
165
|
+
- ext/libsass/kwd_arg_macros.hpp
|
166
|
+
- ext/libsass/m4/.gitkeep
|
167
|
+
- ext/libsass/mapping.hpp
|
168
|
+
- ext/libsass/memory_manager.hpp
|
169
|
+
- ext/libsass/node.cpp
|
170
|
+
- ext/libsass/node.hpp
|
171
|
+
- ext/libsass/operation.hpp
|
172
|
+
- ext/libsass/output_compressed.cpp
|
173
|
+
- ext/libsass/output_compressed.hpp
|
174
|
+
- ext/libsass/output_nested.cpp
|
175
|
+
- ext/libsass/output_nested.hpp
|
176
|
+
- ext/libsass/parser.cpp
|
177
|
+
- ext/libsass/parser.hpp
|
178
|
+
- ext/libsass/paths.hpp
|
179
|
+
- ext/libsass/position.hpp
|
180
|
+
- ext/libsass/posix/getopt.c
|
181
|
+
- ext/libsass/posix/getopt.h
|
182
|
+
- ext/libsass/prelexer.cpp
|
183
|
+
- ext/libsass/prelexer.hpp
|
184
|
+
- ext/libsass/remove_placeholders.cpp
|
185
|
+
- ext/libsass/remove_placeholders.hpp
|
186
|
+
- ext/libsass/res/resource.rc
|
187
|
+
- ext/libsass/sass.cpp
|
188
|
+
- ext/libsass/sass.h
|
189
|
+
- ext/libsass/sass2scss.cpp
|
190
|
+
- ext/libsass/sass2scss.h
|
191
|
+
- ext/libsass/sass_context.cpp
|
192
|
+
- ext/libsass/sass_context.h
|
193
|
+
- ext/libsass/sass_functions.cpp
|
194
|
+
- ext/libsass/sass_functions.h
|
195
|
+
- ext/libsass/sass_interface.cpp
|
196
|
+
- ext/libsass/sass_interface.h
|
197
|
+
- ext/libsass/sass_util.cpp
|
198
|
+
- ext/libsass/sass_util.hpp
|
199
|
+
- ext/libsass/sass_values.cpp
|
200
|
+
- ext/libsass/sass_values.h
|
201
|
+
- ext/libsass/script/bootstrap
|
202
|
+
- ext/libsass/script/branding
|
203
|
+
- ext/libsass/script/ci-build-libsass
|
204
|
+
- ext/libsass/script/ci-install-compiler
|
205
|
+
- ext/libsass/script/ci-install-deps
|
206
|
+
- ext/libsass/script/ci-report-coverage
|
207
|
+
- ext/libsass/script/coveralls-debug
|
208
|
+
- ext/libsass/script/spec
|
209
|
+
- ext/libsass/script/tap-driver
|
210
|
+
- ext/libsass/script/tap-runner
|
211
|
+
- ext/libsass/source_map.cpp
|
212
|
+
- ext/libsass/source_map.hpp
|
213
|
+
- ext/libsass/subset_map.hpp
|
214
|
+
- ext/libsass/support/libsass.pc.in
|
215
|
+
- ext/libsass/test-driver
|
216
|
+
- ext/libsass/test/test_node.cpp
|
217
|
+
- ext/libsass/test/test_paths.cpp
|
218
|
+
- ext/libsass/test/test_selector_difference.cpp
|
219
|
+
- ext/libsass/test/test_specificity.cpp
|
220
|
+
- ext/libsass/test/test_subset_map.cpp
|
221
|
+
- ext/libsass/test/test_superselector.cpp
|
222
|
+
- ext/libsass/test/test_unification.cpp
|
223
|
+
- ext/libsass/to_c.cpp
|
224
|
+
- ext/libsass/to_c.hpp
|
225
|
+
- ext/libsass/to_string.cpp
|
226
|
+
- ext/libsass/to_string.hpp
|
227
|
+
- ext/libsass/token.hpp
|
228
|
+
- ext/libsass/units.cpp
|
229
|
+
- ext/libsass/units.hpp
|
230
|
+
- ext/libsass/utf8.h
|
231
|
+
- ext/libsass/utf8/checked.h
|
232
|
+
- ext/libsass/utf8/core.h
|
233
|
+
- ext/libsass/utf8/unchecked.h
|
234
|
+
- ext/libsass/utf8_string.cpp
|
235
|
+
- ext/libsass/utf8_string.hpp
|
236
|
+
- ext/libsass/util.cpp
|
237
|
+
- ext/libsass/util.hpp
|
238
|
+
- ext/libsass/win/libsass.filters
|
239
|
+
- ext/libsass/win/libsass.sln
|
240
|
+
- ext/libsass/win/libsass.vcxproj
|
241
|
+
- lib/sassc.rb
|
242
|
+
- lib/sassc/engine.rb
|
243
|
+
- lib/sassc/native.rb
|
244
|
+
- lib/sassc/native/native_context_api.rb
|
245
|
+
- lib/sassc/native/native_functions_api.rb
|
246
|
+
- lib/sassc/native/sass_input_style.rb
|
247
|
+
- lib/sassc/native/sass_output_style.rb
|
248
|
+
- lib/sassc/native/sass_value.rb
|
249
|
+
- lib/sassc/native/string_list.rb
|
250
|
+
- lib/sassc/version.rb
|
251
|
+
- sassc.gemspec
|
252
|
+
- test/smoke_test.rb
|
253
|
+
- test/test_helper.rb
|
254
|
+
homepage: ''
|
255
|
+
licenses:
|
256
|
+
- MIT
|
257
|
+
metadata: {}
|
258
|
+
post_install_message:
|
259
|
+
rdoc_options: []
|
260
|
+
require_paths:
|
261
|
+
- lib
|
262
|
+
- ext
|
263
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
264
|
+
requirements:
|
265
|
+
- - ">="
|
266
|
+
- !ruby/object:Gem::Version
|
267
|
+
version: '0'
|
268
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
|
+
requirements:
|
270
|
+
- - ">="
|
271
|
+
- !ruby/object:Gem::Version
|
272
|
+
version: '0'
|
273
|
+
requirements: []
|
274
|
+
rubyforge_project:
|
275
|
+
rubygems_version: 2.4.5
|
276
|
+
signing_key:
|
277
|
+
specification_version: 4
|
278
|
+
summary: Use Libsass with Ruby!
|
279
|
+
test_files:
|
280
|
+
- test/smoke_test.rb
|
281
|
+
- test/test_helper.rb
|