Skip to content

Commit

Permalink
Fix hex configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGagne committed Feb 25, 2023
1 parent 5e76ea5 commit a952b05
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 60 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# robots

[![Build Status](https://github.com/AntoineGagne/robots/actions/workflows/erlang.yml/badge.svg)](https://github.com/AntoineGagne/robots/actions)
[![Hex Pm](http://img.shields.io/hexpm/v/robots.svg?style=flat)](https://hex.pm/packages/robots)
[![Docs](https://img.shields.io/badge/hex-docs-green.svg?style=flat)](https://hexdocs.pm/robots)
[![Releases](https://img.shields.io/github/release/AntoineGagne/robots?color=brightgreen)](https://github.com/AntoineGagne/robots/releases)
[![Coverage](https://coveralls.io/repos/github/AntoineGagne/robots/badge.svg?branch=master)](https://coveralls.io/github/AntoineGagne/robots?branch=master)

A library that parses and validates rules from `robots.txt`.

## Installation

This library is available on [hex.pm](https://hex.pm/packages/robots).
To install this library, simply add the following lines to your
`rebar.config`:

```erlang
{robots, "1.1.1"}
```

## Usage

```erlang
Content = <<"User-Agent: bot\nAllow: /fish">>,
%% This will return an opaque type that contains all the rules and their agents
{ok, RulesIndex} = robots:parse(Content, 200),
true = robots:is_allowed(<<"bot/1.0.0">>, <<"/fish/salmon.html">>, RulesIndex),
true = robots:is_allowed(<<"bot/1.0.0">>, <<"/Fish.asp">>, RulesIndex),
```

## Development

### Running all the tests and linters

You can run all the tests and linters with the `rebar3` alias:

```sh
rebar3 check
```
59 changes: 0 additions & 59 deletions README.rst

This file was deleted.

14 changes: 14 additions & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@

{deps, []}.

{project_plugins, [rebar3_ex_doc]}.

{hex, [{doc, ex_doc}]}.

{ex_doc, [
{extras, [
{"README.md", #{title => "Overview"}},
{"LICENSE", #{title => "License"}}
]},
{main, "README.md"},
{homepage_url, "https://github.com/AntoineGagne/robots"},
{source_url, "https://github.com/AntoineGagne/robots"}
]}.

{profiles, [
{prod, [
{relx, [
Expand Down
2 changes: 1 addition & 1 deletion src/robots.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
]},
{env,[]},
{modules, []},
{licenses, ["BSD3"]},
{licenses, ["BSD-3-Clause"]},
{links, [{"Github", "https://github.com/AntoineGagne/robots"}]}
]}.

0 comments on commit a952b05

Please sign in to comment.