Skip to content

Commit

Permalink
Prepare for publishing to Hex (#26)
Browse files Browse the repository at this point in the history
* Add Travis config.
* Upgrade to rebar3.
* Remove rebar binary.
* Add badges to readme.
  • Loading branch information
ddeboer committed Jul 14, 2017
1 parent 47d37a9 commit e3d9297
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 75 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,5 +1,6 @@
_build
ebin
.eunit
deps
src/mimetypes_scan.erl
src/mimetypes_parse.erl
src/mimetypes_parse.erl
21 changes: 21 additions & 0 deletions .travis.yml
@@ -0,0 +1,21 @@
language: erlang
sudo: false
otp_release:
- 20.0
- 19.3

jobs:
include:
- stage: deploy
otp_release: 20.0
script: skip
deploy:
provider: script
script: "bash -c 'source <(curl -s https://raw.githubusercontent.com/zotonic/hexpub/master/hexpub.sh)'"
skip_cleanup: true
on:
tags: true
all_branches: true
install:
- wget https://s3.amazonaws.com/rebar3/rebar3 && chmod +x rebar3
script: ./rebar3 eunit
5 changes: 4 additions & 1 deletion README.md
@@ -1,6 +1,9 @@
mimetypes
=========

[![Build Status](https://travis-ci.org/erlangpack/mimetypes.svg?branch=master)](https://travis-ci.org/erlangpack/mimetypes)
[![Hex pm](http://img.shields.io/hexpm/v/mimetypes.svg?style=flat)](https://hex.pm/packages/mimetypes)

`mimetypes` is an Erlang library to fetch MIME extension/name mappings.

Usage
Expand All @@ -24,7 +27,7 @@ ok
<<"application/x-mpegurl">>]
6> mimetypes:filename("/a/b.js").
<<"application/javascript">>
7> mimetypes:extensions("application/mathematica").
7> mimetypes:extensions(<<"application/mathematica">>).
[<<"ma">>,<<"nb">>,<<"mb">>]
```

Expand Down
41 changes: 0 additions & 41 deletions post_compile.escript

This file was deleted.

Binary file removed rebar
Binary file not shown.
12 changes: 6 additions & 6 deletions rebar.config
@@ -1,7 +1,7 @@
%% vim: ts=2 sw=2 et ft=erlang
{lib_dirs, ["deps"]}.
{post_hooks,
[
{"(linux|bsd|darwin|solaris)", compile, "./post_compile.escript"},
{"win32", compile, "escript.exe post_compile.escript"}
{profiles, [
{test, [
{deps, [
{proper, "1.2.0"}
]}
]}
]}.
12 changes: 0 additions & 12 deletions rebar.test.config

This file was deleted.

26 changes: 14 additions & 12 deletions src/mimetypes.app.src
@@ -1,12 +1,14 @@
{application, mimetypes,
[
{description, "mimetypes"},
{vsn, "1.0"},
{registered, [mimetypes]},
{applications, [
kernel,
stdlib
]},
{mod, { mimetypes_app, []}},
{env, []}
]}.
{application, mimetypes, [
{vsn, "git"},
{description, "mimetypes"},
{registered, [mimetypes]},
{applications, [
kernel,
stdlib
]},
{mod, {mimetypes_app, []}},
{env, []},
{maintainers, ["Yurii Rashkovskii", "ErlangPack"]},
{licenses, ["BSD"]},
{links, [{"Github", "https://github.com/erlangpack/mimetypes"}]}
]}.
4 changes: 2 additions & 2 deletions test/mimetypes_tests.erl
Expand Up @@ -130,8 +130,8 @@ async_loader_test_() ->
]}.

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

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

0 comments on commit e3d9297

Please sign in to comment.