<commit_before>/*global PUBNUB */
/*jshint -W030 */
import Ember from "ember";

export default Ember.Service.extend(Ember.Evented, {
	PN: null,
	pnState: {},

	setup: function() {
		let config = this.container.lookupFactory("config:environment");

		if (PUBNUB === void 0) {
			throw new Ember.Error("ember-cli-pubnub: PubNub JS SDK not found");
		}

		if (config.pubnub === void 0){
			throw new Ember.Error("ember-cli-pubnub: no configuration in config.environment");
		}

		let pn = PUBNUB.init(config.pubnub);

		// ************************************************* Ember.A, Ember.Object
		this.get("pnState")["_channels"] = [];
		this.get("pnState")["_presence"] = {};
		this.get("pnState")["_presData"] = {};

		return this.set("PN", pn);

	}.on("init"),

	listChannels: function() {
		return this.get("pnState")["_channels"].slice(0);
	},

	listPresence: function(channel) {
		let _ref;
		return (_ref = this.get("pnState")["_presence"][channel]) != null ? _ref.slice(0) : void 0;
	},

	presenceData: function(channel) {
		return this.get("pnState")["_presData"][channel] || {};
	},

	msgEvent: function(channel) {
		return `pn-message:${channel}`;
	},

	prsEvent: function(channel) {
		return `pn-presence:${channel}`;
	},

	publish: function(args) {
		return this.get("PN")["publish"].apply(this.get("PN"), args);
	},

	state: function(args) {
		return this.get("PN")["state"](args);
	},

	auth: function(){
		return this.get("PN")["auth"].apply(this.get("PN"), arguments);
	},

	audit: function(){
		return this.get("PN")["audit"].apply(this.get("PN"), arguments);
	},<commit_msg>debugging<commit_after>/*global PUBNUB */
/*jshint -W030 */
import Ember from "ember";

export default Ember.Service.extend(Ember.Evented, {
	PN: null,
	pnState: {},

	setup: function() {
		let config = this.container.lookupFactory("config:environment");

		if (PUBNUB === void 0) {
			throw new Ember.Error("ember-cli-pubnub: PubNub JS SDK not found");
		}

		if (config.pubnub === void 0){
			throw new Ember.Error("ember-cli-pubnub: no configuration in config.environment");
		}

		let pn = PUBNUB.init(config.pubnub);

		// ************************************************* Ember.A, Ember.Object
		this.get("pnState")["_channels"] = [];
		this.get("pnState")["_presence"] = {};
		this.get("pnState")["_presData"] = {};

		return this.set("PN", pn);

	}.on("init"),

	listChannels: function() {
		return this.get("pnState")["_channels"].slice(0);
	},

	listPresence: function(channel) {
		let _ref;
		return (_ref = this.get("pnState")["_presence"][channel]) != null ? _ref.slice(0) : void 0;
	},

	presenceData: function(channel) {
		return this.get("pnState")["_presData"][channel] || {};
	},

	msgEvent: function(channel) {
		return `pn-message:${channel}`;
	},

	prsEvent: function(channel) {
		return `pn-presence:${channel}`;
	},

	publish: function(args) {
		console.dir(args);
		return this.get("PN")["publish"].apply(this.get("PN"), args);
	},

	state: function(args) {
		return this.get("PN")["state"](args);
	},

	auth: function(){
		return this.get("PN")["auth"].apply(this.get("PN"), arguments);
	},

	audit: function(){
		return this.get("PN")["audit"].apply(this.get("PN"), arguments);
	},
{'fraction_non_alphanumeric': 0.237722865186112, 'fraction_numerical': 0.005004691898654989, 'mean_word_length': 4.783001808318264, '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': '3591440', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1139, 'n_words': 201}