vox-etf 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/README.md +13 -10
- data/Rakefile +2 -1
- data/ext/vox/etf.hpp +0 -13
- data/lib/vox/etf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 814a39714371d1d129be3606ee5f4f00045c6f6a35fdbcae83bec672cec55d33
|
4
|
+
data.tar.gz: f2cd32adb4fa957dd6bf692babe956f7f8569251bac15658ae1445d476c342d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fc627a3904d13c023aa85092010b11ea4a281a2ca93992c39a1e13293b9d1768362a12114c6cefa6c9afae1075bc1902fbcee337f3a8a852ec8fbe75754a5b7
|
7
|
+
data.tar.gz: d26faa973c98490470b43735e5f45c0dbe53759499def683ac6d80fd662af94e158951702014ca6a55bafed2f2a2839226b5b67709d28a9f2adfc62a09d3f807
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,4 @@
|
|
1
|
-
# Vox::
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vox/etf`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
1
|
+
# Vox::ETF
|
6
2
|
|
7
3
|
## Installation
|
8
4
|
|
@@ -22,17 +18,24 @@ Or install it yourself as:
|
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
To use the encoder/decoder independently use the respective `#encode` and `#decode` methods.
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'vox/etf'
|
25
|
+
|
26
|
+
p Vox::ETF.decode("\x83l\x00\x00\x00\x03a\x01a\x02a\x03j")
|
27
|
+
# => [1, 2, 3]
|
26
28
|
|
27
|
-
|
29
|
+
p Vox::ETF.encode({foo: "bar"})
|
30
|
+
# => "\x83t\x00\x00\x00\x01w\x03foom\x00\x00\x00\x03bar"
|
31
|
+
```
|
28
32
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
33
|
|
31
|
-
To
|
34
|
+
To use with the Vox gateway, add this gem to your Gemfile and provide `:etf` as the encoding option to `Vox::Gateway::Client#initialize`.
|
32
35
|
|
33
36
|
## Contributing
|
34
37
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/swarley/vox-etf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/swarley/vox-etf/blob/master/CODE_OF_CONDUCT.md).
|
36
39
|
|
37
40
|
|
38
41
|
## License
|
data/Rakefile
CHANGED
data/ext/vox/etf.hpp
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
-
#include "./etf_reader.hpp"
|
4
|
-
|
5
3
|
#define ETF_VERSION 131
|
6
4
|
|
7
5
|
// Term IDs, first byte of any term.
|
@@ -41,17 +39,6 @@ enum term
|
|
41
39
|
};
|
42
40
|
|
43
41
|
VALUE decode(VALUE self, VALUE input);
|
44
|
-
inline VALUE decode_small_tuple(etf_reader *reader);
|
45
|
-
inline VALUE decode_large_tuple(etf_reader *reader);
|
46
|
-
inline VALUE decode_map(etf_reader *reader);
|
47
|
-
inline VALUE decode_list(etf_reader *reader);
|
48
|
-
inline VALUE decode_binary(etf_reader *reader);
|
49
|
-
inline VALUE decode_string(etf_reader *reader);
|
50
|
-
inline VALUE decode_atom(etf_reader *reader);
|
51
|
-
inline VALUE decode_small_atom(etf_reader *reader);
|
52
|
-
inline VALUE decode_small_bignum(etf_reader *reader);
|
53
|
-
inline VALUE decode_large_bignum(etf_reader *reader);
|
54
|
-
|
55
42
|
VALUE encode(VALUE self, VALUE input);
|
56
43
|
|
57
44
|
// Setup function for ruby FFI.
|
data/lib/vox/etf/version.rb
CHANGED