Skip to content

Commit

Permalink
Make Sass#info more informative
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Dec 30, 2023
1 parent 4f9b264 commit d6ed0d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/sass/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def compile_string(source,
# @return [String] Information about the Sass implementation.
# @see https://sass-lang.com/documentation/js-api/variables/info/
def info
@info ||= Host.new(@dispatcher).version_request
@info ||= <<~INFO.freeze
sass-embedded\t#{Embedded::VERSION}\t(Embedded Host)\t[Ruby]
#{Host.new(@dispatcher).version_request}
INFO
end

def close
Expand Down
7 changes: 6 additions & 1 deletion lib/sass/compiler/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ def version_request
))
end

"sass-embedded\t#{version_response.implementation_version}"
info = "#{version_response.implementation_name}\t#{version_response.implementation_version}\t(Sass Compiler)"
case version_response.implementation_name
when /\bdart\b/i
info << "\t[Dart]"
end
info
end

def compile_response(message)
Expand Down

0 comments on commit d6ed0d9

Please sign in to comment.