<commit_before>/*
 * Copyright 2013 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
var addFinalProp  = require('../utils').addFinalProp;
var Class         = require('../imports').Platform;

module.exports=Platform;

function Platform(instance){
   addFinalProp(this, "_instance", instance);
}
Platform.prototype.getMajorVersion=function(){
   return this._instance.getMajorVersionSync();
};
Platform.prototype.getMinorVersion=function(){
   return this._instance.getMinorVersionSync();
};
Platform.prototype.getPartOfOsName=function(){
   return this._instance.getPartOfOsNameSync();
};
Platform.prototype.is=function(compareWith){
   if(!(compareWith instanceof Platform)){
      throw new Error("argument must be an instance of Platform");
   }
   return this._instance.isSync(compareWith._instance);
};


addFinalProp(Platform, "ANDROID", new Platform(Class.ANDROID));
addFinalProp(Platform, "ANY",     new Platform(Class.ANY));
addFinalProp(Platform, "LINUX",   new Platform(Class.LINUX));
addFinalProp(Platform, "MAC",     new Platform(Class.MAC));
addFinalProp(Platform, "UNIX",    new Platform(Class.UNIX));
addFinalProp(Platform, "VISTA",   new Platform(Class.VISTA));
addFinalProp(Platform, "WIN8",    new Platform(Class.WIN8));
addFinalProp(Platform, "WINDOWS", new Platform(Class.WINDOWS));
addFinalProp(Platform, "XP",      new Platform(Class.XP));


addFinalProp(Platform, "extractFromSysProperty", function(osName, osVersion){
   if(osVersion){
      return new Platform(Class.extractFromSysPropertySync(osName, osVersion));
   }
   return new Platform(Class.extractFromSysPropertySync(osName));
});

addFinalProp(Platform, "getCurrent", function(){
   return new Platform(Class.getCurrentSync(osName));
});

addFinalProp(Platform, "valueOf", function(name){
   return new Platform(Class.valueOfSync(name));
});

addFinalProp(Platform, "values", function(){
   return Class.valuesSync.map(function(v){
      return new Platform(v);
   });
});<commit_msg>making static methods and enums really static.<commit_after>/*
 * Copyright 2013 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
var addFinalProp  = require('../utils').addFinalProp;
var Class         = require('../imports').Platform;

module.exports=Platform;

function Platform(instance){
   addFinalProp(this, "_instance", instance);
}

Platform.prototype.getMajorVersion=function(){
   return this._instance.getMajorVersionSync();
};
Platform.prototype.getMinorVersion=function(){
   return this._instance.getMinorVersionSync();
};
Platform.prototype.getPartOfOsName=function(){
   return this._instance.getPartOfOsNameSync();
};
Platform.prototype.is=function(compareWith){
   if(!(compareWith instanceof Platform)){
      throw new Error("argument must be an instance of Platform");
   }
   return this._instance.isSync(compareWith._instance);
};

Platform.ANDROID = Platform.prototype.ANDROID = new Platform(Class.ANDROID);
Platform.ANY     = Platform.prototype.ANY     = new Platform(Class.ANY);
Platform.LINUX   = Platform.prototype.LINUX   = new Platform(Class.LINUX);
Platform.MAC     = Platform.prototype.MAC     = new Platform(Class.MAC);
Platform.UNIX    = Platform.prototype.UNIX    = new Platform(Class.UNIX);
Platform.VISTA   = Platform.prototype.VISTA   = new Platform(Class.VISTA);
Platform.WIN8    = Platform.prototype.WIN8    = new Platform(Class.WIN8);
Platform.WINDOWS = Platform.prototype.WINDOWS = new Platform(Class.WINDOWS);
Platform.XP      = Platform.prototype.XP      = new Platform(Class.XP);


Platform.extractFromSysProperty
   =Platform.prototype.extractFromSysProperty
   =function(osName, osVersion){
   if(osVersion){
      return new Platform(Class.extractFromSysPropertySync(osName, osVersion));
   }
   return new Platform(Class.extractFromSysPropertySync(osName));
};

Platform.getCurrent
   =Platform.prototype.getCurrent
   =function(){
   return new Platform(Class.getCurrentSync(osName));
};

Platform.valueOf
   =Platform.prototype.valueOf
   =function(name){
   return new Platform(Class.valueOfSync(name));
};

Platform.values
   =Platform.prototype.values
   =function(){
   return Class.valuesSync.map(function(v){
      return new Platform(v);
   });
};

{'fraction_non_alphanumeric': 0.1210727969348659, 'fraction_numerical': 0.004022988505747126, 'mean_word_length': 4.859708193041526, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7019834', 'n_tokens_mistral': 1463, 'n_tokens_neox': 1445, 'n_words': 378}