Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wip-camel-irc' of github.com:bwmcadams/scalgore into wi…
…p-camel-irc Conflicts: project/build/ScalGore.scala
- Loading branch information
Showing
10 changed files
with
90 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
target | ||
lib_managed | ||
project/boot | ||
project/plugins/src_managed | ||
project/plugins/project |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
import sbt._ | ||
|
||
class ScalGoreProject(info: ProjectInfo) extends DefaultProject(info) { | ||
class ScalGoreProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject { | ||
override val mainClass = Some("net.evilmonkeylabs.scalgore.ScalGore") | ||
|
||
val TwitterRepo = MavenRepository("Twitter Repository", "http://maven.twttr.com") | ||
val MavenLocal = MavenRepository("Local Maven Repository", "file://" + Path.userHome + "/.m2/repository") | ||
val SonatypeReleasesRepo = MavenRepository("Sonatype OSS Repo", "http://oss.sonatype.org/content/repositories/releases") | ||
|
||
|
||
val configgyConfig = ModuleConfiguration("net.lag", "configgy", "2.0.2", TwitterRepo) | ||
val elasticConfig = ModuleConfiguration("org.elasticsearch", SonatypeReleasesRepo) | ||
|
||
val elasticSearch = "org.elasticsearch" % "elasticsearch" % "0.16.3" | ||
val commonsHTTP = "commons-httpclient" % "commons-httpclient" % "3.1" | ||
|
||
val casbah = "com.mongodb.casbah" %% "casbah" % "2.1.5-1" | ||
val akka_actor = "se.scalablesolutions.akka" % "akka-actor" % "1.0" | ||
val akka_camel = akkaModule("camel") | ||
val camel_irc = "org.apache.camel" % "camel-irc" % "2.5.0" | ||
val configgy = "net.lag" % "configgy" % "2.0.2" | ||
|
||
val twitterRep = "Twitter" at "http://maven.twttr.com" | ||
val sonaRepo = "Sona Repo" at "http://oss.sonatype.org/content/repositories/releases/" | ||
val akkaRepo = "Akka Repository" at "http://www.akka.io/repository" | ||
val mavenLocal = "Local Maven Repository" at "file://" + Path.userHome + "/.m2/repository" | ||
} | ||
|
||
// vim: set ts=2 sw=2 sts=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import sbt._ | ||
|
||
class Plugins(info: ProjectInfo) extends PluginDefinition(info) { | ||
lazy val akkaRepo = "Akka Repository" at "http://akka.io/repository" | ||
|
||
lazy val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
akka { | ||
enabled-modules = [ "camel" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
scalgore { | ||
|
||
nick = "scalgore" | ||
networks = [ "freenode"] | ||
|
||
servers = [ "freenode"] | ||
|
||
freenode { | ||
uri = "irc.freenode.net" | ||
channels = [ "#scalgore", "#akka" ] | ||
freenode { | ||
nick = "scalgore" | ||
host = "irc.freenode.net" | ||
channels = [ "#scalgore" ] | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.evilmonkeylabs.scalgore | ||
|
||
import net.lag.configgy.Configgy | ||
import akka.actor.{Actor, ActorRef} | ||
import akka.util._ | ||
import akka.camel._ | ||
|
||
class IrcConsumer(network: Network, ircLog: ActorRef) extends Actor with Consumer with Logging { | ||
|
||
lazy val _endpointUri = "irc:%s@%s?channels=%s" format (network.nick, network.host, network.channels.mkString(",")) | ||
|
||
def endpointUri = _endpointUri | ||
|
||
def receive = { | ||
case Message(body: String, headers: Map[String, String]) => { | ||
for ( sender <- headers.get("irc.user.nick"); | ||
host <- headers.get("irc.user.host"); | ||
login <- headers.get("irc.user.username"); | ||
channel <- headers.get("irc.target"); | ||
msgtype <- headers.get("irc.messageType") if msgtype == "PRIVMSG") { | ||
ircLog ! IrcPublicMessage(network.name, channel, sender, login, host, body) | ||
} // for | ||
} // case | ||
} // receive | ||
} | ||
|
||
// vim: set ts=2 sw=2 sts=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters