summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Gerus <arachnist@i.am-a.cat>2015-12-12 13:01:17 +0100
committerRobert Gerus <arachnist@i.am-a.cat>2015-12-12 13:01:17 +0100
commit1a298e4e06e6b6eeb92e526a04a6fde2525a6a4e (patch)
treea8f5bfb4b690fa6f74958076031bdf8ec6182239
parentbc36369497181c4f5165c04bc30a32b55203cca9 (diff)
downloadgorepost-1a298e4e06e6b6eeb92e526a04a6fde2525a6a4e.tar.gz
gorepost-1a298e4e06e6b6eeb92e526a04a6fde2525a6a4e.tar.bz2
gorepost-1a298e4e06e6b6eeb92e526a04a6fde2525a6a4e.tar.xz
gorepost-1a298e4e06e6b6eeb92e526a04a6fde2525a6a4e.zip
Adjust bot to changes in config.
Temporarily disable jan and papiez plugins until.
-rw-r--r--bot/bot.go11
-rw-r--r--bot/channeljoin.go1
-rw-r--r--bot/dispatcher.go1
-rw-r--r--bot/helpers.go1
-rw-r--r--bot/identify.go1
-rw-r--r--bot/jan.go3
-rw-r--r--bot/nickserv.go1
-rw-r--r--bot/papiez.go3
-rw-r--r--bot/plugins_test.go11
-rw-r--r--bot/seen.go1
-rw-r--r--bot/urltitle.go1
11 files changed, 22 insertions, 13 deletions
diff --git a/bot/bot.go b/bot/bot.go
new file mode 100644
index 0000000..9d136d6
--- /dev/null
+++ b/bot/bot.go
@@ -0,0 +1,11 @@
+package bot
+
+import (
+ "github.com/arachnist/gorepost/config"
+)
+
+var cfg *config.Config
+
+func Initialize(config *config.Config) {
+ cfg = config
+}
diff --git a/bot/channeljoin.go b/bot/channeljoin.go
index 63e5339..6aa0df7 100644
--- a/bot/channeljoin.go
+++ b/bot/channeljoin.go
@@ -7,7 +7,6 @@ package bot
import (
"log"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
diff --git a/bot/dispatcher.go b/bot/dispatcher.go
index 0be2a68..7534f8c 100644
--- a/bot/dispatcher.go
+++ b/bot/dispatcher.go
@@ -9,7 +9,6 @@ import (
"strings"
"sync"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
diff --git a/bot/helpers.go b/bot/helpers.go
index abe2c12..3e073e3 100644
--- a/bot/helpers.go
+++ b/bot/helpers.go
@@ -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"
)
diff --git a/bot/identify.go b/bot/identify.go
index f81c92a..04ef61d 100644
--- a/bot/identify.go
+++ b/bot/identify.go
@@ -7,7 +7,6 @@ package bot
import (
"strings"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
diff --git a/bot/jan.go b/bot/jan.go
index 2feb0eb..66ce125 100644
--- a/bot/jan.go
+++ b/bot/jan.go
@@ -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"
)
diff --git a/bot/nickserv.go b/bot/nickserv.go
index 48200b4..b2c5915 100644
--- a/bot/nickserv.go
+++ b/bot/nickserv.go
@@ -9,7 +9,6 @@ import (
"log"
"regexp"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
diff --git a/bot/papiez.go b/bot/papiez.go
index ca573f0..4e68586 100644
--- a/bot/papiez.go
+++ b/bot/papiez.go
@@ -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"
)
diff --git a/bot/plugins_test.go b/bot/plugins_test.go
index 2b07cee..4f26abe 100644
--- a/bot/plugins_test.go
+++ b/bot/plugins_test.go
@@ -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))
+}
diff --git a/bot/seen.go b/bot/seen.go
index 2bbd5d8..0bb4e1d 100644
--- a/bot/seen.go
+++ b/bot/seen.go
@@ -13,7 +13,6 @@ import (
"github.com/cloudflare/gokabinet/kt"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
diff --git a/bot/urltitle.go b/bot/urltitle.go
index 9134012..f29fa21 100644
--- a/bot/urltitle.go
+++ b/bot/urltitle.go
@@ -12,7 +12,6 @@ import (
"strings"
"unicode/utf8"
- cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)