Browse Source

Merge pull request #5 from CraigOates/0.4

0.4
master
Craig Oates 6 years ago committed by GitHub
parent
commit
7ec51e857e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      .github/Images/repo-banner.png
  2. BIN
      .github/Images/screenshot-1.png
  3. BIN
      .github/Images/screenshot-2.PNG
  4. BIN
      .github/Images/solution-structure.png
  5. 85
      README.md
  6. 42
      SmoulderingBeachBall/AssemblyInfo.fs
  7. 18
      SmoulderingBeachBall/Domain.fs
  8. 7
      SmoulderingBeachBall/Services.fs
  9. 1
      SmoulderingBeachBall/SmoulderingBeachBall.fsproj
  10. 14
      SmoulderingBeachBallCLI/AssemblyInfo.fs
  11. 11
      SmoulderingBeachBallCLI/ConsoleCommands.fs

BIN
.github/Images/repo-banner.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
.github/Images/screenshot-1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
.github/Images/screenshot-2.PNG

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
.github/Images/solution-structure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

85
README.md

@ -1,2 +1,83 @@
# Smouldering-Beach-Ball
A F# project for creating placeholder images. Then intention is to create a NuGet package and a console program.
# ![repo-banner](B:\Work\SmoulderingBeachBall\readme\attachments\repo-banner.png)
**Note: This project is a work in-progress. Doc's might be out-of-date.**
## Summary
Smouldering Beach Ball consists of  a .Net Standard 2.0 library, a console program and a "Test Centre". The purpose of this repository is to provide a way for people to create placeholder images. It does this by making the library available as a NuGet and providing a console program. The console program is useful for those needing access to the functionality and not the code. If you are one of the people wanting the features and not the code, I recommend downloading the CLI in [Releases](https://github.com/CraigOates/Smouldering-Beach-Ball/releases). It is a standard alone program so there is no install "concerns".
### Pre-Requisites
* Visual Studio 2017
* F#
* xUnit
* FsCheck
* Console.Waterworks
* .Net 4.7
* .Net Standard
![solution-structure](.github/Images/solution-structure.png)
## Smouldering Beach Ball (Library/NuGet Package)
This is a F# .Net Standard library. You can install this package from two places:
1. [MyGet](https://www.myget.org/feed/the-immutable-null/package/nuget/SmoulderingBeachBall): This is the test-bed for the NuGet packages before they make there way over to nuget.org. The packages are less stable but they are where you will the latest bits to test out. If you are unsure how to subscribe to a MyGet feed, click [here](http://docs.myget.org/docs/walkthrough/getting-started-with-nuget).
2. [NuGet](https://www.nuget.org/profiles/Craig.Oates): This is the official host for NuGets. Download Smouldering Beach Ball from this feed for the most stable releases.
You can add Smouldering Beach Ball to your project via the following commands:
```powershell
// Using the built-in Package Manager console in Visual Studio.
// Also, remove the "< >" when inserting the package version.
// MyGet
PM> Install-Package SmoulderingBeachBall -Version <insert package here> -Source https://www.myget.org/F/the-immutable-null/api/v3/index.json 
// NuGet
PM> Install-Package SmoulderingBeachBall -Version <insert package here>
```
For further information about this project, please visit the [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki).
## Smouldering Beach Ball CLI
This project is an F# console program, uses .Net 4.7\. You use it by entering commands and awaiting the result. It uses [Console.Waterworks](https://github.com/CraigOates/Console.Waterworks) to parse the commands so, if you want to extend it, I recommend you read its [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki). If you want to get going straight away, I recommend using the ``draw-default`` command. All you need to specify is the width and height of the image and it will create an image and save it to your desktop.
**Tip: Enter ``help`` for a list of available commands or ``cheat`` if you prefer them rendered in a PDF with a nicer layout. The CLI will save the PDF on your desktop.**
For further information about this project, please visit the [wiki](https://github.com/CraigOates/Smouldering-Beach-Ball/wiki).
![screenshot-1](.github/Images/screenshot-1.png)
## Test Centre
This project holds all the tests for this solution. If uses a combination of unit tests ([xUnit](http://xunit.github.io/)) and property tests ([FsCheck](https://fscheck.github.io/FsCheck/)). If you are unfamiliar with either of them, click on their links for more information. Also, all the tests are accessible in Visual Studio's Test Explorer. This means you can identify failing tests with ease.
![screenshot-2](.github/Images/screenshot-2.png)
## How to Contribute
If you would like to contribute to the project, thank you and here are some useful links for for you to get started.
* [Contribution page](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/CONTRIBUTING.md)
* [Issues](https://github.com/CraigOates/Smouldering-Beach-Ball/tree/master/.github/ISSUE_TEMPLATE)
* [Bug Report Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/bug_report.md)
* [Feature Request Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/feature_request.md)
* [Pull Request Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/PULL_REQUEST_TEMPLATE.md)
* [Custom Template](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/.github/ISSUE_TEMPLATE/custom.md)
## Code of Conduction
Please visit the Code of Conduct page for Wet Pancake at:
* [Code of Conduct page](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/CODE_OF_CONDUCT.md)
* [MIT License](https://github.com/CraigOates/Smouldering-Beach-Ball/blob/master/LICENSE)
## About the Creator
Hi, my name is Craig and I am the creator of Smouldering Beach Ball. Thanks for checking it out.
* Email: craig@craigoates.net
* Web: [http://www.craigaotes.net](http://www.craigaotes.net/)
* Project:  [http://www.craigoates.net/Software/project/11](http://www.craigoates.net/Software/project/11)

42
SmoulderingBeachBall/AssemblyInfo.fs

@ -0,0 +1,42 @@
namespace SmoulderingBeachBallCLI.AssemblyInfo
open System.Reflection
open System.Runtime.CompilerServices
open System.Runtime.InteropServices
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("Smouldering Beach Ball")>]
[<assembly: AssemblyDescription(
"Smouldering Beach Ball [ALPHA] is a NuGet for creating placeholder images.")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("Craig Oates")>]
[<assembly: AssemblyProduct("Smouldering Beach Ball")>]
[<assembly: AssemblyCopyright("Copyright © 2018")>]
[<assembly: AssemblyTrademark("")>]
[<assembly: AssemblyCulture("")>]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[<assembly: ComVisible(false)>]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[<assembly: Guid("5c00d583-ef09-4fe6-a3fe-eb01454c0608")>]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("0.4.0.0")>]
[<assembly: AssemblyFileVersion("0.4.0.0")>]
do
()

18
SmoulderingBeachBall/Domain.fs

@ -1,18 +1,34 @@
namespace SmoulderingBeachBall.Domain
[<AutoOpen>]
/// A collection of types used to describe a Smouldering Beach Ball image.
module DomainTypes =
open System.Drawing
/// <summary>
/// The type of overly the image should have.
/// Border creates a border around the base image.
/// Full creates a border and a 'X' over the base image.
/// </summary>
type OverlayType =
| Border
| Full
/// <summary>
/// The specification for the overlay.
/// You define the overlays colour and overlay type here.
/// </summary>
type OverlaySpec =
{ colour: Brush;
overlayType: OverlayType }
/// <summary>
/// The specification for the whole image.
/// Set the width, height, colour, save location and overlay here.
/// The overlay requires an OverlaySpec if an overlay is desired.
/// To create an image without an overlay, just use 'None'.
/// </summary>
type ImageSpec =
{ width: int;
height: int;

7
SmoulderingBeachBall/Services.fs

@ -1,5 +1,6 @@
namespace SmoulderingBeachBall
/// Provides the public facing functions of Smouldering Beach Ball.
module Services =
open System
@ -7,6 +8,12 @@ module Services =
open InternalServices.Validation
open InternalServices.Drawing
/// <summary>
/// Creates an image using the specification provided by the ImageSpec.
/// </summary>
/// <param name="spec">
/// The image specification which describes how the image should look.
/// </param>
let makeImage (spec: ImageSpec) =
async {
try

1
SmoulderingBeachBall/SmoulderingBeachBall.fsproj

@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="Domain.fs" />
<Compile Include="InternalServices.fs" />
<Compile Include="Services.fs" />

14
SmoulderingBeachBallCLI/AssemblyInfo.fs

@ -8,9 +8,15 @@ open System.Runtime.InteropServices
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[<assembly: AssemblyTitle("Smouldering Beach Ball CLI")>]
[<assembly: AssemblyDescription("")>]
[<assembly: AssemblyDescription(
"\nSmouldering Beach Ball [ALPHA] is a console program for generating placeholder images.\n" +
"Visit https://github.com/CraigOates/Smouldering-Beach-Ball to submit issues and pull requests.\n" +
"The NuGet URL is T.B.A.\n" +
"The MyGet URL is T.B.A.\n" +
"Type 'help' into the prompt for a list of available commands.\n" +
"For a list of available colours, enter 'list-colours' into the prompt.\n")>]
[<assembly: AssemblyConfiguration("")>]
[<assembly: AssemblyCompany("")>]
[<assembly: AssemblyCompany("Craig Oates")>]
[<assembly: AssemblyProduct("Smouldering Beach Ball CLI")>]
[<assembly: AssemblyCopyright("Copyright © 2018")>]
[<assembly: AssemblyTrademark("")>]
@ -34,8 +40,8 @@ open System.Runtime.InteropServices
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("0.3.0.0")>]
[<assembly: AssemblyFileVersion("0.3.0.0")>]
[<assembly: AssemblyVersion("0.4.0.0")>]
[<assembly: AssemblyFileVersion("0.4.0.0")>]
do
()

11
SmoulderingBeachBallCLI/ConsoleCommands.fs

@ -63,17 +63,17 @@
[<ListCommand>]
[<Parameters
("(image-width: int) (image-height: int) (main-colour: string) " +
"(overlay-colour: string) (overlay-type:string) (file-path: string)")>]
("(image-width: int) (image-height: int) (main-colour: string) " +
"(overlay-colour: string) (overlay-type: string) (file-path: string)")>]
[<Description
("\nCreates an image using the values specified by the user.\n" +
"To see a list of available colours use the 'list-colours' command.\n" +
"For the overlay-type you can enter either 'none', 'border' or 'full.'\n" +
"For the file path, you can enter 'desktop' to save to the desktop." +
"For the file path, you can enter 'desktop' to save to the desktop.\n" +
"Otherwise, you must specify the whole path.")>]
[<Usage
("\ndraw-image 770 400 white black full desktop\n" +
"draw-image 600 400 purple gray border C:/work/project-folder/images\n" +
"draw-image 600 400 purple grey border C:/work/project-folder/images\n" +
"draw-image 800 440 black - none D:/your-project/assets")>]
let ``draw-image`` imgWidth imgHeight mainColour oColour oType path =
try
@ -87,8 +87,7 @@
[<ListCommand>]
[<Parameters "None">]
[<Description
"Lists out the colours this program uses to draw its images.">]
[<Description "Lists out the colours this program uses to draw its images.">]
[<Usage "list-colours">]
let ``list-colours`` () =
printfn "[INFO.] Listing available colours..."

Loading…
Cancel
Save