Move robeaux into it's own package

This commit is contained in:
Adrian Zankich 2014-07-10 11:35:00 -07:00
parent bccc355a19
commit d7b2d04e2d
4 changed files with 12 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
.sass-cache
*.test
robeaux
profile.cov

View File

@ -20,15 +20,15 @@ ifeq (,$(shell which go-bindata))
$(error robeaux not built! https://github.com/jteeuwen/go-bindata is required to build robeaux assets )
endif
cd api ; \
git clone --depth 1 git://github.com/hybridgroup/robeaux.git ; \
cd robeaux ; \
git clone --depth 1 git://github.com/hybridgroup/robeaux.git robeaux-tmp; \
cd robeaux-tmp ; \
rm fonts/* ; \
rm Makefile package.json README.markdown robeaux.gemspec css/fonts.css ; \
touch css/fonts.css ; \
echo "Updating robeaux to $(shell git rev-parse HEAD)" ; \
go-bindata -pkg="api" -o robeaux.go -ignore=\\.git ./... ; \
mv robeaux.go .. ; \
go-bindata -pkg="robeaux" -o robeaux.go -ignore=\\.git ./... ; \
mv robeaux.go ../robeaux ; \
cd .. ; \
rm -rf robeaux/ ; \
go fmt ./robeaux.go ; \
rm -rf robeaux-tmp/ ; \
go fmt ./robeaux/robeaux.go ; \

View File

@ -4,12 +4,14 @@ import (
"crypto/subtle"
"encoding/base64"
"encoding/json"
"github.com/bmizerany/pat"
"github.com/hybridgroup/gobot"
"io/ioutil"
"log"
"net/http"
"strings"
"github.com/bmizerany/pat"
"github.com/hybridgroup/gobot"
"github.com/hybridgroup/gobot/api/robeaux"
)
// Optional restful API through Gobot has access
@ -128,7 +130,7 @@ func (a *api) setHeaders(f func(http.ResponseWriter, *http.Request)) http.Handle
func (a *api) robeaux(res http.ResponseWriter, req *http.Request) {
path := req.URL.Path
buf, err := Asset(path[1:])
buf, err := robeaux.Asset(path[1:])
if err != nil {
log.Println("Error serving static file:", err.Error())
res.Write([]byte(err.Error()))

View File

@ -1,4 +1,4 @@
package api
package robeaux
import (
"bytes"