Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0 Major release (#16) #20

Merged
merged 1 commit into from
Nov 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
Slugify Core
=======

### This is a fork of the original project here: [https://github.com/fcingolani/Slugify](https://github.com/fcingolani/Slugify). This has been updated for .Net Standard 1.3 support
### This is a fork of the original project here: [https://github.com/fcingolani/Slugify](https://github.com/fcingolani/Slugify). This has been updated for .NET Standard 2.0 support (older versions support .NET Standard down to 1.3).

| Platform | Status|
|---------|-------|
|Windows | [![Build status](https://img.shields.io/appveyor/ci/soda-digital/slugify.svg?maxAge=2000)](https://ci.appveyor.com/project/Soda-Digital/slugify) |
|Linux| [![Build Status](https://img.shields.io/travis/ctolkien/Slugify.svg?maxAge=2000)](https://travis-ci.org/ctolkien/Slugify) |

[![Build Status](https://dev.azure.com/chadtolkien/Slugify/_apis/build/status/ctolkien.Slugify?branchName=master)](https://dev.azure.com/chadtolkien/Slugify/_build/latest?definitionId=6&branchName=master)
[![codecov](https://codecov.io/gh/ctolkien/Slugify/branch/master/graph/badge.svg)](https://codecov.io/gh/ctolkien/Slugify)
![Version](https://img.shields.io/nuget/v/slugify.core.svg?maxAge=2000)
[![license](https://img.shields.io/github/license/ctolkien/Slugify.svg?maxAge=2592000)]()
Expand All @@ -33,6 +30,12 @@ You can get the [Slugify NuGet package](https://www.nuget.org/packages/Slugify.C
PM> Install-Package Slugify.Core
```

Upgrading from 2.x to 3.x
-------------------------

* 3.0 is a significantly faster and less memory intensive version of the Slugifier. Whilst effort has been made to maintain backwards compatability, there may be some breaking changes.
* The `SlugHelper.Config` nested class has been renamed to just `SlugHelperConfig`.


Basic Usage
-----------
Expand Down Expand Up @@ -62,11 +65,11 @@ public class MyApp
Configuration
-------------

You can provide a _SlugHelper.Config_ instance to _SlugHelper_'s constructor to customize the helper's behavior:
You can provide a _SlugHelperConfig_ instance to _SlugHelper_'s constructor to customize the helper's behavior:

```csharp
// Creating a configuration object
SlugHelper.Config config = new SlugHelper.Config();
var config = new SlugHelperConfig();

// Replace spaces with a dash
config.StringReplacements.Add(" ", "-");
Expand All @@ -93,11 +96,11 @@ SlugHelper helper = new SlugHelper(config);
In fact, the above values are so common they're the default ones! So last code could be rewritten as:

```csharp
SlugHelper.Config config = new SlugHelper.Config();
var config = new SlugHelperConfig();
SlugHelper helper = new SlugHelper(config);
```

One more thing: _SlugHelper.Config_ is used when you call the parameterless _SlugHelper_ constructor. Then ...
One more thing: _SlugHelperConfig_ is used when you call the parameterless _SlugHelper_ constructor. Then ...

```csharp
SlugHelper helper = new SlugHelper();
Expand Down
22 changes: 20 additions & 2 deletions Slugify.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.4
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{321AAEAA-F675-4B15-80B5-3FF2E6A15602}"
EndProject
Expand All @@ -10,6 +10,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slugify.Core", "src\Slugify
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slugify.Core.Tests", "tests\Slugify.Core.Tests\Slugify.Core.Tests.csproj", "{A3717955-9FC4-41EB-B389-1A610D64B3B6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Slugify.Core.Benchmarks", "tests\Slugify.Core.Benchmarks\Slugify.Core.Benchmarks.csproj", "{A859F823-7992-4820-905C-640F3440BAF2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -44,12 +46,28 @@ Global
{A3717955-9FC4-41EB-B389-1A610D64B3B6}.Release|x64.Build.0 = Release|Any CPU
{A3717955-9FC4-41EB-B389-1A610D64B3B6}.Release|x86.ActiveCfg = Release|Any CPU
{A3717955-9FC4-41EB-B389-1A610D64B3B6}.Release|x86.Build.0 = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|x64.ActiveCfg = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|x64.Build.0 = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|x86.ActiveCfg = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Debug|x86.Build.0 = Debug|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|Any CPU.Build.0 = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|x64.ActiveCfg = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|x64.Build.0 = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|x86.ActiveCfg = Release|Any CPU
{A859F823-7992-4820-905C-640F3440BAF2}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{CC5D3071-57A3-442C-8ACC-E543DA0A8E20} = {321AAEAA-F675-4B15-80B5-3FF2E6A15602}
{A3717955-9FC4-41EB-B389-1A610D64B3B6} = {28DEE6D8-053D-4364-9DD5-F3744E58CF54}
{A859F823-7992-4820-905C-640F3440BAF2} = {28DEE6D8-053D-4364-9DD5-F3744E58CF54}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {189B8864-9AE7-4F2D-BFAC-5368F94F26E2}
EndGlobalSection
EndGlobal
39 changes: 0 additions & 39 deletions appveyor.yml

This file was deleted.

83 changes: 83 additions & 0 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

variables:
buildConfiguration: 'Release'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

stages:
- stage: Build
jobs:
- job:
displayName: "Building and Test for"
strategy:
matrix:
Windows:
vmImage: 'windows-latest'
Ubuntu:
vmImage: 'ubuntu-latest'
Mac:
vmImage: 'macOS-latest'
pool:
vmImage: $(vmImage)
steps:
# - task: UseDotNet@2
# displayName: "Install SDK v3.1"
# inputs:
# version: 3.1.x
- task: DotNetCoreCLI@2
displayName: "Build Solution"
inputs:
command: build
arguments: '-c $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: "Test"
inputs:
command: test
arguments: '-c $(buildConfiguration)'
publishTestResults: false
condition: and(succeeded(), eq(variables.vmImage, 'macOS-latest'))
- task: DotNetCoreCLI@2
displayName: "Test"
inputs:
command: test
arguments: '-c $(buildConfiguration) --collect "Code Coverage"'
condition: and(succeeded(), eq(variables.vmImage, 'windows-latest'))

- task: DotNetCoreCLI@2
displayName: "Test"
inputs:
command: test
arguments: '-c $(buildConfiguration) --collect "XPlat Code Coverage"'
publishTestResults: false
condition: and(succeeded(), eq(variables.vmImage, 'ubuntu-latest'))
- script: |
bash <(curl -s https://codecov.io/bash) -f $(Agent.TempDirectory)/**/*.xml -d
displayName: 'Upload to codecov.io'
condition: and(succeeded(), eq(variables.vmImage, 'ubuntu-latest'))
- task: DotNetCoreCLI@2
displayName: "Pack Nuget"
condition: and(succeeded(), eq(variables.vmImage, 'ubuntu-latest'))
inputs:
command: pack
arguments: '-c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), eq(variables.vmImage, 'ubuntu-latest'))
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: drop
- stage: Deploy
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/release'))
jobs:
- deployment:
environment: Nuget
strategy:
runOnce:
deploy:
steps:
- task: NuGetCommand@2
displayName: 'NuGet push'
inputs:
command: 'push'
packagesToPush: '$(Pipeline.Workspace)/**/*.nupkg;'
nuGetFeedType: 'external'
publishFeedCredentials: 'Nuget.Org'
12 changes: 12 additions & 0 deletions coverlet.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Exclude>[*.Tests]*,</Exclude> <!-- [Assembly-Filter]Type-Filter -->
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading