<commit_before>'use strict'

gulp          = require 'gulp'
$             = require('gulp-load-plugins')()
run           = require 'run-sequence'
fs            = require 'fs'
del           = require 'del'

packageJSON     = JSON.parse fs.readFileSync './package.json'

#-------------------------------------------------

src_files = [
  'src/angular-normalize-salesforce.coffee',
  'src/salesforce-standard-fields.coffee',
  'src/salesforce-standard-objects.coffee',
  'src/salesforce-sobjects.coffee',
  'src/normalize-salesforce.coffee'
]

gulp.task 'clean', (cb) ->
  del [
    'dist'
  ], cb

gulp.task 'coffee', ->
  gulp.src src_files
    .pipe $.sourcemaps.init()
      .pipe $.coffee({bare: true}).on('error', $.util.log)
      .pipe $.ngAnnotate()
      .pipe $.concat "#{packageJSON.name}.js"
    .pipe $.sourcemaps.write('.')
    .pipe gulp.dest 'dist'

gulp.task 'coffee:min', ->
  gulp.src src_files
    .pipe $.sourcemaps.init()
      .pipe $.coffee({bare: true}).on('error', $.util.log)
      .pipe $.ngAnnotate()
      .pipe $.uglify({mangle: false, preserveComments: 'some'})
      .pipe $.concat "#{packageJSON.name}.min.js"
    .pipe $.sourcemaps.write('.')
    .pipe gulp.dest 'dist'

gulp.task 'karma', ->
  gulp.src './idontexist'
    .pipe $.karma(
      configFile: 'karma.conf.coffee'
      action: 'run'
    ).on 'error', (err) ->
      throw err

gulp.task 'lint', ->
  gulp.src src_files.concat([
    'test/*.coffee'
  ])
    .pipe $.coffeelint()
    .pipe $.coffeelint.reporter()

gulp.task 'version', ->
  $.util.log $.util.colors.yellow(
    "Angular Normalize Salesforce Version: #{packageJSON.version}"
  )

inc = (importance) ->
  gulp.src(['./package.json', './bower.json'])
    # bump the version number in those files
    .pipe($.bump({type: importance}))
    # save it back to filesystem
    .pipe(gulp.dest('./'))
    # commit the changed version number
    .pipe($.git.commit('bumps package version'))

    # read only one file to get the version number
    .pipe($.filter('package.json'))
    # **tag it in the repository**
    .pipe($.tagVersion())
    # push the tags to master
    .pipe($.git.push('origin', 'master', { args: '--tags' }))

gulp.task 'patch', ->
  inc('patch')

gulp.task 'minor', ->
  inc('minor')

gulp.task 'major', ->
  inc('major')

#-------------------------------------------------

gulp.task 'test', ->
  run 'version',
    ['karma', 'lint']

gulp.task 'build', ->
  run 'version',
    'clean', 'coffee', 'coffee:min'

gulp.task 'default', ->
  run 'version',
    ['karma', 'lint'],
    'clean', 'coffee', 'coffee:min'
<commit_msg>Remove prefix from git tag<commit_after>'use strict'

gulp          = require 'gulp'
$             = require('gulp-load-plugins')()
run           = require 'run-sequence'
fs            = require 'fs'
del           = require 'del'

packageJSON     = JSON.parse fs.readFileSync './package.json'

#-------------------------------------------------

src_files = [
  'src/angular-normalize-salesforce.coffee',
  'src/salesforce-standard-fields.coffee',
  'src/salesforce-standard-objects.coffee',
  'src/salesforce-sobjects.coffee',
  'src/normalize-salesforce.coffee'
]

gulp.task 'clean', (cb) ->
  del [
    'dist'
  ], cb

gulp.task 'coffee', ->
  gulp.src src_files
    .pipe $.sourcemaps.init()
      .pipe $.coffee({bare: true}).on('error', $.util.log)
      .pipe $.ngAnnotate()
      .pipe $.concat "#{packageJSON.name}.js"
    .pipe $.sourcemaps.write('.')
    .pipe gulp.dest 'dist'

gulp.task 'coffee:min', ->
  gulp.src src_files
    .pipe $.sourcemaps.init()
      .pipe $.coffee({bare: true}).on('error', $.util.log)
      .pipe $.ngAnnotate()
      .pipe $.uglify({mangle: false, preserveComments: 'some'})
      .pipe $.concat "#{packageJSON.name}.min.js"
    .pipe $.sourcemaps.write('.')
    .pipe gulp.dest 'dist'

gulp.task 'karma', ->
  gulp.src './idontexist'
    .pipe $.karma(
      configFile: 'karma.conf.coffee'
      action: 'run'
    ).on 'error', (err) ->
      throw err

gulp.task 'lint', ->
  gulp.src src_files.concat([
    'test/*.coffee'
  ])
    .pipe $.coffeelint()
    .pipe $.coffeelint.reporter()

gulp.task 'version', ->
  $.util.log $.util.colors.yellow(
    "Angular Normalize Salesforce Version: #{packageJSON.version}"
  )

inc = (importance) ->
  gulp.src(['./package.json', './bower.json'])
    # bump the version number in those files
    .pipe($.bump({type: importance}))
    # save it back to filesystem
    .pipe(gulp.dest('./'))
    # commit the changed version number
    .pipe($.git.commit('bumps package version'))

    # read only one file to get the version number
    .pipe($.filter('package.json'))
    # **tag it in the repository**
    .pipe($.tagVersion({prefix: ''}))
    # push the tags to master
    .pipe($.git.push('origin', 'master', { args: '--tags' }))

gulp.task 'patch', ->
  inc('patch')

gulp.task 'minor', ->
  inc('minor')

gulp.task 'major', ->
  inc('major')

#-------------------------------------------------

gulp.task 'test', ->
  run 'version',
    ['karma', 'lint']

gulp.task 'build', ->
  run 'version',
    'clean', 'coffee', 'coffee:min'

gulp.task 'default', ->
  run 'version',
    ['karma', 'lint'],
    'clean', 'coffee', 'coffee:min'

{'fraction_non_alphanumeric': 0.22496649435190502, 'fraction_numerical': 0.0, 'mean_word_length': 2.3878080415045395, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 31, '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': '2172630', 'n_tokens_mistral': 1865, 'n_tokens_neox': 1811, 'n_words': 388}