<commit_before>## my_api

This is a simple rails app to illustrate a simple restful api

### Gems used

- _Devise_ for authentication;
- _CanCanCan_ for authorization;
- _Rspec_ for testing;
- _simple_token_authentication_ for token authentication;
- _jbuilder_ for json response;
- _faker_ for generating random data;

### Set up

- run `bundle` to install the dependencies;
- run `bundle exec rake db:setup` to set up the database. It'll also add some registers using the seeds file;

### Running

After the setting everything, you only need to start the rails server:

```
bundle exec rails s -p3000
```

This will start a new rails server on port 3000. The current available restful endpoints are:

- localhost:3000/api/v1/articles
- localhost:3000/api/v1/articles/:article_id/comments

### Roles

There are currently 3 access roles:

- Admin: can manage all data;
- User: can read and create everything, but only update it's registers;
- Guest: can only read data;

### Authentication

_Devise_ and _simple_token_authentication_ are used for authentication. Running `bundle exec rake db:setup` will create an Admin and a User. In order to authenticate you need to pass the `user_email` and the `user_token` params along with the request. Example:

```
curl \
--data "article%5Bbody%5D=Article+body&article%5Btitle%5D=Article+Title&article%5Buser_id%5D=1" \
-X POST \
http://localhost:3000/api/v1/articles?user_email=<EMAIL>&user_token=<PASSWORD>
```

This will create a new article. If the `user_email` and `user_token` don't get passed (or don't match with the database) the access will be unauthorized. Guest users don't need to authenticate.

### Tests

Run `bundle exec rspec` or `bundle exec rake`.

### Copyright

Copyright (c) 2015 <NAME>. See LICENSE.txt for further details.<commit_msg>docs(Readme): removed information about devise and simple token<commit_after>## my_api

This is a simple rails app to illustrate a simple restful api

### Gems used

- _CanCanCan_ for authorization;
- _Rspec_ for testing;
- _jbuilder_ for json response;
- _faker_ for generating random data;

### Set up

- run `bundle` to install the dependencies;
- run `bundle exec rake db:setup` to set up the database. It'll also add some registers using the seeds file;

### Running

After the setting everything, you only need to start the rails server:

```
bundle exec rails s -p3000
```

This will start a new rails server on port 3000. The current available restful endpoints are:

- localhost:3000/api/v1/articles
- localhost:3000/api/v1/articles/:article_id/comments

### Roles

There are currently 3 access roles:

- Admin: can manage all data;
- User: can read and create everything, but only update it's registers;
- Guest: can only read data;

### Authentication

Basic http authentication is used. Running `bundle exec rake db:setup` will create an Admin and a User. In order to authenticate you need to fill the user name and password with the user's email and password.

### Tests

Run `bundle exec rspec` or `bundle exec rake`.

### Copyright

Copyright (c) 2015 <NAME>. See LICENSE.txt for further details.
{'fraction_non_alphanumeric': 0.08518161362905818, 'fraction_numerical': 0.01864352298296368, 'mean_word_length': 4.469244288224956, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3032616', 'n_tokens_mistral': 979, 'n_tokens_neox': 892, 'n_words': 408}