Skip to content

Commit

Permalink
Merge pull request #1 from ts-klassen/main
Browse files Browse the repository at this point in the history
Initial implementation
  • Loading branch information
4kimov authored Jan 21, 2024
2 parents 9e53876 + a0d6130 commit 31c893a
Show file tree
Hide file tree
Showing 13 changed files with 1,434 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/erlang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Erlang CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:

erlang24:

runs-on: ubuntu-latest

container:
image: erlang:24

steps:
- uses: actions/checkout@v3
- name: Compile
run: rebar3 compile
- name: Run tests
run: rebar3 do eunit, ct

erlang25:

runs-on: ubuntu-latest

container:
image: erlang:25

steps:
- uses: actions/checkout@v3
- name: Compile
run: rebar3 compile
- name: Run tests
run: rebar3 do eunit, ct

erlang26:

runs-on: ubuntu-latest

container:
image: erlang:26

steps:
- uses: actions/checkout@v3
- name: Compile
run: rebar3 compile
- name: Run tests
run: rebar3 do eunit, ct
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.rebar3
_*
.eunit
*.o
*.beam
*.plt
*.swp
*.swo
.erlang.cookie
ebin
log
erl_crash.dump
.rebar
logs
_build
.idea
*.iml
rebar3.crashdump
*~
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# CHANGELOG

@todo
## UNRELEASED 0.1.0
### New Feature
- Initial implementation
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,34 @@ Sqids (pronounced "squids") is a small library that lets you generate YouTube-lo

## Getting started

@todo
Add sqids as a dependency to rebar.config
<!-- FIXME: 0.1.0 is unreleased. -->
```erlang
{deps,
[
{sqids, {git, "https://github.com/sqids/sqids-erlang.git", {tag, "0.1.0"}}}
]
}.
```
Supported Erlang versions are
- Erlang/OTP 24
- Erlang/OTP 25
- Erlang/OTP 26

## Examples

@todo
```erlang
1> Sqids = sqids:new(),
1> Id = sqids:encode([1, 2, 3], Sqids).
<<"86Rf07">>
2> sqids:decode(Id, Sqids).
[1,2,3]
3> MySqids = sqids:new(#{alphabet=><<"ABC123">>, min_length=>10, blocklist=>[]}),
3> MyId = sqids:encode([0], MySqids).
<<"A13C2B31AC">>
4> sqids:decode(MyId, MySqids).
[0]
```

## License

Expand Down
2 changes: 2 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{erl_opts, [debug_info]}.
{deps, []}.
1 change: 1 addition & 0 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[].
14 changes: 14 additions & 0 deletions src/sqids.app.src
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{application, sqids,
[{description, "An OTP library"},
{vsn, "0.1.0"},
{registered, []},
{applications,
[kernel,
stdlib
]},
{env,[]},
{modules, []},

{licenses, ["MIT License"]},
{links, []}
]}.
Loading

0 comments on commit 31c893a

Please sign in to comment.