Skip to content

Commit

Permalink
Fix NuGet package; prepare for version 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Dec 14, 2015
1 parent 06b0d37 commit 1bb7f24
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 30 deletions.
11 changes: 9 additions & 2 deletions CBOR.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>PeterO.Cbor</id>
<version>2.3.0</version>
<version>2.3.1</version>
<title>CBOR</title>
<authors>Peter Occil</authors>
<owners>Peter Occil</owners>
Expand All @@ -16,6 +16,8 @@
</description>
<summary>A C# implementation of Concise Binary Object Representation (CBOR), a data serialization format. This implementation can also convert between CBOR and JSON.</summary>
<releaseNotes>
In version 2.3.1:
- Fixed NuGet package
In version 2.3:
- The C# version of the library now also targets "dotnet", which should make it compatible with platform .NET runtime
environments such as the upcoming cross-platform "coreclr" runtime.
Expand All @@ -30,7 +32,6 @@ See the project page for release notes on previous versions: https://github.com/
<tags>cbor data serialization binary json numbers arithmetic</tags>
<dependencies>
<group targetFramework="dotnet">
<dependency id="System.Text.Encoding" version="4.0.0" />
<dependency id="System.Collections" version="4.0.0" />
<dependency id="System.Diagnostics.Debug" version="4.0.0" />
<dependency id="System.Globalization" version="4.0.0" />
Expand All @@ -43,4 +44,10 @@ See the project page for release notes on previous versions: https://github.com/
</group>
</dependencies>
</metadata>
<files>
<file src="bin/Release/Encoding.dll" target="lib/portable-net45+dnxcore50+netcore45+win+wpa81+wp80" />
<file src="bin/Release/Encoding.xml" target="lib/portable-net45+dnxcore50+netcore45+win+wpa81+wp80" />
<file src="Encoding-Net4/bin/Release/Encoding.dll" target="lib/portable-net40+sl50+win+wpa81+wp80" />
<file src="Encoding-Net4/bin/Release/Encoding.xml" target="lib/portable-net40+sl50+win+wpa81+wp80" />
</files>
</package>
5 changes: 3 additions & 2 deletions CBORTest/CBORObjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1790,8 +1790,9 @@ public void TestFromJSONString() {
}
string jsonTemp = TestCommon.Repeat(
"[",
2000) + TestCommon.Repeat("]",
2000);
2000) + TestCommon.Repeat(
"]",
2000);
try {
CBORObject.FromJSONString(jsonTemp);
Assert.Fail("Should have failed");
Expand Down
9 changes: 5 additions & 4 deletions CBORTest/DataUtilitiesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,10 @@ public void TestCodePointBefore() {
Assert.AreEqual(
0xd800,
DataUtilities.CodePointBefore("A\ud800\udc00B", 2, 1));
Assert.AreEqual(
-1,
DataUtilities.CodePointBefore("A\ud800\udc00B" , 2, 2));
{
long numberTemp = DataUtilities.CodePointBefore("A\ud800\udc00B" , 2, 2);
Assert.AreEqual(-1, numberTemp);
}
Assert.AreEqual(0xfffd, DataUtilities.CodePointBefore("\udc00B", 1));
Assert.AreEqual(0xdc00, DataUtilities.CodePointBefore("\udc00B", 1, 1));
Assert.AreEqual(-1, DataUtilities.CodePointBefore("\udc00B", 1, 2));
Expand Down Expand Up @@ -257,7 +258,7 @@ public static String Repeat(String c, int num) {
private void TestUtf8RoundTrip(string str) {
Assert.AreEqual(
str,
DataUtilities.GetUtf8String( DataUtilities.GetUtf8Bytes(str, true), true));
DataUtilities.GetUtf8String(DataUtilities.GetUtf8Bytes(str, true), true));
}

[Test]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Written by Peter O. in 2013-2014. In the public domain.
Written by Peter O. in 2013-2015. In the public domain.

Public domain dedication: [http://creativecommons.org/publicdomain/zero/1.0/](http://creativecommons.org/publicdomain/zero/1.0/)
14 changes: 0 additions & 14 deletions PeterO/Cbor/CBOREncodeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,6 @@ public int Value {
}
}

/// <summary>Not documented yet.</summary>
/// <param name='other'>An arbitrary object.</param>
/// <returns>A Boolean object.</returns>
public override bool Equals(object other) {
var enc = other as CBOREncodeOptions;
return (enc == null) ? (false) : (enc.Value == this.Value);
}

/// <summary>Not documented yet.</summary>
/// <returns>A 32-bit signed integer.</returns>
public override int GetHashCode() {
return this.Value;
}

private CBOREncodeOptions(int value) {
this.value = value;
}
Expand Down
14 changes: 10 additions & 4 deletions PeterO/Cbor/CBORObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,8 +1065,7 @@ public static CBORObject FromObject<TKey, TValue>(IDictionary<TKey,
/// following types are specially handled by this method: null ,
/// primitive types, strings, CBORObject , ExtendedDecimal ,
/// ExtendedFloat , ExtendedRational, the custom BigInteger , lists,
/// arrays, enumerations ( <c>Enum</c> objects), maps, and types with a
/// registered CBOR type converter.
/// arrays, enumerations ( <c>Enum</c> objects), and maps.
/// <para>In the .NET version, if the object is a type not specially
/// handled by this method, returns a CBOR map with the values of each
/// of its read/write properties (or all properties in the case of an
Expand Down Expand Up @@ -3424,8 +3423,15 @@ internal static ICBORTag FindTagConverter(BigInteger bigintTag) {
AddTagHandler((BigInteger)30, new CBORTag30());
}
lock (tagHandlers) {
return (tagHandlers.ContainsKey(bigintTag)) ?
(tagHandlers[bigintTag]) : (null);
if (tagHandlers.ContainsKey(bigintTag)) {
return tagHandlers[bigintTag];
}
#if DEBUG
if (bigintTag.Equals((BigInteger)2)) {
throw new InvalidOperationException("Expected valid tag handler");
}
#endif
return null;
}
}

Expand Down
4 changes: 2 additions & 2 deletions PeterO/DataUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public static long GetUtf8Length(String str, bool replace) {
/// <returns>The Unicode code point at the previous position. Returns
/// -1 if <paramref name='index'/> is 0 or less, or is greater than the
/// string's length. Returns the replacement character (U + FFFD) if
/// the previous code unit is an unpaired surrogate code
/// the previous character is an unpaired surrogate code
/// point.</returns>
/// <exception cref='ArgumentNullException'>The parameter <paramref
/// name='str'/> is null.</exception>
Expand All @@ -212,7 +212,7 @@ public static int CodePointBefore(string str, int index) {
/// <param name='index'>Index of the current position into the
/// string.</param>
/// <param name='surrogateBehavior'>Specifies what kind of value to
/// return if the previous code unit is an unpaired surrogate code
/// return if the previous character is an unpaired surrogate code
/// point: if 0, return the replacement character (U + FFFD); if 1,
/// return the value of the surrogate code point; if neither 0 nor 1,
/// return -1.</param>
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Any copyright is dedicated to the Public Domain.
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("3.0.0")]
[assembly: AssemblyVersion("2.3.1")]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ The following are some clarifications to RFC 7049.
Release Notes
-----------

In version 2.3.1 (.NET version only):

- Fixed NuGet package

In version 2.3:

- The C# version of the library now also targets "dotnet", which should make it compatible with platform .NET runtime
Expand Down

0 comments on commit 1bb7f24

Please sign in to comment.