Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Feb 16, 2019
1 parent 7227e52 commit f4fb867
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 82 deletions.
5 changes: 0 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ go:
- 1.10.x
- 1.11.x

matrix:
allow_failures:
- go: master
fast_finish: true

sudo: false

before_install:
Expand Down
21 changes: 10 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,32 +28,31 @@ test-with-coverage-formatted: #| Runs tests with coverage and formats the result

.PHONY: test-with-coverage-profile
test-with-coverage-profile: #| Runs tests with coverage and collects the result.
#| Accepts: ARGS, OPEN_BROWSER.
#| Uses: GO_TEST_COVERAGE_MODE, GO_TEST_COVERAGE_FILENAME, PACKAGES.
echo 'mode: ${GO_TEST_COVERAGE_MODE}' > '${GO_TEST_COVERAGE_FILENAME}'
#| Accepts: ARGS.
#| Uses: PACKAGES.
echo 'mode: count' > cover.out
for package in $$($(PACKAGES)); do \
go test -covermode '${GO_TEST_COVERAGE_MODE}' \
go test -covermode count \
-coverprofile "coverage_$${package##*/}.out" \
$(strip $(ARGS)) "$${package}"; \
if [ -f "coverage_$${package##*/}.out" ]; then \
sed '1d' "coverage_$${package##*/}.out" >> '${GO_TEST_COVERAGE_FILENAME}'; \
sed 1d "coverage_$${package##*/}.out" >> cover.out; \
rm "coverage_$${package##*/}.out"; \
fi \
done

.PHONY: test-example
test-example: GO_TEST_COVERAGE_FILENAME = coverage_example.out
test-example: #| Runs example tests with coverage and collects the result.
#| Accepts: ARGS, OPEN_BROWSER.
#| Uses: GO_TEST_COVERAGE_MODE, GO_TEST_COVERAGE_FILENAME, PACKAGES.
echo 'mode: ${GO_TEST_COVERAGE_MODE}' > '${GO_TEST_COVERAGE_FILENAME}'
#| Accepts: ARGS.
#| Uses: PACKAGES.
echo 'mode: count' > coverage_example.out
for package in $$($(PACKAGES)); do \
go test -v -run=Example \
-covermode '${GO_TEST_COVERAGE_MODE}' \
-covermode count \
-coverprofile "coverage_example_$${package##*/}.out" \
$(strip $(ARGS)) "$${package}"; \
if [ -f "coverage_$${package##*/}.out" ]; then \
sed '1d' "coverage_example_$${package##*/}.out" >> '${GO_TEST_COVERAGE_FILENAME}'; \
sed 1d "coverage_example_$${package##*/}.out" >> coverage_example.out; \
rm "coverage_example_$${package##*/}.out"; \
fi \
done
61 changes: 34 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
> # ♻️ retry [![Tweet][icon_twitter]][twitter_publish]
> # ♻️ retry
>
> Functional mechanism based on channels to perform actions repetitively until successful.
[![Awesome][icon_awesome]][page_awesome]
[![Awesome][icon_awesome]][awesome]
[![Patreon][icon_patreon]][support]
[![Build Status][icon_build]][page_build]
[![Code Coverage][icon_coverage]][page_quality]
[![Code Quality][icon_quality]][page_quality]
[![GoDoc][icon_docs]][page_docs]
[![Research][icon_research]][page_research]
[![Build Status][icon_build]][build]
[![Code Coverage][icon_coverage]][quality]
[![Code Quality][icon_quality]][quality]
[![GoDoc][icon_docs]][docs]
[![Research][icon_research]][research]
[![License][icon_license]][license]

## Usage
Expand Down Expand Up @@ -150,13 +150,13 @@ $ # or use mirror
$ egg bitbucket.org/kamilsk/retry
```

> [egg](https://github.com/kamilsk/egg)<sup id="anchor-egg">[1](#egg)</sup> is an `extended go get`.
> [egg][]<sup id="anchor-egg">[1](#egg)</sup> is an `extended go get`.
## Update

This library is using [SemVer](http://semver.org) for versioning, and it is not
This library is using [SemVer][semver] for versioning, and it is not
[BC](https://en.wikipedia.org/wiki/Backward_compatibility)-safe. Therefore, do not use `go get -u` to update it,
use [dep](https://github.com/golang/dep) or something similar for this purpose.
use **dep**, **glide** or something similar for this purpose.

<sup id="egg">1</sup> The project is still in prototyping. [](#anchor-egg)

Expand All @@ -166,9 +166,31 @@ use [dep](https://github.com/golang/dep) or something similar for this purpose.
[![@kamilsk][icon_tw_author]][author]
[![@octolab][icon_tw_sponsor]][sponsor]

made with ❤️ by [OctoLab](https://www.octolab.org/)
made with ❤️ by [OctoLab][octolab]

[analytics_pixel]: https://ga-beacon.appspot.com/UA-109817251-1/retry/master?pixel
[awesome]: https://github.com/avelino/awesome-go#utilities
[build]: https://travis-ci.org/kamilsk/retry
[docs]: https://godoc.org/github.com/kamilsk/retry
[gitter]: https://gitter.im/kamilsk/retry
[license]: LICENSE
[promo]: https://github.com/kamilsk/retry
[quality]: https://scrutinizer-ci.com/g/kamilsk/retry/?branch=master
[research]: https://github.com/kamilsk/go-research/tree/master/projects/retry
[v3]: https://github.com/kamilsk/retry/tree/v3
[v4]: https://github.com/kamilsk/retry/tree/v4
[v4_features]: https://github.com/kamilsk/retry/projects/4

[egg]: https://github.com/kamilsk/egg
[gomod]: https://github.com/golang/go/wiki/Modules
[semver]: https://semver.org/

[author]: https://twitter.com/ikamilsk
[octolab]: https://www.octolab.org/
[sponsor]: https://twitter.com/octolab_inc
[support]: https://www.patreon.com/octolab

[analytics]: https://ga-beacon.appspot.com/UA-109817251-1/retry/master?pixel
[tweet]: https://twitter.com/intent/tweet?text=Functional%20mechanism%20based%20on%20channels%20to%20perform%20actions%20repetitively%20until%20successful&url=https://github.com/kamilsk/retry&via=ikamilsk&hashtags=go,repeat,retry,backoff,jitter

[icon_awesome]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
[icon_build]: https://travis-ci.org/kamilsk/retry.svg?branch=master
Expand All @@ -182,18 +204,3 @@ made with ❤️ by [OctoLab](https://www.octolab.org/)
[icon_tw_author]: https://img.shields.io/badge/author-%40kamilsk-blue.svg
[icon_tw_sponsor]: https://img.shields.io/badge/sponsor-%40octolab-blue.svg
[icon_twitter]: https://img.shields.io/twitter/url/http/shields.io.svg?style=social

[page_awesome]: https://github.com/avelino/awesome-go#utilities
[page_build]: https://travis-ci.org/kamilsk/retry
[page_docs]: https://godoc.org/github.com/kamilsk/retry
[page_promo]: https://github.com/kamilsk/retry
[page_quality]: https://scrutinizer-ci.com/g/kamilsk/retry/?branch=master
[page_research]: https://github.com/kamilsk/go-research/tree/master/projects/retry

[author]: https://twitter.com/ikamilsk
[gitter]: https://gitter.im/kamilsk/retry
[license]: LICENSE
[sponsor]: https://twitter.com/octolab_inc
[support]: https://www.patreon.com/octolab

[twitter_publish]: https://twitter.com/intent/tweet?text=Functional%20mechanism%20based%20on%20channels%20to%20perform%20actions%20repetitively%20until%20successful&url=https://github.com/kamilsk/retry&via=ikamilsk&hashtags=go,repeat,retry,backoff,jitter
21 changes: 21 additions & 0 deletions cmd/retry/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 OctoLab, https://www.octolab.org/ <feedback@octolab.org>

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.
70 changes: 41 additions & 29 deletions cmd/retry/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
> # cmd/retry [![Tweet][icon_twitter]][twitter_publish]
> [![Analytics][analytics_pixel]][page_promo]
> # ♻️ cmd/retry
>
> `retry` provides functionality to repeat terminal commands.
[![Awesome][icon_awesome]](https://github.com/avelino/awesome-go#utilities)
[![Patreon][icon_patreon]](https://www.patreon.com/octolab)
[![Build Status][icon_build]][page_build]
[![Code Coverage][icon_coverage]][page_quality]
[![Code Quality][icon_quality]][page_quality]
[![GoDoc][icon_docs]][page_docs]
[![License][icon_license]](../../LICENSE)
[![Awesome][icon_awesome]][awesome]
[![Patreon][icon_patreon]][support]
[![Build Status][icon_build]][build]
[![Code Coverage][icon_coverage]][quality]
[![Code Quality][icon_quality]][quality]
[![GoDoc][icon_docs]][docs]
[![Research][icon_research]][research]
[![License][icon_license]][license]

## Concept

Expand Down Expand Up @@ -148,7 +149,6 @@ $ brew install kamilsk/tap/retry
$ export REQ_VER=3.0.0 # all available versions are on https://github.com/kamilsk/retry/releases
$ export REQ_OS=Linux # macOS and Windows are also available
$ export REQ_ARCH=64bit # 32bit is also available
$ # wget -q -O retry.tar.gz
$ curl -sL -o retry.tar.gz \
https://github.com/kamilsk/retry/releases/download/"${REQ_VER}/retry_${REQ_VER}_${REQ_OS}-${REQ_ARCH}".tar.gz
$ tar xf retry.tar.gz -C "${GOPATH}"/bin/ && rm retry.tar.gz
Expand All @@ -162,13 +162,10 @@ $ # or use mirror
$ egg bitbucket.org/kamilsk/retry@^3.0.0 -- make test install
```

> [egg](https://github.com/kamilsk/egg)<sup id="anchor-egg">[1](#egg)</sup> is an `extended go get`.
> [egg][]<sup id="anchor-egg">[1](#egg)</sup> is an `extended go get`.
### Bash and Zsh completions

You can find completion files [here](https://github.com/kamilsk/shared/tree/dotfiles/bash_completion.d) or
build your own using these commands

```bash
$ retry completion bash > /path/to/bash_completion.d/retry.sh
$ retry completion zsh > /path/to/zsh-completions/_retry.zsh
Expand All @@ -178,30 +175,45 @@ $ retry completion zsh > /path/to/zsh-completions/_retry.zsh

---

[![Gitter][icon_gitter]](https://gitter.im/kamilsk/retry)
[![@kamilsk][icon_tw_author]](https://twitter.com/ikamilsk)
[![@octolab][icon_tw_sponsor]](https://twitter.com/octolab_inc)
[![Gitter][icon_gitter]][gitter]
[![@kamilsk][icon_tw_author]][author]
[![@octolab][icon_tw_sponsor]][sponsor]

made with ❤️ by [OctoLab][octolab]

[awesome]: https://github.com/avelino/awesome-go#utilities
[build]: https://travis-ci.org/kamilsk/retry
[docs]: https://godoc.org/github.com/kamilsk/retry
[gitter]: https://gitter.im/kamilsk/retry
[license]: LICENSE
[promo]: https://github.com/kamilsk/retry
[quality]: https://scrutinizer-ci.com/g/kamilsk/retry/?branch=master
[research]: https://github.com/kamilsk/go-research/tree/master/projects/retry
[v3]: https://github.com/kamilsk/retry/tree/v3
[v4]: https://github.com/kamilsk/retry/tree/v4
[v4_features]: https://github.com/kamilsk/retry/projects/4

made with ❤️ by [OctoLab](https://www.octolab.org/)
[egg]: https://github.com/kamilsk/egg
[gomod]: https://github.com/golang/go/wiki/Modules
[semver]: https://semver.org/

[analytics_pixel]: https://ga-beacon.appspot.com/UA-109817251-1/retry/cmd/dev?pixel
[author]: https://twitter.com/ikamilsk
[octolab]: https://www.octolab.org/
[sponsor]: https://twitter.com/octolab_inc
[support]: https://www.patreon.com/octolab

[analytics]: https://ga-beacon.appspot.com/UA-109817251-1/retry/master?pixel
[tweet]: https://twitter.com/intent/tweet?text=Functional%20mechanism%20based%20on%20channels%20to%20perform%20actions%20repetitively%20until%20successful&url=https://github.com/kamilsk/retry&via=ikamilsk&hashtags=go,repeat,retry,backoff,jitter

[icon_awesome]: https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg
[icon_build]: https://travis-ci.org/kamilsk/retry.svg?branch=dev
[icon_coverage]: https://scrutinizer-ci.com/g/kamilsk/retry/badges/coverage.png?b=dev
[icon_build]: https://travis-ci.org/kamilsk/retry.svg?branch=master
[icon_coverage]: https://scrutinizer-ci.com/g/kamilsk/retry/badges/coverage.png?b=master
[icon_docs]: https://godoc.org/github.com/kamilsk/retry?status.svg
[icon_gitter]: https://badges.gitter.im/Join%20Chat.svg
[icon_license]: https://img.shields.io/badge/license-MIT-blue.svg
[icon_patreon]: https://img.shields.io/badge/patreon-donate-orange.svg
[icon_quality]: https://scrutinizer-ci.com/g/kamilsk/retry/badges/quality-score.png?b=dev
[icon_quality]: https://scrutinizer-ci.com/g/kamilsk/retry/badges/quality-score.png?b=master
[icon_research]: https://img.shields.io/badge/research-in%20progress-yellow.svg
[icon_tw_author]: https://img.shields.io/badge/author-%40kamilsk-blue.svg
[icon_tw_sponsor]: https://img.shields.io/badge/sponsor-%40octolab-blue.svg
[icon_twitter]: https://img.shields.io/twitter/url/http/shields.io.svg?style=social

[page_build]: https://travis-ci.org/kamilsk/retry
[page_docs]: https://godoc.org/github.com/kamilsk/retry
[page_promo]: https://github.com/kamilsk/retry
[page_quality]: https://scrutinizer-ci.com/g/kamilsk/retry/?branch=dev

[twitter_publish]: https://twitter.com/intent/tweet?text=Functional%20mechanism%20based%20on%20channels%20to%20perform%20actions%20repetitively%20until%20successful&url=https://github.com/kamilsk/retry&via=ikamilsk&hashtags=go,repeat,retry,backoff,jitter
10 changes: 0 additions & 10 deletions cmd/retry/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ func Test_parse(t *testing.T) {
return
},
},
{
name: "invalid timeout",
do: func() (obtained, expected string) {
expected = `parse: invalid value "Timeout" for flag -timeout: time: invalid duration Timeout`
if _, err := parse(ioutil.Discard, "test", "-timeout=Timeout"); err != nil {
obtained = err.Error()
}
return
},
},
{
name: "invalid strategy",
do: func() (obtained, expected string) {
Expand Down

0 comments on commit f4fb867

Please sign in to comment.