Adjust bot to changes in config.

Temporarily disable jan and papiez plugins until.
master
Robert Gerus 2015-12-12 13:01:17 +01:00
parent bc36369497
commit 1a298e4e06
11 changed files with 22 additions and 13 deletions

11
bot/bot.go Normal file
View File

@ -0,0 +1,11 @@
package bot
import (
"github.com/arachnist/gorepost/config"
)
var cfg *config.Config
func Initialize(config *config.Config) {
cfg = config
}

View File

@ -7,7 +7,6 @@ package bot
import (
"log"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -9,7 +9,6 @@ import (
"strings"
"sync"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -15,7 +15,6 @@ import (
"github.com/moovweb/gokogiri"
"github.com/moovweb/gokogiri/xpath"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -7,7 +7,6 @@ package bot
import (
"strings"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -1,3 +1,5 @@
// +build configfix
//
// Copyright 2015 Robert S. Gerus. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
@ -11,7 +13,6 @@ import (
"sync"
"time"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -9,7 +9,6 @@ import (
"log"
"regexp"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -1,3 +1,5 @@
// +build configfix
//
// Copyright 2015 Robert S. Gerus. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
@ -11,7 +13,6 @@ import (
"sync"
"time"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -16,7 +16,7 @@ import (
"testing"
"time"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
@ -257,7 +257,7 @@ var eventTests = []struct {
},
},
},
{
/* {
desc: "papież",
in: irc.Message{
Command: "PRIVMSG",
@ -336,7 +336,7 @@ var eventTests = []struct {
Trailing: "Jan Paweł II predicate małe specified-object",
},
},
},
}, */
{
desc: "roll multiple",
in: irc.Message{
@ -815,6 +815,9 @@ func configLookupHelper(map[string]string) []string {
func TestMain(m *testing.M) {
log.SetOutput(ioutil.Discard)
cfg.SetFileListBuilder(configLookupHelper)
os.Exit(m.Run())
}
func init() {
Initialize(config.New(configLookupHelper))
}

View File

@ -13,7 +13,6 @@ import (
"github.com/cloudflare/gokabinet/kt"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)

View File

@ -12,7 +12,6 @@ import (
"strings"
"unicode/utf8"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)