From efee8e45d38ea38859eca617b496a50d310d2d90 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 8 Mar 2017 07:34:24 -0500 Subject: [PATCH 1/3] Added Makefile + ek updated to v7 --- .travis.yml | 6 +++--- Makefile | 23 +++++++++++++++++++++++ common/yo.spec | 5 ++++- yo.go | 12 ++++++------ 4 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 Makefile diff --git a/.travis.yml b/.travis.yml index 7993474..6dcb9f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ language: go go: - 1.6.x - 1.7.x + - 1.8.x - tip os: @@ -21,9 +22,8 @@ matrix: - go: tip before_install: - - go get -v pkg.re/essentialkaos/ek.v6 - - go get -v pkg.re/essentialkaos/go-simpleyaml.v1 + - make deps script: - - go build yo.go + - make all - .travis/script.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..24967f2 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +######################################################################################## + +.PHONY = fmt all clean deps + +######################################################################################## + +all: yo + +yo: + go build yo.go + +deps: + go get -v pkg.re/essentialkaos/ek.v7 + go get -v pkg.re/essentialkaos/go-simpleyaml.v1 + +fmt: + find . -name "*.go" -exec gofmt -s -w {} \; + +clean: + rm -f yo + +######################################################################################## + diff --git a/common/yo.spec b/common/yo.spec index 2506648..02a1738 100644 --- a/common/yo.spec +++ b/common/yo.spec @@ -44,7 +44,7 @@ Summary: Command-line YAML processor Name: yo -Version: 0.0.2 +Version: 0.1.0 Release: 0%{?dist} Group: Applications/System License: EKOL @@ -92,6 +92,9 @@ rm -rf %{buildroot} ############################################################################### %changelog +* Wed Mar 08 2017 Anton Novojilov - 0.1.0-0 +- ek package updated to v7 + * Tue Feb 14 2017 Anton Novojilov - 0.0.2-0 - Fixed output for arrays with maps and sub arrays diff --git a/yo.go b/yo.go index d57fc6b..446a6c6 100644 --- a/yo.go +++ b/yo.go @@ -15,11 +15,11 @@ import ( "strconv" "strings" - "pkg.re/essentialkaos/ek.v6/arg" - "pkg.re/essentialkaos/ek.v6/env" - "pkg.re/essentialkaos/ek.v6/fmtc" - "pkg.re/essentialkaos/ek.v6/fsutil" - "pkg.re/essentialkaos/ek.v6/usage" + "pkg.re/essentialkaos/ek.v7/arg" + "pkg.re/essentialkaos/ek.v7/env" + "pkg.re/essentialkaos/ek.v7/fmtc" + "pkg.re/essentialkaos/ek.v7/fsutil" + "pkg.re/essentialkaos/ek.v7/usage" "pkg.re/essentialkaos/go-simpleyaml.v1" ) @@ -28,7 +28,7 @@ import ( const ( APP = "Yo" - VER = "0.0.2" + VER = "0.1.0" DESC = "Command-line YAML processor" ) From 93b94eef4baf831135117e7330f0be693075017d Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 8 Mar 2017 07:36:12 -0500 Subject: [PATCH 2/3] Fixed compatibility with ek v7 --- yo.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/yo.go b/yo.go index 446a6c6..4b6f78c 100644 --- a/yo.go +++ b/yo.go @@ -537,8 +537,6 @@ func (t Token) IsArrayToken() bool { // ////////////////////////////////////////////////////////////////////////////////// // func showUsage() { - usage.Breadcrumbs = true - info := usage.NewInfo("", "query") info.AddOption(ARG_FROM_FILE, "Read data from file", "filename") From 4a9f792b231f5442f9665e089abec48a4e76e103 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 8 Mar 2017 07:38:20 -0500 Subject: [PATCH 3/3] Improved test script --- .travis/script.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis/script.sh b/.travis/script.sh index f322a42..63e73f9 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -38,6 +38,15 @@ has_errors="" ################################################################################ main() { + if [[ ! -e $BINARY ]] ; then + echo -e "${CL_RED}Can't find yo binary${CL_NORM}" + exit 1 + fi + + runTest +} + +runTest() { header "Basic selectors" check ".name" "John Doe"