Skip to content

Commit

Permalink
Split /utils into( /gtp, /options), and /test/utils ( /test/base_serv…
Browse files Browse the repository at this point in the history
…er_packets, /test/fake_modules, /test/module_loading, /test/utils) (#342)

* move gtp helpers from /utils to /gtp_helpers

* rename /utils to /options_helpers

* move base server packets to /test/base_server_packets

* move module loading helpers to /test/module_loading_helpers

* move fake modules to /test/fake_modules

* rename _helpers to ""

* add /gtp/** and /options/** to npm package.json for an npm install

* fix console logging version 6.0 to 6.0.0

* version bump from 6.0.0 to 6.0.1
  • Loading branch information
wonderingabout authored Jul 4, 2020
1 parent 7c52b98 commit 7bc9088
Show file tree
Hide file tree
Showing 29 changed files with 33 additions and 30 deletions.
6 changes: 3 additions & 3 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
const child_process = require('child_process');
const split2 = require('split2');

const { decodeMoves } = require("./utils/decodeMoves");
const { gtpchar2num } = require("./utils/gtpchar2num");
const { move2gtpvertex } = require("./utils/move2gtpvertex");
const { decodeMoves } = require("./gtp/decodeMoves");
const { gtpchar2num } = require("./gtp/gtpchar2num");
const { move2gtpvertex } = require("./gtp/move2gtpvertex");

const console = require('./console').console;
const config = require('./config');
Expand Down
10 changes: 5 additions & 5 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

const fs = require('fs');

const { getArgNamesGRU } = require('./utils/getArgNamesGRU');
const { getOptionName } = require('./utils/getOptionName');
const { getRankedUnranked } = require('./utils/getRankedUnranked');
const { getRankedUnrankedUnderscored } = require('./utils/getRankedUnrankedUnderscored');
const { getArgNamesGRU } = require('./options/getArgNamesGRU');
const { getOptionName } = require('./options/getOptionName');
const { getRankedUnranked } = require('./options/getRankedUnranked');
const { getRankedUnrankedUnderscored } = require('./options/getRankedUnrankedUnderscored');

exports.check_rejectnew = function() {};

Expand Down Expand Up @@ -210,7 +210,7 @@ exports.updateFromArgv = function() {
// A- greeting and debug status

const debugStatus = argv.debug ? "ON" : "OFF";
console.log(`\ngtp2ogs version 6.0`
console.log(`\ngtp2ogs version 6.0.1`
+ `\n--------------------`
+ `\n- For changelog or latest devel updates, `
+ `please visit https://github.com/online-go/gtp2ogs/tree/devel`
Expand Down
6 changes: 3 additions & 3 deletions connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ const http = require('http');
const https = require('https');
const querystring = require('querystring');

const { getArgNamesGRU } = require('./utils/getArgNamesGRU');
const { getArgNamesUnderscoredGRU } = require('./utils/getArgNamesUnderscoredGRU');
const { getRankedUnranked } = require('./utils/getRankedUnranked');
const { getArgNamesGRU } = require('./options/getArgNamesGRU');
const { getArgNamesUnderscoredGRU } = require('./options/getArgNamesUnderscoredGRU');
const { getRankedUnranked } = require('./options/getRankedUnranked');

let config;
const console = require('./console').console;
Expand Down
4 changes: 2 additions & 2 deletions game.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// vim: tw=120 softtabstop=4 shiftwidth=4

const { decodeMoves } = require("./utils/decodeMoves");
const { move2gtpvertex } = require("./utils/move2gtpvertex");
const { decodeMoves } = require("./gtp/decodeMoves");
const { move2gtpvertex } = require("./gtp/move2gtpvertex");

const Bot = require('./bot').Bot;
const console = require('./console').console;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gtp2ogs",
"version": "6.0.0",
"version": "6.0.1",
"description": "Wrapper to allow Gnu Go Text Protocol speaking Go engines to connect to Online-Go.com and play games",
"main": "gtp2ogs.js",
"files": [
Expand All @@ -9,7 +9,10 @@
"connection.js",
"console.js",
"game.js",
"gtp2ogs.js"
"gtp2ogs.js",
"pv.js",
"gtp/**",
"options/**"
],
"bin": {
"gtp2ogs": "gtp2ogs.js"
Expand Down
6 changes: 3 additions & 3 deletions pv.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { char2num } = require("./utils/char2num");
const { gtpchar2num } = require("./utils/gtpchar2num");
const { num2char } = require("./utils/num2char");
const { char2num } = require("./gtp/char2num");
const { gtpchar2num } = require("./gtp/gtpchar2num");
const { num2char } = require("./gtp/num2char");

class Pv {
constructor(setting, game) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions test/checkChallenge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const assert = require('assert');
const https = require('https');
const sinon = require('sinon');

const { base_challenge } = require('./utils/base_challenge');
const { FakeAPI } = require('./utils/FakeAPI');
const { FakeSocket } = require('./utils/FakeSocket');
const { getNewConfigUncached } = require('./utils/getNewConfigUncached');
const { getNewConnectionUncached } = require('./utils/getNewConnectionUncached');
const { base_challenge } = require('./base_server_packets/base_challenge');
const { FakeAPI } = require('./fake_modules/FakeAPI');
const { FakeSocket } = require('./fake_modules/FakeSocket');
const { getNewConfigUncached } = require('./module_loading/getNewConfigUncached');
const { getNewConnectionUncached } = require('./module_loading/getNewConnectionUncached');
const { stub_console } = require('./utils/stub_console');

let config;
Expand Down
14 changes: 7 additions & 7 deletions test/e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ const fs = require('fs');
const https = require('https');
const sinon = require('sinon');

const { base_active_game } = require('./utils/base_active_game');
const { base_challenge } = require('./utils/base_challenge');
const { base_gamedata } = require('./utils/base_gamedata');
const { FakeAPI } = require('./utils/FakeAPI');
const { FakeGTP } = require('./utils/FakeGTP');
const { FakeSocket } = require('./utils/FakeSocket');
const { getNewConfig } = require('./utils/getNewConfig');
const { base_active_game } = require('./base_server_packets/base_active_game');
const { base_challenge } = require('./base_server_packets/base_challenge');
const { base_gamedata } = require('./base_server_packets/base_gamedata');
const { FakeAPI } = require('./fake_modules/FakeAPI');
const { FakeGTP } = require('./fake_modules/FakeGTP');
const { FakeSocket } = require('./fake_modules/FakeSocket');
const { getNewConfig } = require('./module_loading/getNewConfig');
const { stub_console } = require('./utils/stub_console');

const { Bot } = require('../bot');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7bc9088

Please sign in to comment.