Closed brauliobo closed 2 years ago
Sorry. Currently, jruby is not supported. PR is welcome!
@brauliobo You can use it with JRuby from this Java source https://github.com/airlift/aircompressor/tree/master/src/main/java/io/airlift/compress/zstd
In JRuby, try to use https://github.com/luben/zstd-jni ? (jar file can download here https://repo1.maven.org/maven2/com/github/luben/zstd-jni)
Sample code is below
require 'java'
require_relative './zstd-jni-1.5.2-3.jar'
str = "testtest"
compressed = com.github.luben.zstd.Zstd.compress(str.to_java_bytes)
puts com.github.luben.zstd.Zstd.decompress(compressed, str.length)
% ls
test.rb zstd-jni-1.5.2-3.jar
% ruby -v
jruby 9.3.2.0 (2.6.8) 2021-12-01 0b8223f905 OpenJDK 64-Bit Server VM 11.0.12+0 on 11.0.12+0 +jit [darwin-x86_64]
% ruby test.rb
testtest
Update README https://github.com/SpringMT/zstd-ruby#jruby
In the readme there is no indication wheter jruby is supported