vox-etf 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38c4afc3d3f48eb9687bfc79372892ee356c7e9f4d70211c71ddedf0b59d4318
4
- data.tar.gz: 2f1b5060659fc9a35fa8d0b1ee1f5665c5c37d4254864961c14ead7d07048b9b
3
+ metadata.gz: 814a39714371d1d129be3606ee5f4f00045c6f6a35fdbcae83bec672cec55d33
4
+ data.tar.gz: f2cd32adb4fa957dd6bf692babe956f7f8569251bac15658ae1445d476c342d3
5
5
  SHA512:
6
- metadata.gz: 8fd31825a494ea4b863be1f3a5c252951598987cca09137f7eb8c71e62a01992011dfaff5c72f123845667ece12c96db6ab5663276d47f59b70d17cd3e9c2d06
7
- data.tar.gz: de91811cddb61a4523cf66501c86893fe4e1c6dd16fd9ca07dd6984a06d64fce3bab2d8daa82050f67bb1b3ee8287fcd3cdc6282c23039f80d2a445bd8333e48
6
+ metadata.gz: 7fc627a3904d13c023aa85092010b11ea4a281a2ca93992c39a1e13293b9d1768362a12114c6cefa6c9afae1075bc1902fbcee337f3a8a852ec8fbe75754a5b7
7
+ data.tar.gz: d26faa973c98490470b43735e5f45c0dbe53759499def683ac6d80fd662af94e158951702014ca6a55bafed2f2a2839226b5b67709d28a9f2adfc62a09d3f807
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ lib/vox/etf.so
14
+ Gemfile.lock
data/README.md CHANGED
@@ -1,8 +1,4 @@
1
- # Vox::Etf
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
- TODO: Write usage instructions here
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
- ## Development
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 install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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/[USERNAME]/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/[USERNAME]/vox-etf/blob/master/CODE_OF_CONDUCT.md).
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
@@ -11,4 +11,5 @@ Rake::ExtensionTask.new('etf') do |ext|
11
11
  ext.lib_dir = 'lib/vox'
12
12
  end
13
13
 
14
- task(default: :compile)
14
+ task(default: :spec)
15
+ task spec: ['compile']
@@ -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.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Vox
4
4
  module ETF
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vox-etf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Carey