Sha256: a8f9bcf865b544e465d95f07721c0ed05374089f89eba7b5403c75a273c73b05

Contents?: true

Size: 536 Bytes

Versions: 9

Compression:

Stored size: 536 Bytes

Contents

module SCSSBeautifier
  class CLI
    DEFAULT = File.realpath(File.join(File.dirname(__FILE__), "..", "..", "data", "default_config.yml")).freeze
    # Takes an array of arguments
    # Returns exit code
    def run(args)
      contents = File.read(ARGV.first)
      engine = Sass::Engine.new(contents, cache: false, syntax: :scss)

      tree = engine.to_tree
      Config.new(DEFAULT).formatters.each do |formatter|
        formatter.visit(tree)
      end

      puts SCSSBeautifier::Convert.visit(tree, {}, :scss)

    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
scss_beautifier-0.1.8 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.7 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.6 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.5 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.4 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.3 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.2 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.1 lib/scss_beautifier/cli.rb
scss_beautifier-0.1.0 lib/scss_beautifier/cli.rb