GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — https/tests/https.Tests at publish · joncloud/https

Expand file tree

/

https.Tests

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

https.Tests

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
CertificateTests.cs
CertificateTests.cs
 
 
ContentTypeTests.cs
ContentTypeTests.cs
 
 
Https.cs
Https.cs
 
 
HttpsCsprojFixture.cs
HttpsCsprojFixture.cs
 
 
HttpsResult.cs
HttpsResult.cs
 
 
MethodTests.cs
MethodTests.cs
 
 
MirrorMiddleware.cs
MirrorMiddleware.cs
 
 
Readme.cs
Readme.cs
 
 
ReadmeFixture.cs
ReadmeFixture.cs
 
 
ReadmeTests.cs
ReadmeTests.cs
 
 
RedirectMiddleware.cs
RedirectMiddleware.cs
 
 
RedirectTests.cs
RedirectTests.cs
 
 
Startup.cs
Startup.cs
 
 
TimeoutMiddleware.cs
TimeoutMiddleware.cs
 
 
TimeoutTests.cs
TimeoutTests.cs
 
 
VersionTests.cs
VersionTests.cs
 
 
WebHostFixture.cs
WebHostFixture.cs
 
 
https.Tests.csproj
https.Tests.csproj
 
 

Readme.cs

using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;

namespace Https.Tests
{
    public class Readme
    {
        public string InstallationVersion { get; }
        public string UsageDocumentation { get; }

        public Readme(string path)
        {
            if (string.IsNullOrWhiteSpace(path)) throw new ArgumentNullException(nameof(path));

            var sb = new StringBuilder();
            InstallationVersion = "";
            UsageDocumentation = "";

            var lines = File.ReadLines(path);
            var record = false;
            foreach (var line in lines)
            {
               
                if (line.StartsWith("```bash"))
                {
                    record = true;
                }
                else if (line.StartsWith("```"))
                {
                    var text = sb.ToString();
                    sb.Clear();

                    if (text.StartsWith("dotnet tool"))
                    {
                        var match = Regex.Match(text, "dotnet tool install --global https --version (.+)-\\*");
                        if (match.Success)
                        {
                            InstallationVersion = match.Groups[1].Value;
                        }
                    }
                    else if (text.StartsWith("Usage"))
                    {
                        UsageDocumentation = text;
                    }

                    record = false;
                }
                else if (record)
                {
                    sb.AppendLine(line);
                }
            }
        }
    }
}
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.