<commit_before>var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var tap = require('gulp-tap');
var argv = require('yargs').argv;

var paths = {
  css: "app/stylesheets/compiled/",
  sass: "app/stylesheets/scss/",
  bower: "app/bower_components/"
}

var bases = {
  app: "app/"
}

gulp.task('default', function() {
  
})

gulp.task('watch', function() {
  gulp.watch(paths.scss + '*.scss', ['sass']);
})

gulp.task('sass', function() {
  gulp.src(paths.sass + 'app.scss')
    .pipe(sass())
    .pipe(gulp.dest(paths.css))
})


gulp.task('rename-app', function() {
  if ( argv.old && argv.new ) {
    console.log(argv.old, argv.new)
    var regexps = [
      new RegExp("(module\\(\\s*)" + argv.old + "((?:\\..+)?\\s*\\))", "g"),
      new RegExp("(" + "describe\\(" + "\\s*" + ")" + argv.old + "(" + "(?:\\..+)?" + "\\s*" + "\\)" + ")", "g"),
      new RegExp("(" + "ng\\-app\\=" + "(?:\\'|\\\")" + "\\s*" + ")" + argv.old + "(" + "\\s+" + "(?:\\'|\\\")" + ")", "g")
    ]
    
    var replacement = "$1" + argv.new + "$2";
    
    gulp.src([
      bases.app + '**',
      "!" + paths.bower_components
    ], {base: './'} )
      .pipe( replace( regexps[0], replacement) )
      .pipe( tap( function( file ) {
        console.log( file.path );
      } ) )
      .pipe( replace( regexps[1], replacement) )
      .pipe( replace( regexps[2], replacement) )
      .pipe( gulp.dest('./'))
  }
})<commit_msg>rename mostly working... one last case to handle<commit_after>var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var tap = require('gulp-tap');
var argv = require('yargs').argv;

var paths = {
  css: "app/stylesheets/compiled/",
  sass: "app/stylesheets/scss/",
  bower: "app/bower_components/"
}

var bases = {
  app: "app/"
}

gulp.task('default', function() {
  
})

gulp.task('watch', function() {
  gulp.watch(paths.scss + '*.scss', ['sass']);
})

gulp.task('sass', function() {
  gulp.src(paths.sass + 'app.scss')
    .pipe(sass())
    .pipe(gulp.dest(paths.css))
})


gulp.task('rename-app', function() {
  //regexp pieces to make the semantics a little more clear
  var rquot         =   "(?:\\'|\\\")";
  var roptSpaces    =   "\\s*";
  var rstartCap     =   "(";
  var rstopCap      =   ")";
  var roptExtension =   "(?:\\.\\S+)?"
  
  if ( argv.old && argv.new ) {
    console.log(argv.old, argv.new)
    var regexps = [
      new RegExp(rstartCap + "module\\(" + roptSpaces + rquot + roptSpaces + rstopCap + argv.old + rstartCap + roptExtension + roptSpaces + rquot + rstopCap, "g"),
      new RegExp(rstartCap + "describe\\(" + roptSpaces + rquot + roptSpaces + rstopCap + argv.old + rstartCap + roptExtension + roptSpaces + "(?:.*\s?)?" + rquot + rstopCap, "g"),
      new RegExp(rstartCap + "ng\\-app\\=" + rquot + roptSpaces + rstopCap + argv.old + rstartCap + roptSpaces + rquot + rstopCap, "g"),
      new RegExp(rstartCap + "module" + ".*" + "\\[" + ".*" + rquot + rstopCap + argv.old + rstartCap + roptExtension + roptSpaces + rquot + rstopCap, "gm")
    ]
    
    var replacement = "$1" + argv.new + "$2";
    
    gulp.src([
      bases.app + '**',
      "!" + paths.bower_components
    ], {base: './'} )
      .pipe( replace( regexps[0], replacement) )
      .pipe( replace( regexps[1], replacement) )
      .pipe( replace( regexps[2], replacement) )
      .pipe( replace( regexps[3], replacement) )
      .pipe( gulp.dest('./'))
  }
})
{'fraction_non_alphanumeric': 0.23650014438348252, 'fraction_numerical': 0.0031764366156511693, 'mean_word_length': 2.728740581270183, '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': '6662773', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1320, 'n_words': 255}