Sha256: 2e36aba3127d989b340cb4f2afa4128c4c1c7c9d219d6c1d1be3c28f0b33aea6

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# Sinatra EnvToConfig Extenstion

[![Gem Version](https://badge.fury.io/rb/sinatra-env_to_config.svg)](http://badge.fury.io/rb/sinatra-env_to_config)


Provided methods:
* `env_to_config(key1, key2, ...)`

which takes the proper values from ENV and places them in the settings.

## Installation

Add this line to your application's Gemfile:

    gem 'sinatra-env_to_config'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sinatra-env_to_config

## Usage

```ruby
require 'sinatra/base'
require 'sinatra/env_to_config'

class MyApp < Sinatra::Base
  register Sinatra::EnvToConfig

  env_to_config :key1, :key2

end
```

and then you can use it:

```ruby
puts settings.key1    # -> 'some value' or nil
puts ENV['key1']      # -> 'some value' or nil
```

## Versioning

See [semver.org][semver]

## Contributing

1. Fork it
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 new Pull Request

[semver]: http://semver.org/

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sinatra-env_to_config-1.0.1 README.md