Skip to content

Commit

Permalink
Merge pull request #1251 from cucumber/elixir-gherkin-implementation
Browse files Browse the repository at this point in the history
Elixir gherkin parser implementation
  • Loading branch information
aslakhellesoy authored Dec 10, 2020
2 parents 6b86b95 + 052b452 commit b13a53f
Show file tree
Hide file tree
Showing 247 changed files with 15,650 additions and 105 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,17 @@ jobs:
cd messages/elixir
make
gherkin-elixir:
executor: docker-cucumber-build
steps:
- attach_workspace:
at: "~/cucumber"
- run:
name: gherkin/elixir
command: |
cd gherkin/elixir
make
###
### Workflows ###
###
Expand Down Expand Up @@ -1060,3 +1071,7 @@ workflows:
- messages-elixir:
requires:
- checkout

- gherkin-elixir:
requires:
- checkout
30 changes: 30 additions & 0 deletions .templates/elixir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Created by https://www.toptal.com/developers/gitignore/api/elixir,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=elixir,vscode

### Elixir ###
/_build
/cover
/deps
/doc
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/

### Elixir Patch ###

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/elixir,vscode

.deps
.tested
48 changes: 48 additions & 0 deletions .templates/elixir/default.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
SHELL := /usr/bin/env bash
ELIXIR_SOURCE_FILES = $(shell find . -name "*.ex")

default: .tested

.tested: .deps $(ELIXIR_SOURCE_FILES)
mix test
touch $@

.deps:
mix local.hex --force
mix deps.get
touch $@

update-dependencies:
@echo -e "\033[0;31mPlease update dependencies for elixir manually in mix.exs!! Check https://hex.pm/ for the latest version.\033[0m"
@echo -e "\033[0;31mSome packages require some options (such as ex_doc), check the package its readme / hexdocs.\033[0m"
.PHONY: update-dependencies

pre-release: update-version update-dependencies clean default
[ -f '/home/cukebot/import-gpg-key.sh' ] && /home/cukebot/import-gpg-key.sh
.PHONY: pre-release

update-version:
ifdef NEW_VERSION
sed -Ei 's/@vsn "[^"]+"/@vsn "$(NEW_VERSION)"/' mix.exs
else
@echo -e "\033[0;31mNEW_VERSION is not defined. Can't update version :-(\033[0m"
exit 1
endif
.PHONY: update-version

publish: .deps
ifdef HEX_API_KEY
mix hex.publish --yes
else
@echo -e "\033[0;31mHEX_API_KEY is not defined. Can't update version :-(\033[0m"
exit 1
endif

.PHONY: publish

post-release:
@echo "No post-release for elixir projects (yet)"
.PHONY: post-release

clean:
rm -rf _build deps .deps .tested
105 changes: 55 additions & 50 deletions gherkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ This document is formatted according to the principles of [Keep A CHANGELOG](htt

### Added

* [Elixir] New implementation!
([#1251](https://github.com/cucumber/cucumber/pull/1251)
[WannesFransen1994])

### Changed

### Deprecated
Expand Down Expand Up @@ -854,53 +858,54 @@ to Gherkin 2.
[3.1.0]: https://github.com/cucumber/gherkin/compare/v3.0.0...v3.1.0

<!-- Contributors -->
[Ahmed-Ali]: https://github.com/Ahmed-Ali
[ankitpokhrel]: https://github.com/ankitpokhrel
[ajspadial]: https://github.com/ajspadial
[aslakhellesoy]: https://github.com/aslakhellesoy
[badeball]: https://github.com/badeball
[brasmusson]: https://github.com/brasmusson
[charlierudolph]: https://github.com/charlierudolph
[coderbyheart]: https://github.com/coderbyheart
[cyocum]: https://github.com/cyocum
[danilat]: https://github.com/danilat
[davidjgoss]: https://github.com/davidjgoss
[deivid-rodriguez] https://github.com/deivid-rodriguez
[dobiedad]: https://github.com/dobiedad
[ehpc]: https://github.com/ehpc
[enkessler]: https://github.com/enkessler
[gabanz]: https://github.com/gabanz
[Haukinger]: https://github.com/Haukinger
[jargalan]: https://github.com/jargalan
[jmezach]: https://github.com/jmezach
[joscha]: https://github.com/joscha
[koterpillar]: https://github.com/koterpillar
[KniveX]: https://github.com/KniveX
[l3pp4rd]: https://github.com/l3pp4rd
[LiohAu]: https://github.com/LiohAu
[mattwynne]: https://github.com/mattwynne
[mauriciotogneri]: https://github.com/mauriciotogneri
[maximeg]: https://github.com/maximeg
[maxmeyer]: https://github.com/maxmeyer
[mpkorstanje]: https://github.com/mpkorstanje
[merrua]: https://github.com/merrua
[milhcbt]: https://github.com/milhcbt
[moreau-nicolas]: https://github.com/moreau-nicolas
[mpkorstanje]: https://github.com/mpkorstanje
[ookull]: https://github.com/ookull
[nalekberov]: https://github.com/nalekberov
[nixel2007]: https://github.com/nixel2007
[nikolovski]: https://github.com/nikolovski
[noisygerman]: https://github.com/noisygerman
[paigehf]: https://github.com/paigehf
[pjlsergeant]: https://github.com/pjlsergeant
[pmatsinopoulos]: https://github.com/pmatsinopoulos
[rjwittams]: https://github.com/rjwittams
[Pr-Mex]: https://github.com/Pr-Mex
[Pwera]: https://github.com/Pwera
[SabotageAndi]: https://github.com/SabotageAndi
[tsundberg]: https://github.com/tsundberg
[upgundecha]: https://github.com/upgundecha
[vincent-psarga]: https://github.com/vincent-psarga
[zbmott]: https://github.com/zbmott
[Zearin]: https://github.com/Zearin
[Ahmed-Ali]: https://github.com/Ahmed-Ali
[ankitpokhrel]: https://github.com/ankitpokhrel
[ajspadial]: https://github.com/ajspadial
[aslakhellesoy]: https://github.com/aslakhellesoy
[badeball]: https://github.com/badeball
[brasmusson]: https://github.com/brasmusson
[charlierudolph]: https://github.com/charlierudolph
[coderbyheart]: https://github.com/coderbyheart
[cyocum]: https://github.com/cyocum
[danilat]: https://github.com/danilat
[davidjgoss]: https://github.com/davidjgoss
[deivid-rodriguez] https://github.com/deivid-rodriguez
[dobiedad]: https://github.com/dobiedad
[ehpc]: https://github.com/ehpc
[enkessler]: https://github.com/enkessler
[gabanz]: https://github.com/gabanz
[Haukinger]: https://github.com/Haukinger
[jargalan]: https://github.com/jargalan
[jmezach]: https://github.com/jmezach
[joscha]: https://github.com/joscha
[koterpillar]: https://github.com/koterpillar
[KniveX]: https://github.com/KniveX
[l3pp4rd]: https://github.com/l3pp4rd
[LiohAu]: https://github.com/LiohAu
[mattwynne]: https://github.com/mattwynne
[mauriciotogneri]: https://github.com/mauriciotogneri
[maximeg]: https://github.com/maximeg
[maxmeyer]: https://github.com/maxmeyer
[mpkorstanje]: https://github.com/mpkorstanje
[merrua]: https://github.com/merrua
[milhcbt]: https://github.com/milhcbt
[moreau-nicolas]: https://github.com/moreau-nicolas
[mpkorstanje]: https://github.com/mpkorstanje
[ookull]: https://github.com/ookull
[nalekberov]: https://github.com/nalekberov
[nixel2007]: https://github.com/nixel2007
[nikolovski]: https://github.com/nikolovski
[noisygerman]: https://github.com/noisygerman
[paigehf]: https://github.com/paigehf
[pjlsergeant]: https://github.com/pjlsergeant
[pmatsinopoulos]: https://github.com/pmatsinopoulos
[rjwittams]: https://github.com/rjwittams
[Pr-Mex]: https://github.com/Pr-Mex
[Pwera]: https://github.com/Pwera
[SabotageAndi]: https://github.com/SabotageAndi
[tsundberg]: https://github.com/tsundberg
[upgundecha]: https://github.com/upgundecha
[vincent-psarga]: https://github.com/vincent-psarga
[zbmott]: https://github.com/zbmott
[Zearin]: https://github.com/Zearin
[WannesFransen1994]: https://github.com/WannesFransen1994
4 changes: 2 additions & 2 deletions gherkin/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LANGUAGES ?= go javascript ruby java
include default.mk
LANGUAGES ?= go javascript ruby java elixir
include default.mk
5 changes: 5 additions & 0 deletions gherkin/elixir/.github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PLEASE DO NOT CREATE ISSUES IN THIS REPO.
THIS REPO IS A READ-ONLY MIRROR.

Create your issue in the Cucumber monorepo instead:
https://github.com/cucumber/cucumber/issues
5 changes: 5 additions & 0 deletions gherkin/elixir/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PLEASE DO NOT CREATE PULL REAUESTS IN THIS REPO.
THIS REPO IS A READ-ONLY MIRROR.

Create your pull request in the Cucumber monorepo instead:
https://github.com/cucumber/cucumber/pulls
30 changes: 30 additions & 0 deletions gherkin/elixir/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Created by https://www.toptal.com/developers/gitignore/api/elixir,vscode
# Edit at https://www.toptal.com/developers/gitignore?templates=elixir,vscode

### Elixir ###
/_build
/cover
/deps
/doc
/.fetch
erl_crash.dump
*.ez
*.beam
/config/*.secret.exs
.elixir_ls/

### Elixir Patch ###

### vscode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# End of https://www.toptal.com/developers/gitignore/api/elixir,vscode

.deps
.tested
6 changes: 6 additions & 0 deletions gherkin/elixir/.rsync
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
../LICENSE LICENSE
../../.templates/github/ .github/
../../.templates/elixir/ .
../testdata/ testdata/
../gherkin.berp resources/gherkin.berp
../gherkin-languages.json resources/gherkin_languages.json
21 changes: 21 additions & 0 deletions gherkin/elixir/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Cucumber Ltd, Gaspar Nagy, Björn Rasmusson, Peter Sergeant

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.
12 changes: 12 additions & 0 deletions gherkin/elixir/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
include default.mk

.deps: lib/gherkin/parser.ex

lib/gherkin/parser.ex: resources/gherkin.berp gherkin-elixir.razor
mono /var/lib/berp/1.1.1/tools/net471/Berp.exe -g resources/gherkin.berp -t gherkin-elixir.razor -o $@
# Remove BOM
awk 'NR==1{sub(/^\xef\xbb\xbf/,"")}{print}' < $@ > $@.nobom
mv $@.nobom $@

clobber: clean
rm -f lib/gherkin/parser.ex
Loading

0 comments on commit b13a53f

Please sign in to comment.