项目作者: sue445

项目描述 :
divide yaml file
高级语言: Ruby
项目地址: git://github.com/sue445/sengiri_yaml.git
创建时间: 2014-12-31T14:14:39Z
项目社区:https://github.com/sue445/sengiri_yaml

开源协议:MIT License

下载


SengiriYaml

Gem Version
test
Code Climate
Coverage Status

divide yaml file

Installation

Add this line to your application’s Gemfile:

  1. gem 'sengiri_yaml'

And then execute:

  1. $ bundle

Or install it yourself as:

  1. $ gem install sengiri_yaml

Usage

divide yaml

  1. $ cat "/path/to/fat.yml"
  2. - data1: data1
  3. value: 1
  4. - data2: data2
  5. value: 2
  6. $ sengiri_yaml "/path/to/fat.yml" "/path/to/fat_dir"
  7. $ ls "/path/to/fat_dir"
  8. data1.yml data2.yml
  9. $ cat data1.yml
  10. ---
  11. - data1: data1
  12. value: 1
  13. $ cat data2.yml
  14. ---
  15. - data2: data2
  16. value: 2

load divided yaml

  1. merged_data = SengiriYaml.load_dir("/path/to/fat_dir")
  2. # => [{"data1" => "data1", "value" => 1}, {"data2" => "data2", "value" => 2}]

Contributing

  1. Fork it ( https://github.com/sue445/sengiri_yaml/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