Skip to content

Commit

Permalink
add semver module
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Dec 3, 2023
1 parent 8e75220 commit f4c7a0f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/rudi/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ require (
github.com/chzyer/readline v1.5.1
github.com/spf13/pflag v1.0.5
go.xrstf.de/go-term-markdown v0.0.0-20231119170546-73a1852b91cc
go.xrstf.de/rudi v0.0.0
go.xrstf.de/rudi v0.1.0
go.xrstf.de/rudi-contrib/semver v0.0.0-20231203191548-aba8974ae9a2
gopkg.in/yaml.v3 v3.0.1
)

Expand Down
2 changes: 2 additions & 0 deletions cmd/rudi/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ github.com/xrstf/colorjson v0.0.0-20231123184920-5ea6fecf578f h1:gVBqsyWwyxxzSGj
github.com/xrstf/colorjson v0.0.0-20231123184920-5ea6fecf578f/go.mod h1:AY6XdslHQYqT5ivYt21gXNpCjsck8iEoytnNfz3COxY=
go.xrstf.de/go-term-markdown v0.0.0-20231119170546-73a1852b91cc h1:0vqYzllpoI4x5V4QPCN3LWL/kmAdxl7gXf3OchayNSw=
go.xrstf.de/go-term-markdown v0.0.0-20231119170546-73a1852b91cc/go.mod h1:0bARjSNhCWOffbH9lX3J7QoLkjuTf3oEV8OhZHPenMg=
go.xrstf.de/rudi-contrib/semver v0.0.0-20231203191548-aba8974ae9a2 h1:ko2wkZHb8V4CZx0V7pBKE87EykjcceaYNXPhAs/NpuE=
go.xrstf.de/rudi-contrib/semver v0.0.0-20231203191548-aba8974ae9a2/go.mod h1:pIxgeSQ2X+34H+hiZFUUw+xnzwjt5OTuM69M6/w8MDc=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down
6 changes: 5 additions & 1 deletion cmd/rudi/util/rudi.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

"go.xrstf.de/rudi"
"go.xrstf.de/rudi-contrib/semver"
"go.xrstf.de/rudi/cmd/rudi/types"
"go.xrstf.de/rudi/pkg/coalescing"
)
Expand Down Expand Up @@ -41,7 +42,10 @@ func SetupRudiContext(opts *types.Options, files []any) (rudi.Context, error) {
return rudi.Context{}, fmt.Errorf("unknown coalescing mode %q", opts.Coalescing)
}

ctx := rudi.NewContext(document, vars, rudi.NewBuiltInFunctions(), coalescer)
funcs := rudi.NewBuiltInFunctions().
Add(semver.Functions)

ctx := rudi.NewContext(document, vars, funcs, coalescer)

return ctx, nil
}

0 comments on commit f4c7a0f

Please sign in to comment.