<commit_before>/* global require, module */
'use strict';

var mergeTrees  = require('broccoli-merge-trees');
var compileCompass = require('broccoli-compass');
var merge = require('lodash-node/modern/objects/merge');

function CompassCompilerPlugin(app) {
  this.name    = 'ember-cli-compass-compiler';
  this.app     = app;
  this.appName = app.name;
  this.ext     = 'scss';
}

CompassCompilerPlugin.prototype.toTree = function(tree, inputPath, outputPath) {
  // broccoli-compass doesn't like leading slashes
  if (inputPath[0] === '/') { inputPath = inputPath.slice(1); }
  if (outputPath[0] === '/') { outputPath = outputPath.slice(1); }

  var options  = this.app.options.compassOptions || {};
  var mainFile = options.mainFile || (this.appName + '.' + this.ext);

  var defaultOptions = {
    relativeAssets: true,
    sassDir: inputPath,
    cssDir: outputPath,
    outputStyle: 'compressed',
    imagesDir: 'images',
    fontsDir: 'fonts',
    compassCommand: 'compass'
  };

  var compassOptions = merge(defaultOptions, options);
  if(compassOptions.mainFile !== undefined) {
    delete compassOptions.mainFile;
  }

  tree = mergeTrees([tree, 'public'], {
    description: 'TreeMerger (stylesAndVendorAndPublic)'
  });

  return compileCompass(tree, inputPath + '/' + mainFile, compassOptions);
};

function EmberCLICompassCompiler(project) {
  this.project = project;
  this.name    = 'Ember CLI Compass Compiler';
}

EmberCLICompassCompiler.prototype.treeFor = function treeFor() {

};

EmberCLICompassCompiler.prototype.included = function included(app) {
  this.app     = app;
  var registry = this.app.registry;
  var plugin   = new CompassCompilerPlugin(app);
  registry.add('css', plugin);
};

module.exports = EmberCLICompassCompiler;
<commit_msg>Pass files to broccoli-compass inside options<commit_after>/* global require, module */
'use strict';

var mergeTrees  = require('broccoli-merge-trees');
var compileCompass = require('broccoli-compass');
var merge = require('lodash-node/modern/objects/merge');

function CompassCompilerPlugin(app) {
  this.name    = 'ember-cli-compass-compiler';
  this.app     = app;
  this.appName = app.name;
  this.ext     = 'scss';
}

CompassCompilerPlugin.prototype.toTree = function(tree, inputPath, outputPath) {
  // broccoli-compass doesn't like leading slashes
  if (inputPath[0] === '/') { inputPath = inputPath.slice(1); }
  if (outputPath[0] === '/') { outputPath = outputPath.slice(1); }

  var options  = this.app.options.compassOptions || {};
  var mainFile = options.mainFile || (this.appName + '.' + this.ext);
  var files    = [inputPath + '/' + mainFile];

  var defaultOptions = {
    files: files,
    relativeAssets: true,
    sassDir: inputPath,
    cssDir: outputPath,
    outputStyle: 'compressed',
    imagesDir: 'images',
    fontsDir: 'fonts',
    compassCommand: 'compass'
  };

  var compassOptions = merge(defaultOptions, options);
  if(compassOptions.mainFile !== undefined) {
    delete compassOptions.mainFile;
  }

  tree = mergeTrees([tree, 'public'], {
    description: 'TreeMerger (stylesAndVendorAndPublic)'
  });

  return compileCompass(tree, compassOptions);
};

function EmberCLICompassCompiler(project) {
  this.project = project;
  this.name    = 'Ember CLI Compass Compiler';
}

EmberCLICompassCompiler.prototype.treeFor = function treeFor() {

};

EmberCLICompassCompiler.prototype.included = function included(app) {
  this.app     = app;
  var registry = this.app.registry;
  var plugin   = new CompassCompilerPlugin(app);
  registry.add('css', plugin);
};

module.exports = EmberCLICompassCompiler;

{'fraction_non_alphanumeric': 0.13885031935573452, 'fraction_numerical': 0.0022216051096917524, 'mean_word_length': 4.1976911976911975, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1280919', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1133, 'n_words': 235}