From 21f1e95fb8e935134a969bc3d729964d8d2aadfa Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Thu, 14 May 2020 23:06:10 -0400 Subject: [PATCH] rename Irc to IRC --- Examples/States/Client.cs | 4 +- Examples/States/StatesSample.csproj | 2 +- Examples/Tokens/Client.cs | 2 +- Examples/Tokens/Program.cs | 2 +- Examples/Tokens/TokensSample.csproj | 2 +- IrcSharp.sln => IRCSharp.sln | 4 +- {IrcStates => IRCStates}/Casemap.cs | 2 +- {IrcStates => IRCStates}/Channel.cs | 2 +- {IrcStates => IRCStates}/ChannelUser.cs | 2 +- {IrcStates => IRCStates}/Commands.cs | 2 +- {IrcStates => IRCStates}/Emit.cs | 2 +- IRCStates/Extensions.cs | 15 +++++++ .../IRCStates.csproj | 2 +- {IrcStates => IRCStates}/ISupport.cs | 2 +- {IrcStates => IRCStates}/ISupportChanModes.cs | 2 +- {IrcStates => IRCStates}/ISupportPrefix.cs | 2 +- {IrcStates => IRCStates}/Numeric.cs | 2 +- {IrcStates => IRCStates}/README.md | 0 {IrcStates => IRCStates}/Server.cs | 4 +- .../ServerDisconnectedException.cs | 2 +- {IrcStates => IRCStates}/ServerException.cs | 2 +- {IrcStates => IRCStates}/Tests/Cap.cs | 4 +- {IrcStates => IRCStates}/Tests/Casemap.cs | 8 ++-- {IrcStates => IRCStates}/Tests/Channel.cs | 8 ++-- {IrcStates => IRCStates}/Tests/Emit.cs | 4 +- {IrcStates => IRCStates}/Tests/ISupport.cs | 12 +++--- {IrcStates => IRCStates}/Tests/Mode.cs | 4 +- {IrcStates => IRCStates}/Tests/Motd.cs | 4 +- {IrcStates => IRCStates}/Tests/Sasl.cs | 4 +- {IrcStates => IRCStates}/Tests/User.cs | 4 +- {IrcStates => IRCStates}/Tests/Who.cs | 4 +- {IrcStates => IRCStates}/User.cs | 2 +- {IrcTokens => IRCTokens}/Extensions.cs | 2 +- {IrcTokens => IRCTokens}/Hostmask.cs | 2 +- .../IRCTokens.csproj | 0 {IrcTokens => IRCTokens}/Line.cs | 2 +- {IrcTokens => IRCTokens}/README.md | 4 +- {IrcTokens => IRCTokens}/StatefulDecoder.cs | 2 +- {IrcTokens => IRCTokens}/StatefulEncoder.cs | 2 +- .../Tests/Data/JoinModel.cs | 2 +- .../Tests/Data/SplitModel.cs | 2 +- .../Tests/Data/msg-join.yaml | 0 .../Tests/Data/msg-split.yaml | 0 {IrcTokens => IRCTokens}/Tests/Format.cs | 2 +- {IrcTokens => IRCTokens}/Tests/Hostmask.cs | 12 +++--- {IrcTokens => IRCTokens}/Tests/Parser.cs | 4 +- .../Tests/StatefulDecoder.cs | 10 ++--- .../Tests/StatefulEncoder.cs | 8 ++-- .../Tests/Tokenization.cs | 2 +- IrcStates/Extensions.cs | 40 ------------------- README.md | 2 +- 51 files changed, 95 insertions(+), 120 deletions(-) rename IrcSharp.sln => IRCSharp.sln (90%) rename {IrcStates => IRCStates}/Casemap.cs (98%) rename {IrcStates => IRCStates}/Channel.cs (98%) rename {IrcStates => IRCStates}/ChannelUser.cs (97%) rename {IrcStates => IRCStates}/Commands.cs (97%) rename {IrcStates => IRCStates}/Emit.cs (97%) create mode 100644 IRCStates/Extensions.cs rename IrcStates/IrcStates.csproj => IRCStates/IRCStates.csproj (91%) rename {IrcStates => IRCStates}/ISupport.cs (99%) rename {IrcStates => IRCStates}/ISupportChanModes.cs (98%) rename {IrcStates => IRCStates}/ISupportPrefix.cs (98%) rename {IrcStates => IRCStates}/Numeric.cs (99%) rename {IrcStates => IRCStates}/README.md (100%) rename {IrcStates => IRCStates}/Server.cs (99%) rename {IrcStates => IRCStates}/ServerDisconnectedException.cs (81%) rename {IrcStates => IRCStates}/ServerException.cs (79%) rename {IrcStates => IRCStates}/Tests/Cap.cs (99%) rename {IrcStates => IRCStates}/Tests/Casemap.cs (91%) rename {IrcStates => IRCStates}/Tests/Channel.cs (97%) rename {IrcStates => IRCStates}/Tests/Emit.cs (98%) rename {IrcStates => IRCStates}/Tests/ISupport.cs (95%) rename {IrcStates => IRCStates}/Tests/Mode.cs (99%) rename {IrcStates => IRCStates}/Tests/Motd.cs (93%) rename {IrcStates => IRCStates}/Tests/Sasl.cs (95%) rename {IrcStates => IRCStates}/Tests/User.cs (99%) rename {IrcStates => IRCStates}/Tests/Who.cs (97%) rename {IrcStates => IRCStates}/User.cs (97%) rename {IrcTokens => IRCTokens}/Extensions.cs (99%) rename {IrcTokens => IRCTokens}/Hostmask.cs (98%) rename IrcTokens/IrcTokens.csproj => IRCTokens/IRCTokens.csproj (100%) rename {IrcTokens => IRCTokens}/Line.cs (99%) rename {IrcTokens => IRCTokens}/README.md (98%) rename {IrcTokens => IRCTokens}/StatefulDecoder.cs (99%) rename {IrcTokens => IRCTokens}/StatefulEncoder.cs (98%) rename {IrcTokens => IRCTokens}/Tests/Data/JoinModel.cs (95%) rename {IrcTokens => IRCTokens}/Tests/Data/SplitModel.cs (89%) rename {IrcTokens => IRCTokens}/Tests/Data/msg-join.yaml (100%) rename {IrcTokens => IRCTokens}/Tests/Data/msg-split.yaml (100%) rename {IrcTokens => IRCTokens}/Tests/Format.cs (99%) rename {IrcTokens => IRCTokens}/Tests/Hostmask.cs (84%) rename {IrcTokens => IRCTokens}/Tests/Parser.cs (97%) rename {IrcTokens => IRCTokens}/Tests/StatefulDecoder.cs (90%) rename {IrcTokens => IRCTokens}/Tests/StatefulEncoder.cs (92%) rename {IrcTokens => IRCTokens}/Tests/Tokenization.cs (99%) delete mode 100644 IrcStates/Extensions.cs diff --git a/Examples/States/Client.cs b/Examples/States/Client.cs index 78d253f..e98457d 100644 --- a/Examples/States/Client.cs +++ b/Examples/States/Client.cs @@ -2,8 +2,8 @@ using System; using System.Linq; using System.Net.Sockets; using System.Threading; -using IrcStates; -using IrcTokens; +using IRCStates; +using IRCTokens; namespace StatesSample { diff --git a/Examples/States/StatesSample.csproj b/Examples/States/StatesSample.csproj index ac7b5b7..75b83cc 100644 --- a/Examples/States/StatesSample.csproj +++ b/Examples/States/StatesSample.csproj @@ -6,7 +6,7 @@ - + diff --git a/Examples/Tokens/Client.cs b/Examples/Tokens/Client.cs index 3dd3933..71d1407 100644 --- a/Examples/Tokens/Client.cs +++ b/Examples/Tokens/Client.cs @@ -1,7 +1,7 @@ using System; using System.Net.Sockets; using System.Threading; -using IrcTokens; +using IRCTokens; namespace TokensSample { diff --git a/Examples/Tokens/Program.cs b/Examples/Tokens/Program.cs index ba57836..e157e31 100644 --- a/Examples/Tokens/Program.cs +++ b/Examples/Tokens/Program.cs @@ -1,5 +1,5 @@ using System; -using IrcTokens; +using IRCTokens; namespace TokensSample { diff --git a/Examples/Tokens/TokensSample.csproj b/Examples/Tokens/TokensSample.csproj index a0e98fd..6dbcdcf 100644 --- a/Examples/Tokens/TokensSample.csproj +++ b/Examples/Tokens/TokensSample.csproj @@ -6,7 +6,7 @@ - + diff --git a/IrcSharp.sln b/IRCSharp.sln similarity index 90% rename from IrcSharp.sln rename to IRCSharp.sln index 8174c7c..ff19f5e 100644 --- a/IrcSharp.sln +++ b/IRCSharp.sln @@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrcTokens", "IrcTokens\IrcTokens.csproj", "{9E812F45-B2CD-42D2-8378-EBEBF8697905}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRCTokens", "IRCTokens\IRCTokens.csproj", "{9E812F45-B2CD-42D2-8378-EBEBF8697905}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TokensSample", "Examples\Tokens\TokensSample.csproj", "{A45DA39B-6B47-4713-8049-3B36E0235B67}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IrcStates", "IrcStates\IrcStates.csproj", "{233E3CB4-61F1-4368-9139-7E9F4A58ED2D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IRCStates", "IRCStates\IRCStates.csproj", "{233E3CB4-61F1-4368-9139-7E9F4A58ED2D}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StatesSample", "Examples\States\StatesSample.csproj", "{BC9F6696-9D83-4F7A-9E15-CE4D3626C1AF}" EndProject diff --git a/IrcStates/Casemap.cs b/IRCStates/Casemap.cs similarity index 98% rename from IrcStates/Casemap.cs rename to IRCStates/Casemap.cs index 67867c5..4546e57 100644 --- a/IrcStates/Casemap.cs +++ b/IRCStates/Casemap.cs @@ -1,6 +1,6 @@ using System; -namespace IrcStates +namespace IRCStates { public static class Casemap { diff --git a/IrcStates/Channel.cs b/IRCStates/Channel.cs similarity index 98% rename from IrcStates/Channel.cs rename to IRCStates/Channel.cs index 21ebb25..60ca3fb 100644 --- a/IrcStates/Channel.cs +++ b/IRCStates/Channel.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace IrcStates +namespace IRCStates { public class Channel { diff --git a/IrcStates/ChannelUser.cs b/IRCStates/ChannelUser.cs similarity index 97% rename from IrcStates/ChannelUser.cs rename to IRCStates/ChannelUser.cs index fab881c..8c2298b 100644 --- a/IrcStates/ChannelUser.cs +++ b/IRCStates/ChannelUser.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace IrcStates +namespace IRCStates { public class ChannelUser { diff --git a/IrcStates/Commands.cs b/IRCStates/Commands.cs similarity index 97% rename from IrcStates/Commands.cs rename to IRCStates/Commands.cs index b5bc358..d9654ec 100644 --- a/IrcStates/Commands.cs +++ b/IRCStates/Commands.cs @@ -1,4 +1,4 @@ -namespace IrcStates +namespace IRCStates { public static class Commands { diff --git a/IrcStates/Emit.cs b/IRCStates/Emit.cs similarity index 97% rename from IrcStates/Emit.cs rename to IRCStates/Emit.cs index 9ca9cb5..a5f1af5 100644 --- a/IrcStates/Emit.cs +++ b/IRCStates/Emit.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace IrcStates +namespace IRCStates { public class Emit { diff --git a/IRCStates/Extensions.cs b/IRCStates/Extensions.cs new file mode 100644 index 0000000..c807dbb --- /dev/null +++ b/IRCStates/Extensions.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.Linq; + +namespace IRCStates +{ + public static class Extensions + { + public static void UpdateWith(this Dictionary dict, Dictionary other) + { + if (dict == null || other == null || !other.Any()) return; + + foreach (var (key, value) in other) dict[key] = value; + } + } +} diff --git a/IrcStates/IrcStates.csproj b/IRCStates/IRCStates.csproj similarity index 91% rename from IrcStates/IrcStates.csproj rename to IRCStates/IRCStates.csproj index 7500c8b..cf9f190 100644 --- a/IrcStates/IrcStates.csproj +++ b/IRCStates/IRCStates.csproj @@ -15,7 +15,7 @@ - + diff --git a/IrcStates/ISupport.cs b/IRCStates/ISupport.cs similarity index 99% rename from IrcStates/ISupport.cs rename to IRCStates/ISupport.cs index f481f5f..5fcd5b1 100644 --- a/IrcStates/ISupport.cs +++ b/IRCStates/ISupport.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; -namespace IrcStates +namespace IRCStates { public class ISupport { diff --git a/IrcStates/ISupportChanModes.cs b/IRCStates/ISupportChanModes.cs similarity index 98% rename from IrcStates/ISupportChanModes.cs rename to IRCStates/ISupportChanModes.cs index 74a0579..68cfa67 100644 --- a/IrcStates/ISupportChanModes.cs +++ b/IRCStates/ISupportChanModes.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.Linq; -namespace IrcStates +namespace IRCStates { public class ISupportChanModes { diff --git a/IrcStates/ISupportPrefix.cs b/IRCStates/ISupportPrefix.cs similarity index 98% rename from IrcStates/ISupportPrefix.cs rename to IRCStates/ISupportPrefix.cs index fb5114b..35c5344 100644 --- a/IrcStates/ISupportPrefix.cs +++ b/IRCStates/ISupportPrefix.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; -namespace IrcStates +namespace IRCStates { public class ISupportPrefix { diff --git a/IrcStates/Numeric.cs b/IRCStates/Numeric.cs similarity index 99% rename from IrcStates/Numeric.cs rename to IRCStates/Numeric.cs index 8639c12..1ccbd76 100644 --- a/IrcStates/Numeric.cs +++ b/IRCStates/Numeric.cs @@ -1,6 +1,6 @@ // ReSharper disable InconsistentNaming -namespace IrcStates +namespace IRCStates { public static class Numeric { diff --git a/IrcStates/README.md b/IRCStates/README.md similarity index 100% rename from IrcStates/README.md rename to IRCStates/README.md diff --git a/IrcStates/Server.cs b/IRCStates/Server.cs similarity index 99% rename from IrcStates/Server.cs rename to IRCStates/Server.cs index 2e80b75..2615080 100644 --- a/IrcStates/Server.cs +++ b/IRCStates/Server.cs @@ -3,9 +3,9 @@ using System.Collections.Generic; using System.ComponentModel.Design; using System.Globalization; using System.Linq; -using IrcTokens; +using IRCTokens; -namespace IrcStates +namespace IRCStates { public class Server { diff --git a/IrcStates/ServerDisconnectedException.cs b/IRCStates/ServerDisconnectedException.cs similarity index 81% rename from IrcStates/ServerDisconnectedException.cs rename to IRCStates/ServerDisconnectedException.cs index c3e014f..4d0bab6 100644 --- a/IrcStates/ServerDisconnectedException.cs +++ b/IRCStates/ServerDisconnectedException.cs @@ -1,6 +1,6 @@ using System; -namespace IrcStates +namespace IRCStates { public class ServerDisconnectedException : Exception { diff --git a/IrcStates/ServerException.cs b/IRCStates/ServerException.cs similarity index 79% rename from IrcStates/ServerException.cs rename to IRCStates/ServerException.cs index 7164e76..0f44a88 100644 --- a/IrcStates/ServerException.cs +++ b/IRCStates/ServerException.cs @@ -1,6 +1,6 @@ using System; -namespace IrcStates +namespace IRCStates { public class ServerException : Exception { diff --git a/IrcStates/Tests/Cap.cs b/IRCStates/Tests/Cap.cs similarity index 99% rename from IrcStates/Tests/Cap.cs rename to IRCStates/Tests/Cap.cs index 3ce52f8..3c0faba 100644 --- a/IrcStates/Tests/Cap.cs +++ b/IRCStates/Tests/Cap.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Cap diff --git a/IrcStates/Tests/Casemap.cs b/IRCStates/Tests/Casemap.cs similarity index 91% rename from IrcStates/Tests/Casemap.cs rename to IRCStates/Tests/Casemap.cs index 6022593..4a02444 100644 --- a/IrcStates/Tests/Casemap.cs +++ b/IRCStates/Tests/Casemap.cs @@ -1,7 +1,7 @@ -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Casemap @@ -9,14 +9,14 @@ namespace IrcStates.Tests [TestMethod] public void Rfc1459() { - var lower = IrcStates.Casemap.CaseFold(IrcStates.Casemap.CaseMapping.Rfc1459, @"ÀTEST[]~\"); + var lower = IRCStates.Casemap.CaseFold(IRCStates.Casemap.CaseMapping.Rfc1459, @"ÀTEST[]~\"); Assert.AreEqual("Àtest{}^|", lower); } [TestMethod] public void Ascii() { - var lower = IrcStates.Casemap.CaseFold(IrcStates.Casemap.CaseMapping.Ascii, @"ÀTEST[]~\"); + var lower = IRCStates.Casemap.CaseFold(IRCStates.Casemap.CaseMapping.Ascii, @"ÀTEST[]~\"); Assert.AreEqual(@"Àtest[]~\", lower); } diff --git a/IrcStates/Tests/Channel.cs b/IRCStates/Tests/Channel.cs similarity index 97% rename from IrcStates/Tests/Channel.cs rename to IRCStates/Tests/Channel.cs index 64a845c..6868e0f 100644 --- a/IrcStates/Tests/Channel.cs +++ b/IRCStates/Tests/Channel.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Channel @@ -69,8 +69,8 @@ namespace IrcStates.Tests var chanUser = channel.Users[user.NickNameLower]; Assert.AreEqual(channel.NameLower, user.Channels.Single()); - CollectionAssert.AreEqual(new Dictionary {{"nickname", user}}, _server.Users); - CollectionAssert.AreEqual(new Dictionary {{"#chan", channel}}, _server.Channels); + CollectionAssert.AreEqual(new Dictionary {{"nickname", user}}, _server.Users); + CollectionAssert.AreEqual(new Dictionary {{"#chan", channel}}, _server.Channels); CollectionAssert.AreEqual(new Dictionary {{"nickname", chanUser}}, channel.Users); } diff --git a/IrcStates/Tests/Emit.cs b/IRCStates/Tests/Emit.cs similarity index 98% rename from IrcStates/Tests/Emit.cs rename to IRCStates/Tests/Emit.cs index 15e9e61..07fea8c 100644 --- a/IrcStates/Tests/Emit.cs +++ b/IRCStates/Tests/Emit.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Emit diff --git a/IrcStates/Tests/ISupport.cs b/IRCStates/Tests/ISupport.cs similarity index 95% rename from IrcStates/Tests/ISupport.cs rename to IRCStates/Tests/ISupport.cs index 6cd2f48..5cdcc61 100644 --- a/IrcStates/Tests/ISupport.cs +++ b/IRCStates/Tests/ISupport.cs @@ -1,10 +1,10 @@ using System.Collections.Generic; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; // ReSharper disable InconsistentNaming -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class ISupport @@ -97,9 +97,9 @@ namespace IrcStates.Tests [TestMethod] public void Rfc1459() { - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); _server.Parse(new Line("005 * CASEMAPPING=rfc1459 *")); - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); var lower = _server.CaseFold(@"ÀTEST[]~\"); Assert.AreEqual("Àtest{}^|", lower); } @@ -108,7 +108,7 @@ namespace IrcStates.Tests public void Ascii() { _server.Parse(new Line("005 * CASEMAPPING=ascii *")); - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Ascii, _server.ISupport.CaseMapping); + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Ascii, _server.ISupport.CaseMapping); var lower = _server.CaseFold(@"ÀTEST[]~\"); Assert.AreEqual(@"Àtest[]~\", lower); } @@ -117,7 +117,7 @@ namespace IrcStates.Tests public void FallbackToRfc1459() { _server.Parse(new Line("005 * CASEMAPPING=nonexistent *")); - Assert.AreEqual(IrcStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); + Assert.AreEqual(IRCStates.Casemap.CaseMapping.Rfc1459, _server.ISupport.CaseMapping); var lower = _server.CaseFold(@"ÀTEST[]~\"); Assert.AreEqual("Àtest{}^|", lower); } diff --git a/IrcStates/Tests/Mode.cs b/IRCStates/Tests/Mode.cs similarity index 99% rename from IrcStates/Tests/Mode.cs rename to IRCStates/Tests/Mode.cs index 799afd6..90763fa 100644 --- a/IrcStates/Tests/Mode.cs +++ b/IRCStates/Tests/Mode.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Mode diff --git a/IrcStates/Tests/Motd.cs b/IRCStates/Tests/Motd.cs similarity index 93% rename from IrcStates/Tests/Motd.cs rename to IRCStates/Tests/Motd.cs index 92929a5..2d75982 100644 --- a/IrcStates/Tests/Motd.cs +++ b/IRCStates/Tests/Motd.cs @@ -1,8 +1,8 @@ using System.Collections.Generic; -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Motd diff --git a/IrcStates/Tests/Sasl.cs b/IRCStates/Tests/Sasl.cs similarity index 95% rename from IrcStates/Tests/Sasl.cs rename to IRCStates/Tests/Sasl.cs index f61e2e1..151ccdf 100644 --- a/IrcStates/Tests/Sasl.cs +++ b/IRCStates/Tests/Sasl.cs @@ -1,7 +1,7 @@ -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Sasl diff --git a/IrcStates/Tests/User.cs b/IRCStates/Tests/User.cs similarity index 99% rename from IrcStates/Tests/User.cs rename to IRCStates/Tests/User.cs index 5857cfc..61d7157 100644 --- a/IrcStates/Tests/User.cs +++ b/IRCStates/Tests/User.cs @@ -1,7 +1,7 @@ -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class User diff --git a/IrcStates/Tests/Who.cs b/IRCStates/Tests/Who.cs similarity index 97% rename from IrcStates/Tests/Who.cs rename to IRCStates/Tests/Who.cs index 7e4e323..d091785 100644 --- a/IrcStates/Tests/Who.cs +++ b/IRCStates/Tests/Who.cs @@ -1,7 +1,7 @@ -using IrcTokens; +using IRCTokens; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcStates.Tests +namespace IRCStates.Tests { [TestClass] public class Who diff --git a/IrcStates/User.cs b/IRCStates/User.cs similarity index 97% rename from IrcStates/User.cs rename to IRCStates/User.cs index 7df331b..5e18443 100644 --- a/IrcStates/User.cs +++ b/IRCStates/User.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace IrcStates +namespace IRCStates { public class User { diff --git a/IrcTokens/Extensions.cs b/IRCTokens/Extensions.cs similarity index 99% rename from IrcTokens/Extensions.cs rename to IRCTokens/Extensions.cs index 4b23774..e346a43 100644 --- a/IrcTokens/Extensions.cs +++ b/IRCTokens/Extensions.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq; -namespace IrcTokens +namespace IRCTokens { public static class Extensions { diff --git a/IrcTokens/Hostmask.cs b/IRCTokens/Hostmask.cs similarity index 98% rename from IrcTokens/Hostmask.cs rename to IRCTokens/Hostmask.cs index 3c0b7f2..2e1549a 100644 --- a/IrcTokens/Hostmask.cs +++ b/IRCTokens/Hostmask.cs @@ -1,6 +1,6 @@ using System; -namespace IrcTokens +namespace IRCTokens { /// /// Represents the three parts of a hostmask. Parse with the constructor. diff --git a/IrcTokens/IrcTokens.csproj b/IRCTokens/IRCTokens.csproj similarity index 100% rename from IrcTokens/IrcTokens.csproj rename to IRCTokens/IRCTokens.csproj diff --git a/IrcTokens/Line.cs b/IRCTokens/Line.cs similarity index 99% rename from IrcTokens/Line.cs rename to IRCTokens/Line.cs index 36899bf..bf3cc91 100644 --- a/IrcTokens/Line.cs +++ b/IRCTokens/Line.cs @@ -4,7 +4,7 @@ using System.Globalization; using System.Linq; using System.Text; -namespace IrcTokens +namespace IRCTokens { /// /// Tools to represent, parse, and format IRC lines diff --git a/IrcTokens/README.md b/IRCTokens/README.md similarity index 98% rename from IrcTokens/README.md rename to IRCTokens/README.md index 3981654..d3769aa 100644 --- a/IrcTokens/README.md +++ b/IRCTokens/README.md @@ -1,4 +1,4 @@ -# irctokens +# IRCTokens this is a c\# port of jesopo's [irctokens]( https://github.com/jesopo/irctokens) @@ -7,7 +7,7 @@ https://github.com/jesopo/irctokens) ### tokenization - using IrcTokens; + using IRCTokens; ... diff --git a/IrcTokens/StatefulDecoder.cs b/IRCTokens/StatefulDecoder.cs similarity index 99% rename from IrcTokens/StatefulDecoder.cs rename to IRCTokens/StatefulDecoder.cs index 1f6636b..82630f6 100644 --- a/IrcTokens/StatefulDecoder.cs +++ b/IRCTokens/StatefulDecoder.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace IrcTokens +namespace IRCTokens { public class StatefulDecoder { diff --git a/IrcTokens/StatefulEncoder.cs b/IRCTokens/StatefulEncoder.cs similarity index 98% rename from IrcTokens/StatefulEncoder.cs rename to IRCTokens/StatefulEncoder.cs index bec4e42..46949dd 100644 --- a/IrcTokens/StatefulEncoder.cs +++ b/IRCTokens/StatefulEncoder.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace IrcTokens +namespace IRCTokens { public class StatefulEncoder { diff --git a/IrcTokens/Tests/Data/JoinModel.cs b/IRCTokens/Tests/Data/JoinModel.cs similarity index 95% rename from IrcTokens/Tests/Data/JoinModel.cs rename to IRCTokens/Tests/Data/JoinModel.cs index 2c08e58..e54f4cf 100644 --- a/IrcTokens/Tests/Data/JoinModel.cs +++ b/IRCTokens/Tests/Data/JoinModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using YamlDotNet.Serialization; -namespace IrcTokens.Tests.Data +namespace IRCTokens.Tests.Data { public class JoinModel { diff --git a/IrcTokens/Tests/Data/SplitModel.cs b/IRCTokens/Tests/Data/SplitModel.cs similarity index 89% rename from IrcTokens/Tests/Data/SplitModel.cs rename to IRCTokens/Tests/Data/SplitModel.cs index 65177a3..5386326 100644 --- a/IrcTokens/Tests/Data/SplitModel.cs +++ b/IRCTokens/Tests/Data/SplitModel.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace IrcTokens.Tests.Data +namespace IRCTokens.Tests.Data { public class SplitModel { diff --git a/IrcTokens/Tests/Data/msg-join.yaml b/IRCTokens/Tests/Data/msg-join.yaml similarity index 100% rename from IrcTokens/Tests/Data/msg-join.yaml rename to IRCTokens/Tests/Data/msg-join.yaml diff --git a/IrcTokens/Tests/Data/msg-split.yaml b/IRCTokens/Tests/Data/msg-split.yaml similarity index 100% rename from IrcTokens/Tests/Data/msg-split.yaml rename to IRCTokens/Tests/Data/msg-split.yaml diff --git a/IrcTokens/Tests/Format.cs b/IRCTokens/Tests/Format.cs similarity index 99% rename from IrcTokens/Tests/Format.cs rename to IRCTokens/Tests/Format.cs index 69a5682..8319069 100644 --- a/IrcTokens/Tests/Format.cs +++ b/IRCTokens/Tests/Format.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class Format diff --git a/IrcTokens/Tests/Hostmask.cs b/IRCTokens/Tests/Hostmask.cs similarity index 84% rename from IrcTokens/Tests/Hostmask.cs rename to IRCTokens/Tests/Hostmask.cs index 6a5cf65..2446013 100644 --- a/IrcTokens/Tests/Hostmask.cs +++ b/IRCTokens/Tests/Hostmask.cs @@ -1,6 +1,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class Hostmask @@ -8,7 +8,7 @@ namespace IrcTokens.Tests [TestMethod] public void TestHostmask() { - var hostmask = new IrcTokens.Hostmask("nick!user@host"); + var hostmask = new IRCTokens.Hostmask("nick!user@host"); Assert.AreEqual("nick", hostmask.NickName); Assert.AreEqual("user", hostmask.UserName); Assert.AreEqual("host", hostmask.HostName); @@ -17,7 +17,7 @@ namespace IrcTokens.Tests [TestMethod] public void TestNoHostName() { - var hostmask = new IrcTokens.Hostmask("nick!user"); + var hostmask = new IRCTokens.Hostmask("nick!user"); Assert.AreEqual("nick", hostmask.NickName); Assert.AreEqual("user", hostmask.UserName); Assert.IsNull(hostmask.HostName); @@ -26,7 +26,7 @@ namespace IrcTokens.Tests [TestMethod] public void TestNoUserName() { - var hostmask = new IrcTokens.Hostmask("nick@host"); + var hostmask = new IRCTokens.Hostmask("nick@host"); Assert.AreEqual("nick", hostmask.NickName); Assert.IsNull(hostmask.UserName); Assert.AreEqual("host", hostmask.HostName); @@ -35,7 +35,7 @@ namespace IrcTokens.Tests [TestMethod] public void TestOnlyNickName() { - var hostmask = new IrcTokens.Hostmask("nick"); + var hostmask = new IRCTokens.Hostmask("nick"); Assert.AreEqual("nick", hostmask.NickName); Assert.IsNull(hostmask.UserName); Assert.IsNull(hostmask.HostName); @@ -45,7 +45,7 @@ namespace IrcTokens.Tests public void TestHostmaskFromLine() { var line = new Line(":nick!user@host PRIVMSG #channel hello"); - var hostmask = new IrcTokens.Hostmask("nick!user@host"); + var hostmask = new IRCTokens.Hostmask("nick!user@host"); Assert.AreEqual(hostmask.ToString(), line.Hostmask.ToString()); Assert.AreEqual("nick", line.Hostmask.NickName); Assert.AreEqual("user", line.Hostmask.UserName); diff --git a/IrcTokens/Tests/Parser.cs b/IRCTokens/Tests/Parser.cs similarity index 97% rename from IrcTokens/Tests/Parser.cs rename to IRCTokens/Tests/Parser.cs index ed4e406..bd0a92d 100644 --- a/IrcTokens/Tests/Parser.cs +++ b/IRCTokens/Tests/Parser.cs @@ -1,12 +1,12 @@ using System.Collections.Generic; using System.Globalization; using System.IO; -using IrcTokens.Tests.Data; +using IRCTokens.Tests.Data; using Microsoft.VisualStudio.TestTools.UnitTesting; using YamlDotNet.Serialization; using YamlDotNet.Serialization.NamingConventions; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class Parser diff --git a/IrcTokens/Tests/StatefulDecoder.cs b/IRCTokens/Tests/StatefulDecoder.cs similarity index 90% rename from IrcTokens/Tests/StatefulDecoder.cs rename to IRCTokens/Tests/StatefulDecoder.cs index 9d2b8b7..d37310f 100644 --- a/IrcTokens/Tests/StatefulDecoder.cs +++ b/IRCTokens/Tests/StatefulDecoder.cs @@ -2,17 +2,17 @@ using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class StatefulDecoder { - private IrcTokens.StatefulDecoder _decoder; + private IRCTokens.StatefulDecoder _decoder; [TestInitialize] public void TestInitialize() { - _decoder = new IrcTokens.StatefulDecoder(); + _decoder = new IRCTokens.StatefulDecoder(); } [TestMethod] @@ -44,7 +44,7 @@ namespace IrcTokens.Tests public void TestEncoding() { var iso8859 = Encoding.GetEncoding("iso-8859-1"); - _decoder = new IrcTokens.StatefulDecoder {Encoding = iso8859}; + _decoder = new IRCTokens.StatefulDecoder {Encoding = iso8859}; var bytes = iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"); var lines = _decoder.Push(bytes, bytes.Length); var line = new Line("PRIVMSG #channel :hello Ç"); @@ -55,7 +55,7 @@ namespace IrcTokens.Tests public void TestEncodingFallback() { var latin1 = Encoding.GetEncoding("iso-8859-1"); - _decoder = new IrcTokens.StatefulDecoder {Encoding = null, Fallback = latin1}; + _decoder = new IRCTokens.StatefulDecoder {Encoding = null, Fallback = latin1}; var bytes = latin1.GetBytes("PRIVMSG #channel hélló\r\n"); var lines = _decoder.Push(bytes, bytes.Length); Assert.AreEqual(1, lines.Count); diff --git a/IrcTokens/Tests/StatefulEncoder.cs b/IRCTokens/Tests/StatefulEncoder.cs similarity index 92% rename from IrcTokens/Tests/StatefulEncoder.cs rename to IRCTokens/Tests/StatefulEncoder.cs index f2cd6c4..5ced4d2 100644 --- a/IrcTokens/Tests/StatefulEncoder.cs +++ b/IRCTokens/Tests/StatefulEncoder.cs @@ -1,17 +1,17 @@ using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class StatefulEncoder { - private IrcTokens.StatefulEncoder _encoder; + private IRCTokens.StatefulEncoder _encoder; [TestInitialize] public void TestInitialize() { - _encoder = new IrcTokens.StatefulEncoder(); + _encoder = new IRCTokens.StatefulEncoder(); } [TestMethod] @@ -76,7 +76,7 @@ namespace IrcTokens.Tests public void TestEncoding() { var iso8859 = Encoding.GetEncoding("iso-8859-1"); - _encoder = new IrcTokens.StatefulEncoder {Encoding = iso8859}; + _encoder = new IRCTokens.StatefulEncoder {Encoding = iso8859}; _encoder.Push(new Line("PRIVMSG #channel :hello Ç")); CollectionAssert.AreEqual(iso8859.GetBytes("PRIVMSG #channel :hello Ç\r\n"), _encoder.PendingBytes); } diff --git a/IrcTokens/Tests/Tokenization.cs b/IRCTokens/Tests/Tokenization.cs similarity index 99% rename from IrcTokens/Tests/Tokenization.cs rename to IRCTokens/Tests/Tokenization.cs index 7e2139d..03959de 100644 --- a/IrcTokens/Tests/Tokenization.cs +++ b/IRCTokens/Tests/Tokenization.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using Microsoft.VisualStudio.TestTools.UnitTesting; -namespace IrcTokens.Tests +namespace IRCTokens.Tests { [TestClass] public class Tokenization diff --git a/IrcStates/Extensions.cs b/IrcStates/Extensions.cs deleted file mode 100644 index 181ac80..0000000 --- a/IrcStates/Extensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; - -namespace IrcStates -{ - public static class Extensions - { - public static Delegate CreateDelegate(this MethodInfo methodInfo, object target) - { - if (methodInfo == null) return null; - - var types = methodInfo.GetParameters().Select(p => p.ParameterType); - - Func getType; - if (methodInfo.ReturnType == typeof(void)) - { - getType = Expression.GetActionType; - } - else - { - getType = Expression.GetFuncType; - types = types.Concat(new[] {methodInfo.ReturnType}); - } - - return methodInfo.IsStatic - ? Delegate.CreateDelegate(getType(types.ToArray()), methodInfo) - : Delegate.CreateDelegate(getType(types.ToArray()), target, methodInfo); - } - - public static void UpdateWith(this Dictionary dict, Dictionary other) - { - if (dict == null || other == null || !other.Any()) return; - - foreach (var (key, value) in other) dict[key] = value; - } - } -} diff --git a/README.md b/README.md index 1796da2..d012c78 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# IrcSharp +# IRCSharp [![Build Status](https://drone.tildegit.org/api/badges/ben/ircsharp/status.svg)](https://drone.tildegit.org/ben/ircsharp)