https://github.com/sue445/sengiri_yaml
divide yaml file
https://github.com/sue445/sengiri_yaml
gem yaml
Last synced: about 1 year ago
JSON representation
divide yaml file
- Host: GitHub
- URL: https://github.com/sue445/sengiri_yaml
- Owner: sue445
- License: mit
- Created: 2014-12-31T14:14:39.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2025-01-17T13:32:00.000Z (over 1 year ago)
- Last Synced: 2025-03-27T16:56:04.698Z (about 1 year ago)
- Topics: gem, yaml
- Language: Ruby
- Homepage: https://sue445.github.io/sengiri_yaml/
- Size: 77.1 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SengiriYaml
[](http://badge.fury.io/rb/sengiri_yaml)
[](https://github.com/sue445/sengiri_yaml/actions/workflows/test.yml)
[](https://codeclimate.com/github/sue445/sengiri_yaml)
[](https://coveralls.io/r/sue445/sengiri_yaml)
divide yaml file
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'sengiri_yaml'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install sengiri_yaml
## Usage
### divide yaml
```bash
$ cat "/path/to/fat.yml"
- data1: data1
value: 1
- data2: data2
value: 2
$ sengiri_yaml "/path/to/fat.yml" "/path/to/fat_dir"
$ ls "/path/to/fat_dir"
data1.yml data2.yml
$ cat data1.yml
---
- data1: data1
value: 1
$ cat data2.yml
---
- data2: data2
value: 2
```
### load divided yaml
```ruby
merged_data = SengiriYaml.load_dir("/path/to/fat_dir")
# => [{"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