Skip to content

Commit c2eb3f8

Browse files
committed
Fixes FilterDbCollection parametered constructor
Fixes #15 Adds XML documentation to the nuget package. Bump to version 1.4.5.
1 parent 5f49001 commit c2eb3f8

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

DistillNET/DistillNET/DistillNET.csproj

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@
99
<RepositoryUrl>https://github.com/TechnikEmpire/DistillNET</RepositoryUrl>
1010
<Description>DistillNET is a library for matching and filtering HTTP requests and HTML response content using the Adblock Plus Filter format.</Description>
1111
<Copyright>Copyright © 2017 Jesse Nicholson</Copyright>
12-
<Version>1.4.4</Version>
12+
<Version>1.4.5</Version>
1313
<Authors>Jesse Nicholson</Authors>
1414
<Company>Technik Empire</Company>
1515
<PackageTags>DistillNET Adblock AdblockPlus Adblock-Plus URL-Filter URL-Filtering Content-Filter Filter</PackageTags>
16-
<PackageReleaseNotes>Fixes several bugs affecting both performance and matching accuracy. We are back to pre-.NET Standard migration performance.</PackageReleaseNotes>
16+
<PackageReleaseNotes>Fixes a bug where, when using the FilterDbCollection constructor that takes parameters, if you specified to use an in-memory database, the database was not configured correctly.
17+
18+
Package also now bundles XML documentation.</PackageReleaseNotes>
19+
</PropertyGroup>
20+
21+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
22+
<DocumentationFile>bin\Release\netstandard2.0\DistillNET.xml</DocumentationFile>
23+
</PropertyGroup>
24+
25+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
26+
<DocumentationFile>bin\Debug\netstandard2.0\DistillNET.xml</DocumentationFile>
1727
</PropertyGroup>
1828

1929
<ItemGroup>

DistillNET/DistillNET/DistillNET/FilterDbCollection.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,16 @@ public FilterDbCollection(string dbAbsolutePath, bool overwrite = true, bool use
9797

9898
if(useMemory)
9999
{
100+
var version = typeof(FilterDbCollection).Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
101+
var rnd = new Random();
102+
var rndNum = rnd.Next();
103+
var generatedDbName = string.Format("{0} {1} - {2}", nameof(FilterDbCollection), version, rndNum);
104+
100105
// "Data Source = :memory:; Cache = shared;"
101106
var cb = new SqliteConnectionStringBuilder();
102107
cb.Mode = SqliteOpenMode.Memory;
103108
cb.Cache = SqliteCacheMode.Shared;
104-
Console.WriteLine(cb.ToString());
109+
cb.DataSource = generatedDbName;
105110
m_connection = new SqliteConnection(cb.ToString());
106111
}
107112
else

DistillNET/Tests/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private static void Main(string[] args)
106106

107107
//var dbOutPath = AppDomain.CurrentDomain.BaseDirectory + "Test.db";
108108
//var filterCollection = new FilterDbCollection(dbOutPath);
109-
var filterCollection = new FilterDbCollection();
109+
var filterCollection = new FilterDbCollection(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "rules.db"), true, true);
110110

111111
var adultFileStream = File.OpenRead(adultDomainsPath);
112112
var easylistFileStream = File.OpenRead(easylistPath);

DistillNET/Tests/Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</ItemGroup>
6767
<ItemGroup>
6868
<PackageReference Include="DistillNET">
69-
<Version>1.4.4</Version>
69+
<Version>1.4.5</Version>
7070
</PackageReference>
7171
<PackageReference Include="Microsoft.Data.SQLite">
7272
<Version>2.0.0</Version>

0 commit comments

Comments
 (0)