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

Wrap SassC/Sass gems #108

Merged
merged 6 commits into from Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/hanami/assets/compilers/sass.rb
Expand Up @@ -16,6 +16,13 @@ def self.eligible?(name)
name.to_s =~ EXTENSIONS
end

# @since 1.3.3
# @api private
def initialize(*)
super
require 'sassc'
end

private

# @since 0.3.0
Expand All @@ -33,6 +40,8 @@ def renderer
# @api private
def dependencies
renderer.dependencies.map(&:filename)
rescue source::NotRenderedError
[]
end

# @since 1.3.2
Expand Down
4 changes: 2 additions & 2 deletions lib/hanami/assets/compressors/sass_stylesheet.rb
@@ -1,5 +1,4 @@
require 'hanami/assets/compressors/stylesheet'
require 'sassc'

module Hanami
module Assets
Expand All @@ -17,7 +16,8 @@ class SassStylesheet < Stylesheet
# @since 0.1.0
# @api private
def initialize
@compressor = SassC::Engine
require 'sassc'
@compressor = ::SassC::Engine
end

# @since 0.1.0
Expand Down