Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Ruby Host Implementation #42

Closed
ntkme opened this issue May 24, 2021 · 4 comments
Closed

Ruby Host Implementation #42

ntkme opened this issue May 24, 2021 · 4 comments

Comments

@ntkme
Copy link
Contributor

ntkme commented May 24, 2021

Just want to share that I created a host implementation for ruby: https://github.com/ntkme/embedded-host-ruby

It can be installed with:

gem install sass-embedded

Unlike the scssc-ruby, the API is made to be close to the JavaScript API, except that for options it uses symbol in snake case instead of string in camel case. E.g. :indented_syntax instead of indentedSyntax.

require "sass"

Sass.render(file: "style.scss")

Example output:

irb(main):001:0> require "sass"
=> true
irb(main):002:0> 
irb(main):003:2* Sass.render(
irb(main):004:2*   data: "h1 { color: black; }",
irb(main):005:2*   indented_syntax: false
irb(main):006:0> )
=> {:css=>"h1 {\n  color: black;\n}", :map=>"", :stats=>{:entry=>"data", :start=>1621839779808, :end=>1621839779826, :duration=>18}}
@Awjin
Copy link

Awjin commented May 24, 2021

Thanks, it's exciting to see a ruby implementation!

@Awjin Awjin closed this as completed May 24, 2021
@nex3
Copy link
Contributor

nex3 commented May 24, 2021

Heads up @ntkme, there are some breaking changes coming to the protocol soon—I'm planning to fix it to follow the protobuf style guide, but that will involve renaming some fields. Sorry for the churn!

I've filed sass/sass-site#547 to track listing this on the website once we have a stable release of the embedded protocol.

@ntkme
Copy link
Contributor Author

ntkme commented May 24, 2021

@nex3 Thanks for the heads up.

For the renaming change, do you mean this commit? sass/embedded-protocol@10eb6f4
If that's the case, I already got it covered.

I'm watching embedded-protocol and I will update if there is any further changes. So no worries.

@nex3
Copy link
Contributor

nex3 commented May 25, 2021

Yep, exactly!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants