<commit_before>[![Build Status](https://travis-ci.org/bitzesty/qae.svg?branch=master)](https://travis-ci.org/bitzesty/qae)
[![Code Climate](https://codeclimate.com/repos/547de5166956803114000f02/badges/123ad2d3eeebb6bf1ce1/gpa.svg)](https://codeclimate.com/repos/547de5166956803114000f02/feed)
[![Test Coverage](https://codeclimate.com/repos/547de5166956803114000f02/badges/123ad2d3eeebb6bf1ce1/coverage.svg)](https://codeclimate.com/repos/547de5166956803114000f02/feed)

![Logo](https://raw.githubusercontent.com/bitzesty/qae/master/public/logo.jpg) Queen's Awards for Enterprise
---------------------------

"QAE" is the application which powers the application process for the Queen's Awards for Enterprise.

## Setup

### Pre-requisites

* Ruby 2.1.5
* Rails 4.2
* Postgresql 9
* Redis

### Running application

```
./bin/setup
foreman start
```

#### Help

If you see the following error:

```
ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/hstore.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "hstore"

```

This means, that `hstore postgresql` extension needs to be installed:

```
sudo apt-get install postgresql-contrib
```

For passenger:
OSX users you might need to install pcre headers:

```
brew install pcre
```

### Deploy

#### Dev (http://qae.dev.bitzesty.com)

```
$ cap dev deploy OLD_SERVERS=true
```

#### Demo (http://qae.demo.bitzesty.com)

```
$ cap demo deploy OLD_SERVERS=true
```

#### Staging (http://stagingloadbalancer-46995185.eu-west-1.elb.amazonaws.com)
```
$ cap staging deploy
```

#### Production (http://productionloadbalancer-1868729055.eu-west-1.elb.amazonaws.com)
```
$ cap production deploy
```<commit_msg>[README] added note about deploying custom rake task<commit_after>[![Build Status](https://travis-ci.org/bitzesty/qae.svg?branch=master)](https://travis-ci.org/bitzesty/qae)
[![Code Climate](https://codeclimate.com/repos/547de5166956803114000f02/badges/123ad2d3eeebb6bf1ce1/gpa.svg)](https://codeclimate.com/repos/547de5166956803114000f02/feed)
[![Test Coverage](https://codeclimate.com/repos/547de5166956803114000f02/badges/123ad2d3eeebb6bf1ce1/coverage.svg)](https://codeclimate.com/repos/547de5166956803114000f02/feed)

![Logo](https://raw.githubusercontent.com/bitzesty/qae/master/public/logo.jpg) Queen's Awards for Enterprise
---------------------------

"QAE" is the application which powers the application process for the Queen's Awards for Enterprise.

## Setup

### Pre-requisites

* Ruby 2.1.5
* Rails 4.2
* Postgresql 9
* Redis

### Running application

```
./bin/setup
foreman start
```

#### Help

If you see the following error:

```
ActiveRecord::StatementInvalid: PG::UndefinedFile: ERROR:  could not open extension control file "/usr/share/postgresql/9.3/extension/hstore.control": No such file or directory
: CREATE EXTENSION IF NOT EXISTS "hstore"

```

This means, that `hstore postgresql` extension needs to be installed:

```
sudo apt-get install postgresql-contrib
```

For passenger:
OSX users you might need to install pcre headers:

```
brew install pcre
```

### Deploy

#### Dev (http://qae.dev.bitzesty.com)

```
$ cap dev deploy OLD_SERVERS=true
```

#### Demo (http://qae.demo.bitzesty.com)

```
$ cap demo deploy OLD_SERVERS=true
```

#### Staging (http://stagingloadbalancer-46995185.eu-west-1.elb.amazonaws.com)
```
$ cap staging deploy
```

#### Production (http://productionloadbalancer-1868729055.eu-west-1.elb.amazonaws.com)
```
$ cap production deploy
```

#### Running of custom rake task on server
dev / demo servers:
```
$ cap dev cap_rake:invoke task="db:migrate" OLD_SERVERS=true
```

AWS servers (staging/ production):
```
$ cap dev cap_rake:invoke task="db:migrate"
```
{'fraction_non_alphanumeric': 0.16613672496025436, 'fraction_numerical': 0.06783253842077372, 'mean_word_length': 4.834621329211746, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, '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': '1479344', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1315, 'n_words': 268}