Permalink
Browse files

merge contributions (#246)

* expanded help to mention need to import addon (#243)

* Remove unused extra backtick (#239)

* remove import for golang.org/net/x/http2, co-locate error message

* update CI code to run --dev if on ponzu-dev branch

* CI: ensure we have latest from ponzu-dev branch
  • Loading branch information...
nilslice committed May 9, 2018
1 parent dab5481 commit 1c1a87c57b6407a41b30e0eb9416f03f4b118aac
Showing with 21 additions and 8 deletions.
  1. +11 −4 .circleci/test-setup.sh
  2. +2 −1 cmd/ponzu/add.go
  3. +1 −1 docs/src/Quickstart/Overview.md
  4. +7 −2 system/api/push.go
@@ -7,20 +7,27 @@ set -ex
# Install Ponzu CMS
go get -u github.com/ponzu-cms/ponzu/...
# test install
ponzu
# create a project and generate code
ponzu new github.com/ponzu-cms/ci/test-project
if [ $CIRCLE_BRANCH = "ponzu-dev" ]; then
# ensure we have the latest from ponzu-dev branch
cd /go/src/github.com/ponzu-cms/ponzu
git checkout ponzu-dev
git pull origin ponzu-dev
# create new project using the ponzu-dev branch
ponzu new --dev github.com/ponzu-cms/ci/test-project
else
ponzu new github.com/ponzu-cms/ci/test-project
fi
cd /go/src/github.com/ponzu-cms/ci/test-project
ponzu gen content person name:string hashed_secret:string
ponzu gen content message from:@person,hashed_secret to:@person,hashed_secret
# build and run dev http/2 server with TLS
ponzu build
@@ -16,7 +16,8 @@ var addCmd = &cobra.Command{
Aliases: []string{"a"},
Short: "Downloads addon from specified import path",
Long: `Downloads addon from specified import path to $GOPATH/src and copys it to the
current project's addons directory. Must be called from within a Ponzu project directory.`,
current project's addons directory. Must be called from within a Ponzu project directory. Addon
needs to imported in at least one content item for it to be included in the Ponzu server build.`,
Example: `$ ponzu add github.com/bosssauce/fbscheduler`,
RunE: func(cmd *cobra.Command, args []string) error {
// expecting two args, add/a and the go gettable package uri
@@ -18,7 +18,7 @@ $ cd $GOPATH/src/github.com/nilslice/reviews
5) Generate content type file and boilerplate code (creates `content/review.go`):
```bash
$ ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:string:file`
$ ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:string:file
```
6) Build your project:
@@ -3,13 +3,15 @@ package api
import (
"log"
"net/http"
"strings"
"github.com/ponzu-cms/ponzu/system/item"
"github.com/tidwall/gjson"
"golang.org/x/net/http2"
)
const errRecursivePush = "recursive push not allowed"
func push(res http.ResponseWriter, req *http.Request, pt interface{}, data []byte) {
// Push(target string, opts *PushOptions) error
if pusher, ok := res.(http.Pusher); ok {
@@ -40,7 +42,10 @@ func push(res http.ResponseWriter, req *http.Request, pt interface{}, data []byt
err := pusher.Push(v.String(), nil)
// check for error, "http2: recursive push not allowed"
// and return, suppressing a log message
if err != nil && err.Error() == http2.ErrRecursivePush.Error() {
// XXX: errRecursivePush has been co-located to this
// package instead of importing golang.org/x/net/http2
// to get the error itself.
if err != nil && strings.Contains(err.Error(), errRecursivePush) {
return true
}
if err != nil {

0 comments on commit 1c1a87c

Please sign in to comment.