<commit_before>var DDPClient = require('ddpclient');
var Config = require('./config');
var program = require('commander');

Atmosphere = {
  publish: function(fn) {
    var config = new Config(process.cwd());

    var ddpclient = new DDPClient({
      hostname: 'atmosphere.meteor.com',
      port: 443,
      use_ssl: true
    });

    ddpclient.on("connect-error", function(data) {
      console.log("An error occured connecting to '" + ddpclient.socket_url + "'");
      process.exit();
    });

    program.prompt({
      username: 'username: ',
      password: 'password: '
    }, function(credentials) {
      ddpclient.connect();
      
      ddpclient.on("connect", function(data) {
        ddpclient.on("msg-result-login", function(data) {
          ddpclient.on("msg-result-publish", function(data) {
            fn();
          });
          ddpclient.call("publish", [config]);
        });
        ddpclient.call("login", [{
          user: {
            username: credentials.username
          },
          password: <PASSWORD>
        }]);
        
      });
    });
  }
};

module.exports = Atmosphere;
<commit_msg>allow command line args<commit_after>var DDPClient = require('ddpclient');
var Config = require('./config');
var program = require('commander');

program
  .option('-h, --hostname <hostname>', 'specify the server [atmosphere.meteor.com]', 'atmosphere.meteor.com')
  .option('-p, --port <port>', 'specify the server [443]', Number, 443)
  .parse(process.argv);

program.use_ssl = (program.port === 443) ? true : false;

Atmosphere = {
  publish: function(fn) {
    var config = new Config(process.cwd());
    var ddpclient = new DDPClient(program);

    ddpclient.on("connect-error", function(data) {
      console.log("An error occured connecting to '" + ddpclient.socket_url + "'");
      process.exit();
    });

    program.prompt({
      username: 'username: ',
      password: 'password: '
    }, function(credentials) {
      ddpclient.connect();
      
      ddpclient.on("connect", function(data) {
        ddpclient.on("msg-result-login", function(data) {
          ddpclient.on("msg-result-publish", function(data) {
            fn();
          });
          ddpclient.call("publish", [config]);
        });
        ddpclient.call("login", [{
          user: {
            username: credentials.username
          },
          password: <PASSWORD>
        }]);
        
      });
    });
  }
};

module.exports = Atmosphere;

{'fraction_non_alphanumeric': 0.16382806163828062, 'fraction_numerical': 0.004866180048661801, 'mean_word_length': 2.426388888888889, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5585451', 'n_tokens_mistral': 767, 'n_tokens_neox': 749, 'n_words': 139}