Skip to content

Commit

Permalink
PLIN-1851: renaming it to balsa
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Newton committed Nov 5, 2018
1 parent f279342 commit fc4700d
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ redis
coverage.out

# Build artifacts
condparse
balsa

# build/test files
env.sh
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
REPO=balsa

.PHONY: clean

all: build

test:
@go test -cover ./...

build:
@go build

clean:
rm ./$(REPO)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# condparse
# balsa

This is mostly intended to be used as a library for parsing, manipulating, and serializing a condition logic string.

Expand All @@ -12,12 +12,12 @@ To parse an existing condition logic string, call `Parse(string) error`

```go
import {
"github.com/skuid/condparse/condparse"
"github.com/skuid/balsa/parse"
}

logic := "1 OR 2 AND (3 OR 4)"

tree, err := condparse.Parse(logic)
tree, err := parse.Parse(logic)

if err != nil {
fmt.Print("Error: %v", err)
Expand Down Expand Up @@ -49,7 +49,7 @@ This can be called multiple times to remove leafs from the tree by value. It wil
```go
logic := "1 OR (5 AND (1 OR 1)) AND (1 AND 2 OR (56 AND 1)) OR 4"

tree, _ := condparse.Parse(logic)
tree, _ := parse.Parse(logic)

n := tree.Remove(1)
n = tree.Remove(8)
Expand Down
6 changes: 3 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"os"

"github.com/skuid/condparse/pkg/version"
"github.com/skuid/balsa/pkg/version"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
Expand All @@ -13,7 +13,7 @@ var sugar = zap.L().Sugar()

// RootCmd represents the base command when called without any subcommands
var RootCmd = &cobra.Command{
Use: "CondParse",
Use: "Balsa",
Short: "A utility and set of functions to parse condition logic",
Version: version.Name,
}
Expand All @@ -39,6 +39,6 @@ func initConfig() {
os.Exit(1)
}

viper.SetEnvPrefix("condparse")
viper.SetEnvPrefix("balsa")
viper.AutomaticEnv()
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"go.uber.org/zap"

"github.com/skuid/condparse/cmd"
"github.com/skuid/balsa/cmd"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/condparse_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/parse.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"bytes"
Expand Down
2 changes: 1 addition & 1 deletion pkg/parse_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion pkg/remove.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

// Remove a node by value
// n.Remove(1)
Expand Down
2 changes: 1 addition & 1 deletion pkg/remove_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"strings"
Expand Down
2 changes: 1 addition & 1 deletion pkg/serialize.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/serialize_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"strings"
Expand Down
2 changes: 1 addition & 1 deletion pkg/stack.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

func pop(slice []Node) (Node, []Node) {
return slice[len(slice)-1], slice[:len(slice)-1]
Expand Down
2 changes: 1 addition & 1 deletion pkg/tree.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package condparse
package parse

import (
"fmt"
Expand Down

0 comments on commit fc4700d

Please sign in to comment.