Sha256: fae9960028e2baeb2e9c9907a606f5feeb77f920ae465d799105c2955e7f79f9

Contents?: true

Size: 1.8 KB

Versions: 1

Compression:

Stored size: 1.8 KB

Contents

# Jkf
[![Gem
Version](https://badge.fury.io/rb/jkf.svg)](https://badge.fury.io/rb/jkf)
[![Build
Status](https://travis-ci.org/iyuuya/jkf.svg?branch=master)](https://travis-ci.org/iyuuya/jkf)
[![CI](https://github.com/iyuuya/jkf/actions/workflows/ci.yml/badge.svg)](https://github.com/iyuuya/jkf/actions/workflows/ci.yml)
[![Inline
docs](http://inch-ci.org/github/iyuuya/jkf.svg?branch=develop)](http://inch-ci.org/github/iyuuya/jkf)

jkf is a Ruby port of
[json-kifu-format](https://github.com/na2hiro/json-kifu-format).
It supports both of the conversion from KIF, KI2, or CSA to jkf, and the one
from jkf to KIF, KI2, or CSA.

## Installation

If you install this gem to your application (with Bundler), add this to
Gemfile.

```ruby
gem 'jkf'
```

Then run bundle to install this gem.

    $ bundle

Or directly install with gem install command.

    $ gem install jkf

## Usage

This gem has the Parser and the Converter for each formats: KIF, KI2, and
CSA.

```ruby
kif_parser = Jkf::Parser::Kif.new
ki2_parser = Jkf::Parser::Ki2.new
csa_parser = Jkf::Parser::Csa.new
```

```ruby
kif_converter = Jkf::Converter::Kif.new
ki2_converter = Jkf::Converter::Ki2.new
csa_converter = Jkf::Converter::Csa.new
```

`parser#parse(str)` to convert into jkf.
`#convert(jkf)` to convert into each formats from jkf.

```ruby
jkf = kif_parser.parse(kif_str) #=> Hash
jkf = ki2_parser.parse(ki2_str) #=> Hash
jkf = csa_parser.parse(csa_str) #=> Hash
```

```ruby
kif = kif_converter.convert(jkf) #=> String
ki2 = ki2_converter.convert(jkf) #=> String
csa = csa_converter.convert(jkf) #=> String
```

## Contributing

Feel free to report bugs or send pull requests at
[GitHub](https://github.com/iyuuya/jkf).

If you work on Guix, run tests by `guix shell`.

## License

This gem is licensed under the [MIT
License](http://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jkf-0.5.0 README.en.md