Skip to content

Commit e3d9297

Browse files
authored
Prepare for publishing to Hex (#26)
* Add Travis config. * Upgrade to rebar3. * Remove rebar binary. * Add badges to readme.
1 parent 47d37a9 commit e3d9297

9 files changed

Lines changed: 49 additions & 75 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
_build
12
ebin
23
.eunit
34
deps
45
src/mimetypes_scan.erl
5-
src/mimetypes_parse.erl
6+
src/mimetypes_parse.erl

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: erlang
2+
sudo: false
3+
otp_release:
4+
- 20.0
5+
- 19.3
6+
7+
jobs:
8+
include:
9+
- stage: deploy
10+
otp_release: 20.0
11+
script: skip
12+
deploy:
13+
provider: script
14+
script: "bash -c 'source <(curl -s https://raw.githubusercontent.com/zotonic/hexpub/master/hexpub.sh)'"
15+
skip_cleanup: true
16+
on:
17+
tags: true
18+
all_branches: true
19+
install:
20+
- wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
21+
script: ./rebar3 eunit

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
mimetypes
22
=========
33

4+
[![Build Status](https://travis-ci.org/erlangpack/mimetypes.svg?branch=master)](https://travis-ci.org/erlangpack/mimetypes)
5+
[![Hex pm](http://img.shields.io/hexpm/v/mimetypes.svg?style=flat)](https://hex.pm/packages/mimetypes)
6+
47
`mimetypes` is an Erlang library to fetch MIME extension/name mappings.
58

69
Usage
@@ -24,7 +27,7 @@ ok
2427
<<"application/x-mpegurl">>]
2528
6> mimetypes:filename("/a/b.js").
2629
<<"application/javascript">>
27-
7> mimetypes:extensions("application/mathematica").
30+
7> mimetypes:extensions(<<"application/mathematica">>).
2831
[<<"ma">>,<<"nb">>,<<"mb">>]
2932
```
3033

post_compile.escript

Lines changed: 0 additions & 41 deletions
This file was deleted.

rebar

-106 KB
Binary file not shown.

rebar.config

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
%% vim: ts=2 sw=2 et ft=erlang
2-
{lib_dirs, ["deps"]}.
3-
{post_hooks,
4-
[
5-
{"(linux|bsd|darwin|solaris)", compile, "./post_compile.escript"},
6-
{"win32", compile, "escript.exe post_compile.escript"}
1+
{profiles, [
2+
{test, [
3+
{deps, [
4+
{proper, "1.2.0"}
5+
]}
6+
]}
77
]}.

rebar.test.config

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/mimetypes.app.src

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
{application, mimetypes,
2-
[
3-
{description, "mimetypes"},
4-
{vsn, "1.0"},
5-
{registered, [mimetypes]},
6-
{applications, [
7-
kernel,
8-
stdlib
9-
]},
10-
{mod, { mimetypes_app, []}},
11-
{env, []}
12-
]}.
1+
{application, mimetypes, [
2+
{vsn, "git"},
3+
{description, "mimetypes"},
4+
{registered, [mimetypes]},
5+
{applications, [
6+
kernel,
7+
stdlib
8+
]},
9+
{mod, {mimetypes_app, []}},
10+
{env, []},
11+
{maintainers, ["Yurii Rashkovskii", "ErlangPack"]},
12+
{licenses, ["BSD"]},
13+
{links, [{"Github", "https://github.com/erlangpack/mimetypes"}]}
14+
]}.

test/mimetypes_tests.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async_loader_test_() ->
130130
]}.
131131

132132
async_loader_onstart() ->
133-
?assertEqual(undefined, mimetypes:ext_to_mimes(<<"foo2">>)).
133+
?_assertEqual(undefined, mimetypes:ext_to_mimes(<<"foo2">>)).
134134

135135
async_loader_wait() ->
136136
receive after 5000 -> ok end, %% @todo don't use an arbitrary time
137-
?assertEqual([<<"bar2">>], mimetypes:ext_to_mimes(<<"foo2">>)).
137+
?_assertEqual([<<"bar2">>], mimetypes:ext_to_mimes(<<"foo2">>)).

0 commit comments

Comments
 (0)