README.md in vars-0.0.1 vs README.md in vars-0.0.2
- old
+ new
@@ -1,29 +1,45 @@
# Vars
-Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vars`. To experiment with that code, run `bin/console` for an interactive prompt.
+`vars` is provide configuration each environments.
-TODO: Delete this and the text above, and describe your gem
-
## Installation
Add this line to your application's Gemfile:
```ruby
-gem 'vars'
+gem "vars"
```
And then execute:
$ bundle
-Or install it yourself as:
+## Usage
- $ gem install vars
+Load configuretion and resolve templates.
-## Usage
+```ruby
+vars = Vars.new(path: "path/to/environment.yml", name: "production")
+vars.rails_env # => "production"
+vars.app_root # => "/var/www/app/current"
-TODO: Write usage instructions here
+vars.resolve_template("path/to/template.erb", "path/to/dest_file") # Create file from template.
+vars.resolve_templates("config/deploy/templates", "config")
+```
+
+Example configuration file.
+
+```yaml
+default:
+ rails_env: development
+ app_root: /var/www/app/current
+ db_host: localhost
+
+production:
+ rails_env: production
+ db_host: app-db-01.cluster.ap-northeast-1.rds.amazonaws.com
+```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.