M LICENSE +2 -2
@@ 1,4 1,4 @@
-Copyright (c) 2013, orbitz.
+Copyright (c) 2017, mimirops.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ 25,4 25,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIA
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
No newline at end of file
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
M README.org +1 -10
@@ 1,11 1,2 @@
* About
-To use:
-#+BEGIN_SRC
-# -n: required, name
-# -r: optional, will push branch to the remote if provided
-# -d: optional, description for generated README.org.
-# Can be multi-line string.
-# Additional deps are optional.
-
-$ scripts/genesis -n <project name> -r <git remote> -d <description> [dep1 [dep2 ... depn]]
-#+END_SRC
+Logic-less template system
A => pds.conf +12 -0
@@ 0,0 1,12 @@
+[global.release]
+extra_compiler_opts = "-strict-sequence -strict-formats -safe-string -noassert"
+
+[global.debug]
+extra_compiler_opts = "-g -strict-sequence -strict-formats -safe-string -w '@d@f@p@u@s@40'"
+
+[src.snabela]
+install = true
+deps = [ "containers", "sedlex", "menhir" ]
+
+[tests.snabela]
+deps = [ "snabela" ]
R scripts/advertise => +0 -25
@@ 1,25 0,0 @@
-#! /usr/bin/env bash
-
-set -e
-
-if [[ "$#" -gt "1" ]]; then
- cat <<EOF
-Usage: $0 <project name> <dep1> ... <depN>
-EOF
- exit 1
-fi
-
-REMOTE=$1
-
-git remote rm origin
-git checkout -b initial
-git add pds.conf README.org LICENSE
-git add src tests
-git rm -rf scripts
-git commit -m "Initial commit. Generated from templater."
-
-if [[ -n "$REMOTE" ]]; then
- git remote add origin $REMOTE
- # push master and initial
- git push --set-upstream --all origin
-fi
R scripts/differentiate => +0 -55
@@ 1,55 0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-# Quote list of strings and comma separate them.
-function format_dep_list {
- if [[ "$#" -gt "0" ]]; then
- echo $* | xargs -n1 -I{} echo -n '"{}"' | sed 's/""/", "/g'
- else
- echo ""
- fi
-}
-
-if [[ "$#" -eq "0" ]]; then
- cat <<EOF
-Usage: $0 <project name> <dep1> ... <depN>
-EOF
- exit 1
-fi
-
-NAME="$(echo "$1" | tr '-' '_')"
-shift
-DEPS=$@
-
-# Create Dirs
-mkdir -p "src/$NAME"
-mkdir -p "tests/$NAME"
-
-# Output pds.conf
-cat <<EOF > pds.conf
-[global.release]
-extra_compiler_opts = "-strict-sequence -strict-formats -safe-string -noassert"
-
-[global.debug]
-extra_compiler_opts = "-g -strict-sequence -strict-formats -safe-string -w '@d@f@p@u@s@40'"
-
-[src.$NAME]
-install = true
-deps = [ $(format_dep_list $DEPS) ]
-
-[tests.$NAME]
-deps = [ $(format_dep_list $NAME) ]
-EOF
-
-# Output dummy src file.
-cat <<EOF > "src/$NAME/$NAME.ml"
-(* How you doin'. *)
-print_endline "Hello, Beautiful!";;
-EOF
-
-# Output dummy test file.
-cat <<EOF > "tests/$NAME/test.ml"
-(* Be kind. Test. *)
-exit 1;;
-EOF
R scripts/enlighten => +0 -44
@@ 1,44 0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-DESCRIPTION="$1"
-YEAR=$(date "+%Y")
-
-LICENSE_ENTITY="$(git config user.license.entity || git config user.name)"
-
-cat <<EOF > LICENSE
-Copyright (c) $YEAR, $LICENSE_ENTITY.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of riakc or ocaml-riakc nor the names of its contributors may be
- used to endorse or promote products derived from this software without
- specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-EOF
-
-cat <<EOF > README.org
-* About
-$DESCRIPTION
-EOF
R scripts/genesis => +0 -39
@@ 1,39 0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-function usage {
- exit 1
-}
-
-# n: required project name
-# d: optional description
-# r: optional remote
-while getopts "n:r:d:" opt; do
- case "$opt" in
- n)
- NAME=$OPTARG
- ;;
- r)
- REMOTE=$OPTARG
- ;;
- d)
- DESCRIPTION="$OPTARG"
- ;;
- *)
- usage
- ;;
- esac
-done
-
-if [[ -z "$NAME" ]]; then
- usage
-fi
-
-shift $((OPTIND-1))
-
-SCRIPT_DIR="$(dirname $0)"
-
-"$SCRIPT_DIR/differentiate" $NAME $*
-"$SCRIPT_DIR/enlighten" "$DESCRIPTION"
-"$SCRIPT_DIR/advertise" $REMOTE
R scripts/tests/genesis_test => +0 -60
@@ 1,60 0,0 @@
-#!/usr/bin/env bash
-
-# Regression test for genesis script.
-# Assumes it is being executed from the root of the git repo.
-# So ROOT/scripts/tests/<this file>.
-# Relatively destructive, so best if run from a clean happy place
-# after you've committed important changes or from your
-# test automation in a clean environment.
-
-set -e
-set -x
-
-HEAD_REF=$(git symbolic-ref --short HEAD)
-
-REMOTE_DIR=$(mktemp -d)
-
-# Constants
-TEST_DESCRIPTION="Test Baz"
-TEST_DEPS="core"
-TEST_REMOTE_SUFFIX="testremote.git"
-TEST_PROJECT_NAME="footest"
-TEST_GIT_BRANCH="initial"
-
-# Create test remote
-pushd $REMOTE_DIR
-git init --bare $TEST_REMOTE_SUFFIX
-popd
-
-scripts/genesis -n $TEST_PROJECT_NAME \
- -r "file://$REMOTE_DIR/$TEST_REMOTE_SUFFIX" \
- -d "$TEST_DESCRIPTION" $TEST_DEPS
-
-# Verify we're on the initial branch.
-git symbolic-ref --short HEAD | grep $TEST_GIT_BRANCH
-
-# Verify origin is testremote.git
-git remote -vv | grep origin | grep $TEST_REMOTE_SUFFIX
-
-# Verify we've cleaned up the scripts after we're done.
-if [[ -d scripts ]]; then
- exit 1
-fi
-
-# Make should succeed
-gmake
-
-# Test has some fail code in it, so don't run it.
-grep "exit 1" tests/$TEST_PROJECT_NAME/$TEST_PROJECT_NAME.ml
-
-# License should have the correct year in it.
-grep $(date "+%Y") LICENSE
-
-# We put the right stuff in the README.
-grep "$TEST_DESCRIPTION" README.org
-
-# Cleanup
-rm -rf $REMOTE_DIR
-git checkout $HEAD_REF
-
-echo "Success!"
R scripts/tests/initial_state => +0 -12
@@ 1,12 0,0 @@
-#!/usr/bin/env bash
-
-# Some helper code to put the directory back in a testable state
-# after a bogo test run. Meant to make human debugging of the
-# tests a bit easier.
-
-set -e
-
-git clean -f -d
-git reset HEAD --hard
-git branch -D initial || true
-git remote add origin foo || true
A => src/snabela/snabela.ml +2 -0
@@ 0,0 1,2 @@
+(* How you doin'. *)
+print_endline "Hello, Beautiful!";;
A => tests/snabela/test.ml +2 -0
@@ 0,0 1,2 @@
+(* Be kind. Test. *)
+exit 1;;