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

allow passing functions directly #162

Merged
merged 1 commit into from Mar 3, 2020
Merged

Conversation

ahorek
Copy link

@ahorek ahorek commented Oct 2, 2019

my intention is to fix thread safety problems #133 and rails/sprockets#581
and eventually remove
https://github.com/rails/sprockets/blob/0cb3314368f9f9e84343ebedcc09c7137e920bc4/lib/sprockets/utils.rb#L126

sassc doesn't allow you to use different functions for different contexts easily

you can customize functions by patching Sassc::Script::Functions, but there's a race condition if you do this at runtime

this patch will allow you to pass custom functions like this

module MyModule
  def asset_path(path, _options = {})
  end
end

SassC::Engine.new(sass, style: :compressed).render # default Sassc::Script::Functions
SassC::Engine.new(sass, style: :compressed, functions: MyModule).render # custom

what do you think?

@diabolo
Copy link

diabolo commented Mar 31, 2020

Any chance for this to be released?

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request May 17, 2020
Update to ruby-sassc to 2.3.0.


- **2.3.0**
  - [Fix rake gem:native task](sass/sassc-ruby#196)
  - [disable lto flag for darwin + nix](sass/sassc-ruby#166)
  - [Sort input file list](sass/sassc-ruby#178)
  - [Set appropriate encoding for source_map](sass/sassc-ruby#152)
  - [allow passing functions directly](sass/sassc-ruby#162)
  - [always dispose data context](sass/sassc-ruby#161)
  - [Update libsass to 3.6.3](sass/sassc-ruby#164)
  - [Restore strip symbols](sass/sassc-ruby#184)
  - [Default --march-tune-native to false](sass/sassc-ruby#158)
  - [Fix compile issue on Mac OS X](sass/sassc-ruby#174)
  - [Test on TruffleRuby in TravisCI](sass/sassc-ruby#171)
  - [Use RbConfig::MAKEFILE_CONFIG['DLEXT'] instead of hardcoding extensions](sass/sassc-ruby#173)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants