Skip to content

Commit

Permalink
Ready to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jun 20, 2017
1 parent 676b717 commit a486672
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## 1.0.0 (2017-06-20)

- Lazy load and parse ENV configurtaion (https://github.com/palkan/anyway_config/commit/5fe407c75fefec8994ca201ea7b4691b5ddd96e5). ([@palkan][])
- Lazy load and parse ENV configurtaion. ([@palkan][])

- Add support for ERB in YML configuration (https://github.com/palkan/anyway_config/commit/8d8a47dbda6858a43ff509aaa4cddf4f938dd660). ([@palkan][])
- Add support for ERB in YML configuration. ([@palkan][])

## 0.5.0 (2017-01-20)

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

Rails/Ruby plugin/application configuration tool which allows you to load parameters from different sources: YAML, Rails secrets, environment.

Apps using AnywayConfig:
Allows you to easily follow the [twelve-factor application](https://12factor.net/config) principles and adds zero complexity to your development process.

Libraries using Anyway Config:

- [Influxer](https://github.com/palkan/influxer)

Expand Down Expand Up @@ -74,7 +76,7 @@ MyCoolGem.config.user #=> 'root'

#### Customize name

By default, AnywayConfig uses the namespace (the outer module name) as the config name, but you can set it manually:
By default, Anyway Config uses the namespace (the outer module name) as the config name, but you can set it manually:

```ruby
module MyCoolGem
Expand Down Expand Up @@ -106,7 +108,7 @@ Your config will be filled up with values from the following sources (ordered by

### Using with Ruby

By default AnywayConfig is looking for a config YAML at `./config/<config-name>.yml`. You can override this setting
By default, Anyway Config is looking for a config YAML at `./config/<config-name>.yml`. You can override this setting
through special environment variable – 'MYGEM_CONF' – containing the path to the YAML file.

Environmental variables work the same way as with Rails.
Expand All @@ -122,7 +124,7 @@ There are `#clear` and `#reload` functions on your config (which do exactly what
Rails 4.2 introduced new feature: `Rails.application.config_for`. It looks very similar to
`Anyway::Config.for`, but there are some differences:

| Feature | Rails | Anyway |
| Feature | Rails | Anyway Config |
| ------------- |:-------------:| -----:|
| load data from `config/app.yml` | yes | yes |
| load data from `secrets` | no | yes |
Expand Down
4 changes: 2 additions & 2 deletions anyway_config.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Gem::Specification.new do |s|
s.description = %{
Configuration DSL for Ruby libraries and applications.
Allows you to easily follow the twevle factor application principles (https://12factor.net/config).
Allows you to easily follow the twelve-factor application principles (https://12factor.net/config).
}

s.license = "MIT"

s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
s.require_paths = ["lib"]
s.required_ruby_version = '>= 2'
s.required_ruby_version = '>= 2.2'

s.add_development_dependency "simplecov", ">= 0.3.8"
s.add_development_dependency "rspec", "~> 3.5.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/anyway/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Anyway # :nodoc:
VERSION = "0.5.1.rc1"
VERSION = "1.0.0"
end
9 changes: 9 additions & 0 deletions spec/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,13 @@
end
end
end

describe "config without defaults" do
let(:conf) { SmallConfig.new }

it "works" do
expect(conf.meta).to be_nil
expect(conf.data).to be_nil
end
end
end
7 changes: 7 additions & 0 deletions spec/support/small_config.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class SmallConfig < Anyway::Config # :nodoc:
config_name :small
attr_config :meta,
:data
end

0 comments on commit a486672

Please sign in to comment.