<commit_before># Settingify

This is small global settings system with some features:

1. Works without table returning default values. Migrating db loaded the whole rails environment
   and using settings in loaded code blocks (like activeadmin resource
   files) may cause problems.
2. May works with admin systems like simple model. For example,
   integration with active admin:

```
rails g active_admin:resource Settingify::Setting
```

## Installation

Add this line to your application's Gemfile:

    gem 'settingify'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install settingify

### Post installation

Run intallation generator for installing migration and initializer:

```
rails g settingify:install
```

Then migrate:

```
rake db:migrate
```

## Usage


## Contributing

1. Fork it ( https://github.com/alterego-labs/settingify/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request<commit_msg>Some readme about usage<commit_after># Settingify

This is small global settings system with some features:

1. Works without table returning default values. Migrating db loaded the whole rails environment
   and using settings in loaded code blocks (like activeadmin resource
   files) may cause problems.
2. May works with admin systems like simple model. For example,
   integration with active admin:

```
rails g active_admin:resource Settingify::Setting
```

## Installation

Add this line to your application's Gemfile:

    gem 'settingify'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install settingify

### Post installation

Run intallation generator for installing migration and initializer:

```
rails g settingify:install
```

Then migrate:

```
rake db:migrate
```

## Usage

### Defining settings

It may be done by patching created initializer in
`config/initializers/settingify.rb`. There is simple DSL:

```
Settingify.setup do
  setting :some_name, type: SettingType, default: 'some default value'
end
```

Supported types are _String_ and _Integer_.

### Reading settings

There are two cases:

1. Setting table is not exists
2. Setting table is exists

In first case when you requests some setting the default value will be
returned.
If table is exists request to DB will be done. Value from record will be
returned if it found and default value in another case.
When trying to request undefined setting exception will be throwed.


## Contributing

1. Fork it ( https://github.com/alterego-labs/settingify/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
{'fraction_non_alphanumeric': 0.07542579075425791, 'fraction_numerical': 0.005561348627042058, 'mean_word_length': 4.185585585585586, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2028970', 'n_tokens_mistral': 813, 'n_tokens_neox': 771, 'n_words': 375}