zstdlib 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +10 -0
  3. data/README.md +6 -5
  4. data/ext/zstdlib/extconf.rb +11 -5
  5. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f25b2a7a2fca87d9f2c1535a4db8814a56b6a49f01f229b18cc4d325295b22ba
4
- data.tar.gz: 33ae1662723246dcc7c06b880672b207793127e26a2c810040df11c363cc8ae0
3
+ metadata.gz: e2a6f6bf117cfe5135f48585ee93bb2766c68ab8467298302001721b5adeced2
4
+ data.tar.gz: 387471e4a2ab11f043a6c4fc0b3a0c39f9874cd3d1d67342560ebfc3ae64e6be
5
5
  SHA512:
6
- metadata.gz: ae05dbeea9f18383ddeddc11cf307a1e213f87e8c88ca15abd2307fb4c65d0accd8c8ec0bfedd34c4db0f9a5dc87d43c3530e3509849ed20a5af27d251cebb2a
7
- data.tar.gz: a6adf1db64a16c97e17ed69c07f6971cda51a501f076db87f36517a89e333824c7eec4bcce3f3656948ed84a8d2d77792a27c927c9f314ab11e3d241e21c094b
6
+ metadata.gz: 8773d6f3cacb85ce37b5d898a04f2981fa67d1a34297eb62f701a2f2d3904c9d277a1c4168a425aa5aa6d7451be5ddfcb8a57f3bd2f14f7a65ee0bc2f2815a66
7
+ data.tar.gz: 80977a20853890d1a2b53657702e62d54817784d07ae6917d6592aa52126e95b9f6e63f7a539ef30f7f1c828774c81e07c98b468cf6a0e43b3ea70f7cf70c616
data/CHANGES.md CHANGED
@@ -1,3 +1,13 @@
1
+ # 0.1.1
2
+
3
+ Pick up the most recent compatible source for _zstdlib_ Ruby extension module instead of target Ruby version.
4
+
5
+ Replaced (most) references to `Zlib` with `Zstdlib` within extractable documentation.
6
+
7
+ Fixed a few missing methods on Ruby side.
8
+
9
+ Documentation updates.
10
+
1
11
  # 0.1.0
2
12
 
3
13
  Initial release.
data/README.md CHANGED
@@ -77,13 +77,14 @@ Source code and Windows-specific multi-versioned binary gems can be obtained fro
77
77
 
78
78
  ## Release history
79
79
 
80
- For user-visible changes refer to [change log](CHANGES.md).
80
+ For user-visible changes refer to [change log](/CHANGES.md).
81
81
 
82
82
  ## Caveats
83
83
 
84
- Ruby documentation extraction tools (such as RDoc) produce incorrect documentation for _zstdlib_
85
- which is technically valid but contains all identifies referring to _zlib_.
86
- This may change in future.
84
+ This module is in testing phase so things beyond basic interface might not work as expected.
85
+
86
+ Documentation extracted from _zstdlib_ still contains traces of old zlib-related pieces.
87
+ Just keep this in mind and substitute *zlib* with *zstdlib* upon browsing.
87
88
 
88
89
  Gzip support, although available in Zstd's Zlib compatibility layer, is currently disabled.
89
90
 
@@ -93,4 +94,4 @@ Zstd's external compression dictionaries capability is not (yet) implemented.
93
94
 
94
95
  Cheers,
95
96
 
96
- Oleg A. Khlybov <fougas@mail.ru>
97
+ Oleg A. Khlybov <[fougas@mail.ru](mailto:fougas@mail.ru)>
@@ -3,31 +3,37 @@
3
3
  require 'mkmf'
4
4
  require 'fileutils'
5
5
 
6
+ include RbConfig
6
7
  include FileUtils
7
8
 
8
9
  ZSTD_VERSION = '1.3.8'
9
10
  ZLIB_VERSION = '1.2.11'
10
- RB_VERSION = Gem.ruby_api_version.slice(/^\d+\.\d+/)
11
+ RB_VERSION = CONFIG['MAJOR']+'.'+CONFIG['MINOR']
12
+ ZMOD_VERSION = RB_VERSION >= '2.3' ? '2.6' : RB_VERSION # Review requirements with every new zlib module release!
11
13
 
12
14
  root = File.dirname(__FILE__)
13
15
 
14
- zmod = File.expand_path "ruby/zlib-#{RB_VERSION}", root
16
+ zmod = File.expand_path "ruby/zlib-#{ZMOD_VERSION}", root
15
17
  zlib = File.expand_path "zlib-#{ZLIB_VERSION}", root
16
18
  zstd = File.expand_path "zstd-#{ZSTD_VERSION}/lib", root
17
19
  zlibwrapper = File.expand_path "zstd-#{ZSTD_VERSION}/zlibWrapper", root
18
20
 
19
21
  File.open('zstdlib.c', 'w') do |file|
22
+ file << %~\n#include <zstd.h>\n~
20
23
  file << File.read("#{zmod}/zlib.c").
21
- gsub(/Init_zlib/, 'Init_zstdlib').
22
- gsub(/rb_define_module.*/, 'rb_define_module("Zstdlib");').
24
+ gsub(%~Init_zlib~, %~Init_zstdlib~).
25
+ gsub(/"([Zz])lib"/, '"\1stdlib"').
26
+ gsub(/Zlib(\.|::)/, 'Zstdlib\1').
23
27
  gsub(%~<zlib.h>~, %~<zstd_zlibwrapper.h>~).
28
+ gsub(%~Z_DEFAULT_COMPRESSION~, %~ZSTD_CLEVEL_DEFAULT~).
24
29
  gsub(%~Z_BEST_COMPRESSION~, %~ZSTD_maxCLevel()~)
30
+ file << %~\n/* Ruby: #{RB_VERSION} Zlib: #{ZMOD_VERSION} */\n~
25
31
  end
26
32
 
27
33
  $srcs = ['zstdlib.c']
28
34
 
29
35
  $CFLAGS += ' -fomit-frame-pointer -ffast-math -O3'
30
- $CPPFLAGS += " -I#{zlib} -I#{zlibwrapper} -I#{zstd}/lib -DZWRAP_USE_ZSTD=1 -DGZIP_SUPPORT=0"
36
+ $CPPFLAGS += " -I#{zlib} -I#{zlibwrapper} -I#{zstd} -DZWRAP_USE_ZSTD=1 -DGZIP_SUPPORT=0"
31
37
  $LDFLAGS += ' -s'
32
38
  $LOCAL_LIBS += ' libzlibwrapper.a libz.a libzstd.a'
33
39
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zstdlib
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
  - Oleg A. Khlybov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-11 00:00:00.000000000 Z
11
+ date: 2019-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,7 +66,21 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.7.2
69
- description: Zlib drop-in replacement implementing Zstd (de)compression algorithm
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: A Zlib drop-in replacement implementing Zstandard compression algorithm
70
84
  email:
71
85
  - fougas@mail.ru
72
86
  executables: []
@@ -194,5 +208,5 @@ rubyforge_project:
194
208
  rubygems_version: 2.7.9
195
209
  signing_key:
196
210
  specification_version: 4
197
- summary: Ruby interface for the Zstd (de)compression library
211
+ summary: Ruby interface for the Zstd data compression library
198
212
  test_files: []