Sha256: ee92de919c7455feaa5845c5042a82345812798a3ec4d626df304e30de58a16c
Contents?: true
Size: 599 Bytes
Versions: 1
Compression:
Stored size: 599 Bytes
Contents
require "sinatra/base" require "scss_beautifier" class ScssBeautifierApp < Sinatra::Base get "/" do redirect '/index.html' end post "/beautify" do engine = Sass::Engine.new(request.body.read.to_s, cache: false, syntax: :scss) begin tree = engine.to_tree rescue Sass::SyntaxError => e return e.message end config = SCSSBeautifier::Config.new(SCSSBeautifier::CLI::DEFAULT) config.formatters.each do |formatter| formatter.send(:visit, tree) end output = SCSSBeautifier::Convert.visit(tree, {indent: config.options}, :scss) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
scss_beautifier-0.1.19 | web/app.rb |