<commit_before>Array.prototype.last = function() {return this[this.length-1];}

var Projects = new Lawnchair({adaptor: 'air', table: "projects"});

var app = {
  delegateTo: function(targetMethod){
    return function(evnt){
      app[targetMethod](evnt);
    };
  },
  
  initialize: function() {
    app.listProjects();
  },
  
  createProjectBySelectingDirectory: function() {
    browseDirectories(air.File.userDirectory.nativePath, function(evnt) {
      app.createProject(evnt.target.nativePath.replace(/\/$/, '').split('/').last(), evnt.target.nativePath, "", "");  
    });
  },
  
  createProjectByDroppingADirectory: function(evnt){ 
    evnt.preventDefault();
    directoryPath = evnt.dataTransfer.getData("text/uri-list");
    app.createProject(directoryPath.replace(/\/$/, '').split('/').last(), directoryPath, "", "");
  },
  
  createProject: function(name, projectDir, sassDir, cssDir) {
    Projects.save({<commit_msg>updated path parsing logic for windows<commit_after>Array.prototype.last = function() {return this[this.length-1];}

var Projects = new Lawnchair({adaptor: 'air', table: "projects"});

var app = {
  delegateTo: function(targetMethod){
    return function(evnt){
      app[targetMethod](evnt);
    };
  },
  
  initialize: function() {
    app.listProjects();
  },
  
  createProjectBySelectingDirectory: function() {
    browseDirectories(air.File.userDirectory.nativePath, function(evnt) {
      if(air.Capabilities.os.match(/Windows/)) {
        app.createProject(evnt.target.nativePath.replace(/\\$/, '').split('\\').last(), evnt.target.nativePath, "", "");  
      } else {
        app.createProject(evnt.target.nativePath.replace(/\/$/, '').split('/').last(), evnt.target.nativePath, "", "");  
      }
    });
  },
  
  createProjectByDroppingADirectory: function(evnt){ 
    evnt.preventDefault();
    directoryPath = evnt.dataTransfer.getData("text/uri-list");
    app.createProject(directoryPath.replace(/\/$/, '').split('/').last(), directoryPath, "", "");
  },
  
  createProject: function(name, projectDir, sassDir, cssDir) {
    Projects.save({
{'fraction_non_alphanumeric': 0.1849904397705545, 'fraction_numerical': 0.0009560229445506692, 'mean_word_length': 3.936320754716981, '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': '1269785', 'n_tokens_mistral': 665, 'n_tokens_neox': 662, 'n_words': 93}