<commit_before># Lale.Help

[![Circle CI](https://circleci.com/gh/lale-help/lale-help.svg?style=svg)](https://circleci.com/gh/lale-help/lale-help)

This is the rails application used for lale.help.

# Table of contents

<!-- MarkdownTOC depth=1 autolink=true bracket=round -->

- [Development hints for docker](#development-hints-for-docker)
- [URLs](#urls)
- [Internationalization \(I18N\)](#internationalization-i18n)
- [Restoring the database from a snapshot](#restoring-the-database-from-a-snapshot)
- [Advice for writing feature specs](#advice-for-writing-feature-specs)
- [Styleguide](#styleguide)
- [Environments and deployment](#environments-and-deployment)
- [Further documentation](#further-documentation)
- [License](#license)

<!-- /MarkdownTOC -->


## Development hints for docker

You can run Lale on your development machine using one of two methods:

1. on the native OS *(easy to set up on a Mac, setup used by the last 2 core developers)*
1. running in a Linux container using [Docker](https://www.docker.com/) *(recommended for Rails beginners)*

### Standard Rails Project


### Docker Project

Before you do anything, install [Docker](http://www.docker.com/) for your OS.

When working with docker, there are many scripts found in the `docker` folder to help you get started.
Feel free to read through these scripts to understand what Docker and Docker Compose are doing under
the hood to start the rails application

#### Starting Rails
  To run the rails server, just execute the following script on your development machine.

  `./docker/start`

  This starts rails and the associated services (PostgreSQL, etc...) in the background with docker.
  To view the rails logs, you can use `./docker/logs`


#### Docker Scripts
| Script Description                         | How to run                            |
|--------------------------------------------|---------------------------------------|
| Start Rails (and other services)           | `./docker/start`                      |
| Open a Rails console                       | `./docker/rails-console`              |
| Run Tests                                  | `./docker/rspec [/path/to/spec]`      |
| Migrate the DB                             | `./docker/db-migrate`                 |
| Run a one off command in the web container | `./docker/exec COMMAND`               |
| Run bash on the web container              | `./docker/shell`                      |
| Inspect the DB with psql                   | `./docker/psql`                       |
| View the logs from every service           | `./docker/logs`                       |
| Stop all services                          | `./docker/stop`                       |
| Rebuild the web container                  | `./docker/build`                      |
| Reset your Docker environment              | `./docker/reset`                      |

### Adding icons to the lale iconfont

We use a custom font to combine our icons into one file, in order to save bandwith and HTTP requests. The icons are stored in `app/assets/icons` and need to be in SVG format, the (generated) font files are in `app/assets/fonts/lale/lale.*. 

Run the command `fontcustom compile` to update the font file after changing anything in the icons directory. The [fontcustom gem](https://github.com/FontCustom/fontcustom/) needs to be installed separately, it is not contained in the gem file. See the configuration file [config/fontcustom.yml](config/fontcustom.yml) for details.

### Adding JavaScript packages / dependencies

We use [bower](https://bower.io) to manage complex JS dependencies. Do the following to add a new JS dependency:

```
cd vendor/assets
bower install package_name --save
```

Then use the package documentation to understand which JS and CSS files you need to require, find them in `vendor/assets/bower_components/package_name` and require them in `app/assets/javascripts/application.js` or `app/assets/stylesheets/application.css`.

#### Known issues

  * If you are using Windows the Run tests command above does not work.

#### FAQs
<commit_msg>Hint at fontcustom dependencies in README.<commit_after># Lale.Help

[![Circle CI](https://circleci.com/gh/lale-help/lale-help.svg?style=svg)](https://circleci.com/gh/lale-help/lale-help)

This is the rails application used for lale.help.

# Table of contents

<!-- MarkdownTOC depth=1 autolink=true bracket=round -->

- [Development hints for docker](#development-hints-for-docker)
- [URLs](#urls)
- [Internationalization \(I18N\)](#internationalization-i18n)
- [Restoring the database from a snapshot](#restoring-the-database-from-a-snapshot)
- [Advice for writing feature specs](#advice-for-writing-feature-specs)
- [Styleguide](#styleguide)
- [Environments and deployment](#environments-and-deployment)
- [Further documentation](#further-documentation)
- [License](#license)

<!-- /MarkdownTOC -->


## Development hints for docker

You can run Lale on your development machine using one of two methods:

1. on the native OS *(easy to set up on a Mac, setup used by the last 2 core developers)*
1. running in a Linux container using [Docker](https://www.docker.com/) *(recommended for Rails beginners)*

### Standard Rails Project


### Docker Project

Before you do anything, install [Docker](http://www.docker.com/) for your OS.

When working with docker, there are many scripts found in the `docker` folder to help you get started.
Feel free to read through these scripts to understand what Docker and Docker Compose are doing under
the hood to start the rails application

#### Starting Rails
  To run the rails server, just execute the following script on your development machine.

  `./docker/start`

  This starts rails and the associated services (PostgreSQL, etc...) in the background with docker.
  To view the rails logs, you can use `./docker/logs`


#### Docker Scripts
| Script Description                         | How to run                            |
|--------------------------------------------|---------------------------------------|
| Start Rails (and other services)           | `./docker/start`                      |
| Open a Rails console                       | `./docker/rails-console`              |
| Run Tests                                  | `./docker/rspec [/path/to/spec]`      |
| Migrate the DB                             | `./docker/db-migrate`                 |
| Run a one off command in the web container | `./docker/exec COMMAND`               |
| Run bash on the web container              | `./docker/shell`                      |
| Inspect the DB with psql                   | `./docker/psql`                       |
| View the logs from every service           | `./docker/logs`                       |
| Stop all services                          | `./docker/stop`                       |
| Rebuild the web container                  | `./docker/build`                      |
| Reset your Docker environment              | `./docker/reset`                      |

### Adding icons to the lale iconfont

We use a custom font to combine our icons into one file, in order to save bandwith and HTTP requests. The icons are stored in `app/assets/icons` and need to be in SVG format, the (generated) font files are in `app/assets/fonts/lale/lale.*. 

Run the command `fontcustom compile` to update the font file after changing anything in the icons directory. The [fontcustom gem](https://github.com/FontCustom/fontcustom/) and it's dependencies [need to be installed first](https://github.com/FontCustom/fontcustom/#installation). See the configuration file [config/fontcustom.yml](config/fontcustom.yml) for details.

### Adding JavaScript packages / dependencies

We use [bower](https://bower.io) to manage complex JS dependencies. Do the following to add a new JS dependency:

```
cd vendor/assets
bower install package_name --save
```

Then use the package documentation to understand which JS and CSS files you need to require, find them in `vendor/assets/bower_components/package_name` and require them in `app/assets/javascripts/application.js` or `app/assets/stylesheets/application.css`.

#### Known issues

  * If you are using Windows the Run tests command above does not work.

#### FAQs

{'fraction_non_alphanumeric': 0.11983972802331229, 'fraction_numerical': 0.001942690626517727, 'mean_word_length': 2.4065343258891647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 11, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6730177', 'n_tokens_mistral': 2276, 'n_tokens_neox': 2068, 'n_words': 834}