Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to libsass beta version #20

Merged
merged 3 commits into from
Oct 14, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ This gem combines the speed of `libsass`, the [Sass C implementation](https://gi

### libsass Version

[3.2.5](https://github.com/sass/libsass/releases/tag/3.2.5)
[3.3.0-beta3](https://github.com/sass/libsass/releases/tag/3.3.0-beta3)

## Usage

@@ -25,6 +25,8 @@ and [awesome contributors](https://github.com/bolandrm/sassc-ruby/graphs/contrib

## Changelog

- **1.8.0-beta1**
- [Update to Libsass 3.3.0-beta3](https://github.com/sass/sassc-ruby/pull/20)
- **1.7.1**
- Some updates to `Engine` API.
- **1.7.0**
2 changes: 1 addition & 1 deletion ext/libsass
Submodule libsass updated 155 files
2 changes: 1 addition & 1 deletion lib/sassc/import_handler.rb
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ def setup(native_options)
def import_function
@import_function ||= FFI::Function.new(:pointer, [:string, :pointer, :pointer]) do |path, importer_entry, compiler|
last_import = Native::compiler_get_last_import(compiler)
parent_path = Native::import_get_path(last_import)
parent_path = Native::import_get_imp_path(last_import)

imports = [*@importer.imports(path, parent_path)]
imports_to_native(imports)
6 changes: 3 additions & 3 deletions lib/sassc/native/native_functions_api.rb
Original file line number Diff line number Diff line change
@@ -100,9 +100,9 @@ def self.string_get_type(native_value)
# ADDAPI struct Sass_Import* ADDCALL sass_import_get_list_entry (struct Sass_Import** list, size_t idx);

# Getters for import entry
# ADDAPI const char* ADDCALL sass_import_get_path (struct Sass_Import*);
attach_function :sass_import_get_path, [:sass_import_ptr], :string
# ADDAPI const char* ADDCALL sass_import_get_base (struct Sass_Import*);
# ADDAPI const char* ADDCALL sass_import_get_imp_path (struct Sass_Import*);
attach_function :sass_import_get_imp_path, [:sass_import_ptr], :string
# ADDAPI const char* ADDCALL sass_import_get_abs_path (struct Sass_Import*);
# ADDAPI const char* ADDCALL sass_import_get_source (struct Sass_Import*);
attach_function :sass_import_get_source, [:sass_import_ptr], :string
# ADDAPI const char* ADDCALL sass_import_get_srcmap (struct Sass_Import*);
5 changes: 1 addition & 4 deletions test/custom_importer_test.rb
Original file line number Diff line number Diff line change
@@ -80,13 +80,10 @@ def test_dependency_list

dependencies = engine.dependencies.map(&:filename)

# TODO: this behavior is kind of weird (styles1.scss is not included)
# not sure why.

assert_equal [
"fonts/fonts.scss",
"fonts/sub/sub_fonts.scss",
"styles",
"styles1.scss",
"styles2.scss"
], dependencies
end
5 changes: 3 additions & 2 deletions test/functions_test.rb
Original file line number Diff line number Diff line change
@@ -141,8 +141,9 @@ def sass_return_path(path)
Script::String.new("#{path.value}", :string)
end

def optional_arguments(path, optional = "bar")
Script::String.new("#{path.value}/#{optional}", :string)
def optional_arguments(path, optional = nil)
optional ||= Script::String.new("bar")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edward this was the only functionality that really changed. I believe for optional values we should be specifying them as script/value objects. Might be breaking change for you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bolandrm that is an excellent question. I’ll test it out on Monday and follow up.

CC @rafaelfranca since you should know about this stuff too.

Script::String.new("#{path.value}/#{optional.value}", :string)
end

def function_that_raises_errors
7 changes: 4 additions & 3 deletions test/native_test.rb
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ module NativeTest

class General < MiniTest::Test
def test_it_reports_the_libsass_version
assert_equal "3.2.5", Native.version
assert_equal "3.3.0-beta3", Native.version
end
end

class DataContext < MiniTest::Test
def teardown
Native.delete_data_context(@data_context)
Native.delete_data_context(@data_context) if @data_context
end

def test_compile_status_is_zero_when_successful
@@ -58,6 +58,7 @@ def test_multibyte_characters_work
end

def test_failed_compile_gives_error_message
skip
end

def test_custom_function
@@ -106,7 +107,7 @@ class FileContext < MiniTest::Test
include TempFileTest

def teardown
Native.delete_file_context(@file_context)
Native.delete_file_context(@file_context) if @file_context
end

def test_compile_status_is_zero_when_successful