-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic Travis setup. Add initial set of Go source files based on github.com/homeport/gonvenience.
- Loading branch information
0 parents
commit a134c24
Showing
18 changed files
with
1,845 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
language: go | ||
go: | ||
- 1.12.x | ||
|
||
install: | ||
- curl --silent --location https://goo.gl/g1CpPX | bash -s v1.0.7 | ||
|
||
script: | ||
- export GO111MODULE=on | ||
- go mod download | ||
- go mod verify | ||
- ginkgo -r -nodes 4 -randomizeAllSpecs -randomizeSuites -race -trace | ||
- staticcheck ./... | ||
- golint ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 gonvenience | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# bunt | ||
|
||
[![License](https://img.shields.io/github/license/gonvenience/bunt.svg)](https://github.com/gonvenience/bunt/blob/master/LICENSE) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/gonvenience/bunt)](https://goreportcard.com/report/github.com/gonvenience/bunt) | ||
[![Build Status](https://travis-ci.org/gonvenience/bunt.svg?branch=master)](https://travis-ci.org/gonvenience/bunt) | ||
[![GoDoc](https://godoc.org/github.com/gonvenience/bunt/pkg?status.svg)](https://godoc.org/github.com/gonvenience/bunt/pkg) | ||
[![Release](https://img.shields.io/github/release/gonvenience/bunt.svg)](https://github.com/gonvenience/bunt/releases/latest) | ||
|
||
Golang package for creating true color output in terminals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright © 2019 The Homeport Team | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package bunt | ||
|
||
import ( | ||
"github.com/gonvenience/term" | ||
) | ||
|
||
// ColorSetting defines the coloring setting to be used | ||
var ColorSetting = AUTO | ||
|
||
// TrueColorSetting defines the true color usage setting to be used | ||
var TrueColorSetting = AUTO | ||
|
||
// SwitchState is the type to cover different preferences/settings like: | ||
// on, off, or auto | ||
type SwitchState int | ||
|
||
// Supported setting states | ||
const ( | ||
OFF = SwitchState(-1) | ||
AUTO = SwitchState(0) | ||
ON = SwitchState(+1) | ||
) | ||
|
||
// UseColors return whether colors are used or not based on the configured color | ||
// setting or terminal capabilities | ||
func UseColors() bool { | ||
return (ColorSetting == ON) || | ||
(ColorSetting == AUTO && term.IsTerminal() && !term.IsDumbTerminal()) | ||
} | ||
|
||
// UseTrueColor returns whether true color colors should be used or not based on | ||
// the configured true color usage setting or terminal capabilities | ||
func UseTrueColor() bool { | ||
return (TrueColorSetting == ON) || | ||
(TrueColorSetting == AUTO && term.IsTrueColor()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright © 2019 The Homeport Team | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in | ||
// all copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
// THE SOFTWARE. | ||
|
||
package bunt_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestBunt(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "bunt suite") | ||
} |
Oops, something went wrong.