vault_coh 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdbd7e919eda17b55ac97b058087b32094c56066a612ddff20d78ade238b2797
4
- data.tar.gz: 2cdc54cbc219eace927ec8e58d586c012c1a97933636e1ad1207adcf7acd0343
3
+ metadata.gz: 58b4566c6a716ad6a4bd8e5cf6cc34d5463f41cabebdd73fb700754306e2f755
4
+ data.tar.gz: a1c6cba1f9612d76d9ff6f4ada79881cd7df6eaa05f48834c325e3c2eaa49fbb
5
5
  SHA512:
6
- metadata.gz: e989e5dc6f37f6730a6e406e29d35acb7eb6b779e48b8e36d156df2abfd825bb2fd5909c1f7875c155a167d5d7eb7cebf690014eb853e9389c917069ba5a41ce
7
- data.tar.gz: 9aaa7fee672a3a617b03151b2967c122503ab67d3fe197b7df615b151bc79b6ca9889203bad6b82c4d5689548c102921922fbcb28e5c5633093d60370a4d9fb2
6
+ metadata.gz: 0bd7b66a16fbe5800643311bc98b0c8e68ac2a913a0a045e371819b715837cddae36dea7b1081c6ab40216604fca4a29efa3c4fb306b54a96ddaf6ae22df5b04
7
+ data.tar.gz: 2f62b79798c457b68fba088de8426345a8f256c38653f06d96dce5d5e3491f00b9dad5bd68e0ab08fd3c8e5accecea6e191fb7db833b0d5a4367c993cb864123
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault_coh (2.0.0)
4
+ vault_coh (2.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vault
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/vault_coh.svg)](https://badge.fury.io/rb/vault_coh) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://rubydoc.info/github/ryantaylor/vault-rb/v2.0.0)
3
+ [![Gem Version](https://badge.fury.io/rb/vault_coh.svg)](https://badge.fury.io/rb/vault_coh) [![Documentation](https://img.shields.io/badge/View-Documentation-blue.svg)](https://rubydoc.info/github/ryantaylor/vault-rb/v2.1.0)
4
4
 
5
5
  A native Ruby client wrapper for the [vault](https://github.com/ryantaylor/vault) Company of Heroes replay parser, integrated via a Rust native extension.
6
6
 
@@ -24,7 +24,7 @@ bytes = File.read('/path/to/replay.rec').unpack('C*')
24
24
  replay = VaultCoh::Replay.from_bytes(bytes)
25
25
  puts replay.version
26
26
  ```
27
- All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v2.0.0).
27
+ All information available from parsing can be found in the [documentation](https://rubydoc.info/github/ryantaylor/vault-rb/v2.1.0).
28
28
 
29
29
  ## Contributing
30
30
 
@@ -1,6 +1,6 @@
1
1
  use magnus::Value;
2
2
  use vault::commands::{BuildSquad, SelectBattlegroup, Unknown};
3
- use vault::{Map, Message, Player, Replay};
3
+ use vault::{Command, Map, Message, Player, Replay};
4
4
 
5
5
  pub trait HashExt {
6
6
  fn to_h(&self) -> Value;
@@ -30,6 +30,12 @@ impl HashExt for Message {
30
30
  }
31
31
  }
32
32
 
33
+ impl HashExt for Command {
34
+ fn to_h(&self) -> Value {
35
+ serde_magnus::serialize(self).unwrap()
36
+ }
37
+ }
38
+
33
39
  impl HashExt for BuildSquad {
34
40
  fn to_h(&self) -> Value {
35
41
  serde_magnus::serialize(self).unwrap()
@@ -61,6 +61,7 @@ fn init() -> Result<(), Error> {
61
61
  team.define_method("value", method!(Team::value, 0))?;
62
62
 
63
63
  let command = module.define_class("Command", class::object())?;
64
+ command.define_method("to_h", method!(Command::to_h, 0))?;
64
65
 
65
66
  let commands_module = module.define_module("Commands")?;
66
67
 
@@ -8,5 +8,10 @@ module VaultCoh
8
8
  #
9
9
  # @return [Commands::BuildSquad|Commands::SelectBattlegroup|Commands::Unknown]
10
10
  def value; end
11
+
12
+ # Returns a hash representation of the object.
13
+ #
14
+ # @return [Hash]
15
+ def to_h; end
11
16
  end
12
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VaultCoh
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault_coh
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryantaylor