Init project

This commit is contained in:
Anton Vakhrushev 2019-11-03 11:33:16 +03:00
commit 3b93c725a3
14 changed files with 181 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
/.crystal/
/.shards/
/coverage/

14
.editorconfig Normal file
View File

@ -0,0 +1,14 @@
root = true
[*.cr]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[*.md]
indent_style = tab
indent_size = 2
insert_final_newline = true

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
/.crystal/
/.shards/
/bin/
/build/
/coverage/
/docs/
/lib/
/tmp/
*.dwarf
*.sublime*
spec_cov_*

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM alpine:edge as builder
# Install crystal and dev libs
RUN apk add -u \
crystal \
shards \
make \
tzdata \
libc-dev \
yaml-dev

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2019 Anton Vakhrushev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

32
Makefile Normal file
View File

@ -0,0 +1,32 @@
PATH := tools:$(PATH)
APP_NAME := dayoff
ENTRY_POINT = ./src/$(APP_NAME).cr
.PHONY: build-docker
build-docker:
docker pull alpine:edge
docker build -t $(APP_NAME)-crystal .
.PHONY: install
install: build-docker
.PHONY: build
build:
mkdir -p build
crystal build $(ENTRY_POINT) --release --no-debug --static -o build/$(APP_NAME)
.PHONY: format
format:
crystal tool format ./src ./spec
.PHONY: run
run: format
crystal run $(ENTRY_POINT)
.PHONY: spec
spec: format
crystal spec --warnings all --error-on-warnings --error-trace
.PHONY: ameba
ameba:
ameba src/ || true

27
README.md Normal file
View File

@ -0,0 +1,27 @@
# Can I take a daya off?
TODO: Write a description here
## Installation
TODO: Write installation instructions here
## Usage
TODO: Write usage instructions here
## Development
TODO: Write development instructions here
## Contributing
1. Fork it (<https://github.com/your-github-user/dayoff/fork>)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [your-name-here](https://github.com/your-github-user) - creator and maintainer

13
shard.yml Normal file
View File

@ -0,0 +1,13 @@
name: dayoff
version: 0.1.0
authors:
- Anton Vakhrushev <anton@vakhrushev.me>
targets:
dayoff:
main: src/dayoff.cr
crystal: 0.31.1
license: MIT

9
spec/dayoff_spec.cr Normal file
View File

@ -0,0 +1,9 @@
require "./spec_helper"
describe Dayoff do
# TODO: Write tests
it "works" do
false.should eq(true)
end
end

2
spec/spec_helper.cr Normal file
View File

@ -0,0 +1,2 @@
require "spec"
require "../src/dayoff"

6
src/dayoff.cr Normal file
View File

@ -0,0 +1,6 @@
# TODO: Write documentation for `Dayoff`
module Dayoff
VERSION = "0.1.0"
# TODO: Put your code here
end

9
tools/ameba Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu
docker run -it \
-u "$(id -u):$(id -g)" \
-v "$PWD:/app" \
-w "/app" \
dayoff-crystal ./bin/ameba "$@"

15
tools/crystal Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -eu
TTY=
if [ -t 1 ] ; then
TTY=-t
fi
docker run -i $TTY \
-u "$(id -u):$(id -g)" \
-v "$PWD:/app" \
-w "/app" \
dayoff-crystal crystal "$@"

9
tools/shards Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu
docker run -it \
-u "$(id -u):$(id -g)" \
-v "$PWD:/app" \
-w "/app" \
dayoff-crystal shards "$@"