Sass-compiler
Inheritance: IDisposable
        /// <summary>
        /// Translates a code of assets written on Sass or SCSS to CSS-code
        /// </summary>
        /// <param name="assets">Set of assets with code written on Sass or SCSS</param>
        /// <returns>Set of assets with translated code</returns>
        public override IList<IAsset> Translate(IList<IAsset> assets)
        {
            if (assets == null)
            {
                throw new ArgumentException(CoreStrings.Common_ValueIsEmpty, "assets");
            }

            if (assets.Count == 0)
            {
                return assets;
            }

            var assetsToProcessing = assets.Where(a => a.AssetTypeCode == Constants.AssetTypeCode.Sass
                || a.AssetTypeCode == Constants.AssetTypeCode.Scss).ToList();
            if (assetsToProcessing.Count == 0)
            {
                return assets;
            }

            lock (_translationSynchronizer)
            {
                bool enableNativeMinification = NativeMinificationEnabled;

                using (var sassCompiler = new SassCompiler(_fileManager))
                {
                    foreach (var asset in assetsToProcessing)
                    {
                        InnerTranslate(asset, sassCompiler, enableNativeMinification);
                    }
                }
            }

            return assets;
        }
        private void InnerTranslate(IAsset asset, SassCompiler sassCompiler, bool enableNativeMinification)
        {
            string assetTypeName = (asset.AssetTypeCode == Constants.AssetTypeCode.Sass) ? "Sass" : "SCSS";
            string newContent;
            string assetUrl = asset.Url;
            IList<string> dependencies;
            CompilationOptions options = CreateCompilationOptions(asset.AssetTypeCode, enableNativeMinification);

            _fileManager.CurrentDirectoryName = UrlHelpers.GetDirectoryName(assetUrl);

            try
            {
                CompilationResult result = sassCompiler.Compile(asset.Content, assetUrl, options: options);
                newContent = result.CompiledContent;
                dependencies = result.IncludedFilePaths;
            }
            catch (FileNotFoundException)
            {
                throw;
            }
            catch (SassСompilationException e)
            {
                throw new AssetTranslationException(
                    string.Format(CoreStrings.Translators_TranslationSyntaxError,
                        assetTypeName, OUTPUT_CODE_TYPE, assetUrl, SassErrorHelpers.Format(e)));
            }
            catch (Exception e)
            {
                throw new AssetTranslationException(
                    string.Format(CoreStrings.Translators_TranslationFailed,
                        assetTypeName, OUTPUT_CODE_TYPE, assetUrl, e.Message), e);
            }
            finally
            {
                _fileManager.CurrentDirectoryName = null;
            }

            asset.Content = newContent;
            asset.Minified = enableNativeMinification;
            asset.RelativePathsResolved = false;
            asset.VirtualPathDependencies = dependencies;
        }
        /// <summary>
        /// Translates a code of asset written on Sass or SCSS to CSS-code
        /// </summary>
        /// <param name="asset">Asset with code written on Sass or SCSS</param>
        /// <returns>Asset with translated code</returns>
        public override IAsset Translate(IAsset asset)
        {
            if (asset == null)
            {
                throw new ArgumentException(Strings.Common_ValueIsEmpty, "asset");
            }

            lock (_translationSynchronizer)
            {
                bool enableNativeMinification = NativeMinificationEnabled;

                using (var sassCompiler = new SassCompiler(_fileManager))
                {
                    InnerTranslate(asset, sassCompiler, enableNativeMinification);
                }
            }

            return asset;
        }