Vault

Gem Version Documentation

A native Ruby client wrapper for the vault Company of Heroes replay parser, integrated via a Rust native extension.

Installation

First, make sure you have a relatively recent version of the Rust toolchain installed (minimum supported Rust version for vault is 1.65.0). You can install Rust easily using rustup.

Then you can add to Gemfile:

gem 'vault_coh'

And run bundle install.

Usage

Currently vault accepts a byte array and parses it as a Company of Heroes 3 replay file, returning a parsed object when successful or an error on failure:

require 'vault_coh'

bytes = File.read('/path/to/replay.rec').unpack('C*')
replay = VaultCoh::Replay.from_bytes(bytes)
puts replay.version

All information available from parsing can be found in the documentation.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ryantaylor/vault-rb.

If you need to make changes to the Rust code, you can compile the extension by running rake compile or run tests with cargo test.

License

The gem is available as open source under the terms of the MIT License.