<commit_before># README

## Update Decidim

To update the Decidim installation on this project, first we update Gemfile
dependencies, then we call the Decidim upgrade script and then we apply
migrations (if any)

* `bundle update decidim decidim-dev`
* `bin/rails decidim:upgrade`
* `bin/rails db:migrate`

There are some customizations that have been done to the platform. During an upgrade
all the files that have been overridden need to be checked to ensure compatibility.
[docs/overrides.md](docs/overrides.md) lists all these modifications.

## Development

**Requeriments (MacOS)**

GraphicsMagick is required to be installed. For example (with `brew`): `brew
install graphicsmagick`

**Development environment installation**

* Install development environment (Ruby 2.4+, PostgreSQL 9.4+). Check the
  following guide for instructions on different OS: https://gorails.com/setup/
* Clone the repository: `git clone <EMAIL>:diputacioBCN/decidim-diba.git`
* `cd decidim-diba`
* Install dependencies: `bundle install`
* Setup database: `bin/rails db:setup`
* Launch development server: `bin/rails server`

More information can be found in the Decidim github repository:
https://github.com/decidim/decidim

**Run tests**

Use: `bin/rspec` (with spring) or `bundle exec rspec` (without spring)

**Testing emails in development**

Decidim is using the
[letter_opener_web](https://github.com/fgrehm/letter_opener_web) gem. To see all
emails sent in the development environment you can do it by visiting the
https://localhost:3000/letter_opener URL.

**Testing LDAP integration in development**

To launch a development ldap server, you can use:

`rake ldap:server`

You can find a sample LDAP configuration in: `decidim-ldap/spec/factories.rb` and a list
of users inside `decidim-ldap/lib/ladle/default.ldif`

**Specific issues**

* The translations are available only in catalan, spanish and english.
* You can configure the minimum age of a feature using the following json:<commit_msg>[DOC] Better explain how to use the developmnent Ldap server works (#46)<commit_after># README

## Update Decidim

To update the Decidim installation on this project, first we update Gemfile
dependencies, then we call the Decidim upgrade script and then we apply
migrations (if any)

* `bundle update decidim decidim-dev`
* `bin/rails decidim:upgrade`
* `bin/rails db:migrate`

There are some customizations that have been done to the platform. During an upgrade
all the files that have been overridden need to be checked to ensure compatibility.
[docs/overrides.md](docs/overrides.md) lists all these modifications.

## Development

**Requeriments (MacOS)**

GraphicsMagick is required to be installed. For example (with `brew`): `brew
install graphicsmagick`

**Development environment installation**

* Install development environment (Ruby 2.4+, PostgreSQL 9.4+). Check the
  following guide for instructions on different OS: https://gorails.com/setup/
* Clone the repository: `git clone <EMAIL>@github.com:diputacioBCN/decidim-diba.git`
* `cd decidim-diba`
* Install dependencies: `bundle install`
* Setup database: `bin/rails db:setup`
* Launch development server: `bin/rails server`

More information can be found in the Decidim github repository:
https://github.com/decidim/decidim

**Run tests**

Use: `bin/rspec` (with spring) or `bundle exec rspec` (without spring)

**Testing emails in development**

Decidim is using the
[letter_opener_web](https://github.com/fgrehm/letter_opener_web) gem. To see all
emails sent in the development environment you can do it by visiting the
https://localhost:3000/letter_opener URL.

**Testing LDAP integration in development**

To launch a development ldap server, you can use:

`rake ldap:server`

You can find a sample LDAP configuration in: `decidim-ldap/spec/factories.rb` and a list
of users inside `decidim-ldap/lib/ladle/default.ldif`

Start the app with the development ldap environment variables:
```
export LDAP_USERNAME=uid=admin,ou=people,dc=example,dc=com
export LDAP_PASSWORD=<PASSWORD>
bin/rails s
```

When signing in, the following fields from the `default.ldif` should ve used:

- uid: for the email, e.g. "Alice".
- userPassword: for the password, e.g. "<PASSWORD>".


**Specific issues**

* The translations are available only in catalan, spanish and english.
* You can configure the minimum age of a feature using the following json:
{'fraction_non_alphanumeric': 0.09045340624287992, 'fraction_numerical': 0.004101161995898838, 'mean_word_length': 5.148459383753502, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3123610', 'n_tokens_mistral': 1332, 'n_tokens_neox': 1285, 'n_words': 523}