Skip to content

Commit

Permalink
Reorganise the repo layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail committed Mar 27, 2015
1 parent ba3ddb2 commit 4b13c95
Show file tree
Hide file tree
Showing 42 changed files with 79 additions and 602 deletions.
19 changes: 2 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ JS_CLIENT := $(JS_PATH)/leapclient.js
BIN := ./bin
JS_BIN := $(BIN)/js

JS_BIN_FILES = $(shell ls $(JS_BIN))

VERSION := $(shell git describe --tags || echo "v0.0.0")
DATE := $(shell date +"%c" | tr ' :' '__')

Expand All @@ -43,21 +41,9 @@ build: check
@go build -o $(BIN)/$(PROJECT) $(GOFLAGS)
@cp $(BIN)/$(PROJECT) $$GOPATH/bin
@echo "copying/compressing js libraries into $(JS_BIN)"
@cp $(JS_CLIENT) $(JS_BIN)/leaps.js; \
@cat $(JS_CLIENT) $(JS_PATH)/leap-bind-*.js > $(JS_BIN)/leaps.js; \
cat $(JS_PATH)/LICENSE > "$(JS_BIN)/leaps-min.js"; \
uglifyjs "$(JS_BIN)/leaps.js" >> "$(JS_BIN)/leaps-min.js";
@cat $(JS_CLIENT) $(JS_PATH)/leap-bind-*.js > $(JS_BIN)/leaps-all.js; \
cat $(JS_PATH)/LICENSE > "$(JS_BIN)/leaps-all-min.js"; \
uglifyjs "$(JS_BIN)/leaps-all.js" >> "$(JS_BIN)/leaps-all-min.js";
@cat $(JS_CLIENT) $(JS_PATH)/leap-bind-ace.js > $(JS_BIN)/leaps-ace.js; \
cat $(JS_PATH)/LICENSE > "$(JS_BIN)/leaps-ace-min.js"; \
uglifyjs "$(JS_BIN)/leaps-ace.js" >> "$(JS_BIN)/leaps-ace-min.js";
@cat $(JS_CLIENT) $(JS_PATH)/leap-bind-codemirror.js > $(JS_BIN)/leaps-codemirror.js; \
cat $(JS_PATH)/LICENSE > "$(JS_BIN)/leaps-codemirror-min.js"; \
uglifyjs "$(JS_BIN)/leaps-codemirror.js" >> "$(JS_BIN)/leaps-codemirror-min.js";
@cat $(JS_CLIENT) $(JS_PATH)/leap-bind-textarea.js > $(JS_BIN)/leaps-textarea.js; \
cat $(JS_PATH)/LICENSE > "$(JS_BIN)/leaps-textarea-min.js"; \
uglifyjs "$(JS_BIN)/leaps-textarea.js" >> "$(JS_BIN)/leaps-textarea-min.js";

GOLINT=$(shell golint .)
lint:
Expand Down Expand Up @@ -98,8 +84,7 @@ package_builds = $(foreach platform, $(PLATFORMS), \
cp -LR "$(BIN)/js" "./releases/$(VERSION)/$(PROJECT)"; \
cp -LR "./config" "./releases/$(VERSION)/$(PROJECT)"; \
cp -LR "./static" "./releases/$(VERSION)/$(PROJECT)"; \
cp -LR "./scripts/install.sh" "./releases/$(VERSION)/$(PROJECT)"; \
cp -LR "./scripts/uninstall.sh" "./releases/$(VERSION)/$(PROJECT)"; \
cp -LR "./scripts" "./releases/$(VERSION)/$(PROJECT)"; \
cd "./releases/$(VERSION)"; \
tar -czf "$${a_name}.tar.gz" "./$(PROJECT)"; \
rm -r "./$(PROJECT)"; \
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ To read more and find examples check out the wiki: [leaps wiki](https://github.c

##How to run

Leaps is a single binary, with no runtime dependencies, everything is set through a single config file. Just download a release package for your OS and do the following to set up an example:
Leaps is a single binary, with no runtime dependencies, everything is set through a single config file. Just download a release package for your OS and do the following to run an example:

```bash
tar -xvf ./leaps-linux_amd64-v0.1.2.tar.gz
Expand All @@ -29,12 +29,14 @@ To generate a configuration file of all default values:

##Customizing your service

There are lots of example configuration files in ./config to check out for various use cases.

To learn how to customize your leaps service read here:
[leaps service wiki](https://github.com/Jeffail/leaps/wiki/Service)

##Leaps clients

The leaps client is written in JavaScript and is ready to simply drop into your website. You can read about it here:
The leaps client is written in JavaScript and is ready to simply drop into a website. You can read about it here:
[leaps client wiki](https://github.com/Jeffail/leaps/wiki/Clients)

The files to include can be found in the release packages at ./js, or in a built repository at ./bin/js. Here's a short example of using leaps to turn a textarea into a shared leaps editor:
Expand Down Expand Up @@ -71,15 +73,14 @@ Windows x86_64 | Supported

##How to build

Dependencies:
Leaps has a Makefile that can lint, run tests, generate the client libraries and package leaps builds into archives. However, if you only wish to get a leaps binary then you can simply use `go get github.com/jeffail/leaps`.

Build dependencies for Makefile:

- Golang 1.2+
- [golint](https://github.com/golang/lint "golint")

To build clients:

- nodejs
- npm (uglifyjs, jshint, nodeunit)
- npm (global install of uglifyjs, jshint, nodeunit)

To build and then start up an example server do the following:

Expand Down
4 changes: 3 additions & 1 deletion client/unit_tests/test_client_stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ var fs = require('fs'),
lc = require('../leapclient').client,
la = require('../leapclient').apply;

var client_stories_text = fs.readFileSync(path.resolve(__dirname, "./../../data/", "./client_stories.js"), "utf8");
var client_stories_text = fs.readFileSync(
path.resolve(__dirname, "./../../test/stories/", "./client_stories.js"), "utf8");

var stories = JSON.parse(client_stories_text).client_stories;

var run_story = function(story, test) {
Expand Down
2 changes: 1 addition & 1 deletion config/leaps_ace_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ curator:
http_server:
static_path: /
socket_path: /socket
address: :8080
address: :8001
www_dir: ./static/example_ace
binder:
bind_send_timeout_ms: 10
Expand Down
2 changes: 1 addition & 1 deletion config/leaps_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ curator:
http_server:
static_path: /
socket_path: /socket
address: :8080
address: :8001
www_dir: ./static/example
binder:
bind_send_timeout_ms: 10
Expand Down
2 changes: 1 addition & 1 deletion config/leaps_files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ curator:
http_server:
static_path: /
socket_path: /socket
address: :8080
address: :8001
www_dir: ./static/example_file
binder:
bind_send_timeout_ms: 10
Expand Down
2 changes: 1 addition & 1 deletion config/leaps_mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ curator:
http_server:
static_path: /
socket_path: /socket
address: :8080
address: :8001
www_dir: ./static/example
binder:
bind_send_timeout_ms: 10
Expand Down
2 changes: 1 addition & 1 deletion config/leaps_postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ curator:
http_server:
static_path: /
socket_path: /socket
address: :8080
address: :8001
www_dir: ./static/example
binder:
bind_send_timeout_ms: 10
Expand Down
45 changes: 0 additions & 45 deletions data/binder_stories.js

This file was deleted.

169 changes: 0 additions & 169 deletions data/client_stories.js

This file was deleted.

Loading

0 comments on commit 4b13c95

Please sign in to comment.