<commit_before>/**
 * React Native Playground
 * https://github.com/jsierles/rnplay
 */

'use strict';

var React = require('react-native');

var qs = require('qs');
var LinkingIOS = require('LinkingIOS');
var reloadApp = require('../Utilities/reloadApp');
var Login = require('../Screens/Login');
var Signup = require('../Screens/Signup');
var Home = require('../Screens/Home');
var Guest = require('../Screens/Guest');

var Art = require('art');
var _ = require('lodash');

var {
  AppRegistry,
  Navigator,
  StyleSheet,
  Text,
  View,
  StatusBarIOS,
  NativeAppEventEmitter,
} = React;

// globals are bad, we make an exception here for now
global.PACKAGE = require('json!../../package.json');
var RN_VERSION = global.PACKAGE.dependencies['react-native'];
global.RN_VERSION_DISPLAY = RN_VERSION;
var githubPrefix = 'rnplay/react-native#';
RN_VERSION = RN_VERSION.replace(githubPrefix, '').replace(/\./g,'').replace(/-/g, '')

global.RN_VERSION = RN_VERSION;

var RNPlayNative = React.createClass({

  getInitialState() {
    return {
      bootstrapped: false
    };
  },

  componentDidMount() {
    LinkingIOS.addEventListener('url', this._processURL);

    var url = LinkingIOS.popInitialURL();
    if (url) {
      this._processURL({url});
    }

    this.returnSubscription = NativeAppEventEmitter.addListener('returnToHome',
      (data) => {
        if (this._onReturn) {
          this._onReturn();
        }
      });
  },

  componentWillUnmount() {
    LinkingIOS.removeEventListener('url', this._processURL);
    this.returnSubscription.remove();
  },

  _onReturn() {
    StatusBarIOS.setHidden(false);
  },

  _processURL(e) {
    var url = e.url.replace('rnplay://', '');
    var [path, querystring] = url.split("?");

    if (querystring) {
      var {bundle_url, module_name, params_json} = qs.parse(querystring);
      if (bundle_url && module_name) {
        reloadApp(bundle_url, module_name, params_json);
      }

    }
  },

  render() {
    return <Home />;
  }
});

module.exports = RNPlayNative;<commit_msg>add version manager hook<commit_after>/**
 * React Native Playground
 * https://github.com/jsierles/rnplay
 */

'use strict';

var React = require('react-native');

var qs = require('qs');
var LinkingIOS = require('LinkingIOS');
var reloadApp = require('../Utilities/reloadApp');
var Login = require('../Screens/Login');
var Signup = require('../Screens/Signup');
var Home = require('../Screens/Home');
var Guest = require('../Screens/Guest');
var VersionManager = require('react-native-versions');

var Art = require('art');
var _ = require('lodash');

var {
  AppRegistry,
  Navigator,
  StyleSheet,
  Text,
  View,
  StatusBarIOS,
  NativeAppEventEmitter,
} = React;

// globals are bad, we make an exception here for now
global.PACKAGE = require('json!../../package.json');
var RN_VERSION = global.PACKAGE.dependencies['react-native'];
global.RN_VERSION_DISPLAY = RN_VERSION;
var githubPrefix = 'rnplay/react-native#';
RN_VERSION = RN_VERSION.replace(githubPrefix, '').replace(/\./g,'').replace(/-/g, '')

global.RN_VERSION = RN_VERSION;

var RNPlayNative = React.createClass({

  getInitialState() {
    return {
      bootstrapped: false
    };
  },

  componentDidMount() {
    LinkingIOS.addEventListener('url', this._processURL);

    var url = LinkingIOS.popInitialURL();
    if (url) {
      this._processURL({url});
    }

    this.returnSubscription = NativeAppEventEmitter.addListener('returnToHome',
      (data) => {
        if (this._onReturn) {
          this._onReturn();
        }
      });
  },

  componentWillUnmount() {
    LinkingIOS.removeEventListener('url', this._processURL);
    this.returnSubscription.remove();
  },

  _onReturn() {
    StatusBarIOS.setHidden(false);
  },

  _processURL(e) {
    var url = e.url.replace('rnplay://', '');
    var [path, querystring] = url.split("?");

    if (querystring) {
      var {bundle_url, module_name, params_json} = qs.parse(querystring);
      if (bundle_url && module_name) {
        reloadApp(bundle_url, module_name, params_json);
      }

    }
  },

  render() {
    return (
      <View>
        <Home />
        <VersionManager
          appId="9e9aad73a03e4848f22b"
          apiId="16c9d784280d14f2"
          apiSecret="-<KEY>"
          active={true}
          moduleName="RNPlayNative" />
      </View>
    )
  }
});

module.exports = RNPlayNative;
{'fraction_non_alphanumeric': 0.1620201096892139, 'fraction_numerical': 0.005484460694698354, 'mean_word_length': 3.291176470588235, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5691057', 'n_tokens_mistral': 1495, 'n_tokens_neox': 1424, 'n_words': 261}