README.textile in yaml2env-0.1.1 vs README.textile in yaml2env-0.1.2

- old
+ new

@@ -23,12 +23,15 @@ h2. Usage To give this some context; this is how we use @Yaml2Env@ to initialize "Hoptoad":http://hoptoadapp.com: <pre> - Yaml2Env.load 'config/hoptoad.yml', {'HOPTOAD_API_KEY' => 'api_key'} + Yaml2Env.load! 'config/hoptoad.yml', {'HOPTOAD_API_KEY' => 'api_key'} + # ...or if a warning note in the logs is enough: + # Yaml2Env.load 'config/hoptoad.yml', {'HOPTOAD_API_KEY' => 'api_key'} + if defined?(HoptoadNotifier) HoptoadNotifier.configure do |config| config.api_key = ENV['HOPTOAD_API_KEY'] end end @@ -51,30 +54,45 @@ </pre> ...which will yield: <pre> - Rails.env = 'development' + # Rails.env => 'development' ENV['HOPTOAD_API_KEY'] => 'NONE' - Rails.env = 'staging' + # Rails.env => 'staging' ENV['HOPTOAD_API_KEY'] => '123abc' - Rails.env = 'production' + # Rails.env => 'production' ENV['HOPTOAD_API_KEY'] => 'abc123' - Rails.env = 'test' + # Rails.env => 'test' ENV['HOPTOAD_API_KEY'] => 'NONE' - Rails.env = 'other' + # Rails.env => 'other' => "Failed to load required config for environment 'other': /Users/grimen/development/example.com/config/hoptoad.yml" </pre> +h2. Helpers + +A few convenient helpers: + +<pre> + Yaml2Env.loaded? 'HOPTOAD_API_KEY' + => true + + Yaml2Env.loaded? 'BAZOOKA' + => false + + Yaml2Env.loaded? 'HOPTOAD_API_KEY', 'BAZOOKA' + => false +</pre> + h2. Notes This gem was developed for our own requirements at *"Merchii":http://github.com/merchii*, so feel free to send pull-requests with enhancements of any kind (features, bug-fixes, documentation, tests, etc.) to make it better or useful for you as well. h2. License Released under the MIT license. -Copyright (c) "Merchii":http://github.com/merchii, "Jonas Grimfelt":http://github.com/grimen +Copyright (c) "Jonas Grimfelt":http://github.com/grimen, "Merchii":http://github.com/merchii