<commit_before>#!/usr/bin/env node

/**
 * Created by vitalik on 16-10-15.
 */

var exec = require('child_process').execSync,
    metaMarked =    require("meta-marked"),
    fs =            require("fs-extra"),
    yamljs =        require("yamljs"),
    fswf =          require("safe-write-file");

var firebase = require("firebase"),
    async = require("async");

firebase.initializeApp({
  databaseURL: "https://blistering-inferno-8720.firebaseio.com",
  serviceAccount: "deploy-creds.json",
  databaseAuthVariableOverride: {
    uid: "deploy"
  }
});

var db = firebase.database(),
    firebaseDeploymentTasks = [];

var API_HOST = "http://com.cryart.sabbathschool.s3-website-us-west-2.amazonaws.com/api/",
    API_VERSION = "v1",
    SOURCE_DIR = "src/",
    SOURCE_INFO_FILE = "info.yml",
    SOURCE_COVER_FILE = "cover.png",
    SOURCE_EXTENSION = "md",
    DIST_DIR = "dist/api/" + API_VERSION + "/",
    FIREBASE_DATABASE_LANGUAGES = "languages",
    FIREBASE_DATABASE_QUARTERLIES = "quarterlies",
    FIREBASE_DATABASE_QUARTERLY_INFO = "quarterly-info",
    FIREBASE_DATABASE_LESSONS = "lessons",
    FIREBASE_DATABASE_LESSON_INFO = "lesson-info",
    FIREBASE_DATABASE_DAYS = "days",
    FIREBASE_DATABASE_READ = "reads";


var lastModified = process.argv.slice(2);

var changeCheck = function(path){
  if (!lastModified.length>0) return false;
  return exec('git log --since="'+lastModified[0]+'" '+path).toString().length>0;
};

var create_languages_api = function(){
  /**
   * Creating languages API
   *
   * /api/v1/languages
   */
  var languages = [],
      _languages = fs.readdirSync(SOURCE_DIR);

  for (var i = 0; i < _languages.length; i++){
    if (!fs.lstatSync(SOURCE_DIR + _languages[i]).isDirectory()) continue;
    languages.push(yamljs.load(SOURCE_DIR + "/" + _languages[i] + "/" + SOURCE_INFO_FILE));
  }

  firebaseDeploymentTasks.push(function(cb){<commit_msg>Testing<commit_after>#!/usr/bin/env node

/**
 * Created by vitalik on 16-10-15.
 */

var exec = require('child_process').execSync,
    metaMarked =    require("meta-marked"),
    fs =            require("fs-extra"),
    yamljs =        require("yamljs"),
    fswf =          require("safe-write-file");

var firebase = require("firebase"),
    async = require("async");

firebase.initializeApp({
  databaseURL: "https://blistering-inferno-8720.firebaseio.com",
  serviceAccount: "deploy-creds.json",
  databaseAuthVariableOverride: {
    uid: "deploy"
  }
});

var db = firebase.database(),
    firebaseDeploymentTasks = [];

var API_HOST = "http://com.cryart.sabbathschool.s3-website-us-west-2.amazonaws.com/api/",
    API_VERSION = "v1",
    SOURCE_DIR = "src/",
    SOURCE_INFO_FILE = "info.yml",
    SOURCE_COVER_FILE = "cover.png",
    SOURCE_EXTENSION = "md",
    DIST_DIR = "dist/api/" + API_VERSION + "/",
    FIREBASE_DATABASE_LANGUAGES = "languages",
    FIREBASE_DATABASE_QUARTERLIES = "quarterlies",
    FIREBASE_DATABASE_QUARTERLY_INFO = "quarterly-info",
    FIREBASE_DATABASE_LESSONS = "lessons",
    FIREBASE_DATABASE_LESSON_INFO = "lesson-info",
    FIREBASE_DATABASE_DAYS = "days",
    FIREBASE_DATABASE_READ = "reads";

var lastModified = process.argv.slice(2);

var changeCheck = function(path){
  if (!lastModified.length>0) return false;
  return exec('git log --since="'+lastModified[0]+'" '+path).toString().length>0;
};

var create_languages_api = function(){
  /**
   * Creating languages API
   *
   * /api/v1/languages
   */
  var languages = [],
      _languages = fs.readdirSync(SOURCE_DIR);

  for (var i = 0; i < _languages.length; i++){
    if (!fs.lstatSync(SOURCE_DIR + _languages[i]).isDirectory()) continue;
    languages.push(yamljs.load(SOURCE_DIR + "/" + _languages[i] + "/" + SOURCE_INFO_FILE));
  }

  firebaseDeploymentTasks.push(function(cb){
{'fraction_non_alphanumeric': 0.1565723353610156, 'fraction_numerical': 0.010050251256281407, 'mean_word_length': 3.7632241813602016, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '40862', 'n_tokens_mistral': 1402, 'n_tokens_neox': 1340, 'n_words': 211}