digest-xxhash 0.0.3 → 0.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
- SHA1:
3
- metadata.gz: 70bda38e968bd286bb529fdaea93306867b2711c
4
- data.tar.gz: e70942cbba4e25c06b124e3adc8fd008665c2888
2
+ SHA256:
3
+ metadata.gz: 155293f54dc37486a7827e7356f3758f0cd411e444a66be7e35058e7f6ed742e
4
+ data.tar.gz: 5c304167f2978dec00ed022c985360af16bcd91581f35a280a2c42aa7a4f5555
5
5
  SHA512:
6
- metadata.gz: 987ccbba297ee355686df25fd14225dac3ba89a460fc31b36bcac876c78d18bbac4765cd58f0c8c7cbac9e06c788827de1d7783511a5d76627dff8a545bd180e
7
- data.tar.gz: ae6af3b301e27d9d0d120b9a440f309468337557e829205a7908126e5b34c947e18107e6446af4f217fd423f613c7c679d3f78da5ee68e3add67cce05b34d6c7
6
+ metadata.gz: 510fd4a123c89d68eeb45a263f120dd85e88aa2dca4ca747f4231195dbb1687d77b997a50d3675a2627607f55b22a4134a231c73a7fbf312cef8e6a8676cf846
7
+ data.tar.gz: 22dd84864a3bace71d39cd0886d13d74d867b680b6b28fc72d684ff98c169632e1de22758b1063c1514d795caacd019edf6281b480bf78175d8d7ecf7201b099
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2
4
+ - 2.3
5
+ - 2.4
6
+ - 2.5
data/README.md CHANGED
@@ -59,3 +59,6 @@ Or install it yourself as:
59
59
  3. Commit your changes (`git commit -am 'Add some feature'`).
60
60
  4. Push to the branch (`git push origin my-new-feature`).
61
61
  5. Create a new Pull Request.
62
+
63
+ [![Build Status](https://travis-ci.org/konsolebox/digest-xxhash-ruby.svg?branch=master)](https://travis-ci.org/konsolebox/digest-xxhash-ruby)
64
+ [![Build status](https://ci.appveyor.com/api/projects/status/kb6hvlxjms3ftw7u?svg=true)](https://ci.appveyor.com/project/konsolebox/digest-xxhash-ruby)
data/Rakefile CHANGED
@@ -17,4 +17,7 @@ task :clean do
17
17
  rm_f list unless list.empty?
18
18
  end
19
19
 
20
+ # Set 'test' as default task.
21
+ task :default => :test
22
+
20
23
  # Run `rake --tasks` for a list of tasks.
@@ -0,0 +1,19 @@
1
+ version: 1.0.{build}
2
+ init:
3
+ - cmd: >-
4
+ set base_path=C:/Program Files/7-Zip;C:/Program Files/AppVeyor/BuildAgent;C:/Program Files/Git/cmd;C:/Windows/system32;C:/Windows;"C:/Program Files (x86)/GNU/GnuPG/pub"
5
+
6
+ set PATH=C:/ruby%ruby_version%/bin;C:/msys64/usr/bin;%base_path%
7
+ environment:
8
+ matrix:
9
+ - ruby_version: 22-x64
10
+ - ruby_version: 23-x64
11
+ - ruby_version: 24-x64
12
+ - ruby_version: 25-x64
13
+ install:
14
+ - cmd: bundle install
15
+ build_script:
16
+ - cmd: bundle exec rake -rdevkit compile
17
+ test_script:
18
+ - cmd: bundle exec rake test
19
+ deploy: off
@@ -23,7 +23,6 @@
23
23
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
24
  */
25
25
 
26
-
27
26
  #include <ruby.h>
28
27
  #include <ruby/digest.h>
29
28
  #include <stdint.h>
@@ -63,6 +62,7 @@ static ID _id_reset;
63
62
  static ID _id_update;
64
63
 
65
64
  static VALUE _Digest;
65
+ static VALUE _Digest_Class;
66
66
  static VALUE _Digest_XXHash;
67
67
  static VALUE _Digest_XXH32;
68
68
  static VALUE _Digest_XXH64;
@@ -409,7 +409,7 @@ static VALUE _Digest_XXH32_internal_allocate(VALUE klass)
409
409
  static VALUE _Digest_XXH32_update(VALUE self, VALUE str)
410
410
  {
411
411
  if (XXH32_update(_get_state_32(self), RSTRING_PTR(str), RSTRING_LEN(str)) != XXH_OK)
412
- rb_raise(rb_eRuntimeError, "Failed to reset state.");
412
+ rb_raise(rb_eRuntimeError, "Failed to update state.");
413
413
 
414
414
  return self;
415
415
  }
@@ -557,7 +557,7 @@ static VALUE _Digest_XXH64_internal_allocate(VALUE klass)
557
557
  static VALUE _Digest_XXH64_update(VALUE self, VALUE str)
558
558
  {
559
559
  if (XXH64_update(_get_state_64(self), RSTRING_PTR(str), RSTRING_LEN(str)) != XXH_OK)
560
- rb_raise(rb_eRuntimeError, "Failed to reset state.");
560
+ rb_raise(rb_eRuntimeError, "Failed to update state.");
561
561
 
562
562
  return self;
563
563
  }
@@ -700,18 +700,21 @@ void Init_xxhash()
700
700
  DEFINE_ID(reset)
701
701
  DEFINE_ID(update)
702
702
 
703
- #if 0
704
- _Digest = rb_define_module("Digest"); /* Tell RDoc about Digest since it doesn't recognize rb_path2class. */
705
- #endif
706
-
707
703
  rb_require("digest");
708
704
  _Digest = rb_path2class("Digest");
705
+ _Digest_Class = rb_path2class("Digest::Class");
706
+
707
+ #if 0
708
+ /* Tell RDoc about Digest and Digest::Class since it doesn't parse rb_path2class. */
709
+ _Digest = rb_define_module("Digest");
710
+ _Digest_Class = rb_define_class_under(_Digest, "Class", rb_cObject);
711
+ #endif
709
712
 
710
713
  /*
711
714
  * Document-class: Digest::XXHash
712
715
  */
713
716
 
714
- _Digest_XXHash = rb_define_class_under(_Digest, "XXHash", rb_path2class("Digest::Class"));
717
+ _Digest_XXHash = rb_define_class_under(_Digest, "XXHash", _Digest_Class);
715
718
 
716
719
  rb_define_method(_Digest_XXHash, "digest", _Digest_XXHash_digest, -1);
717
720
  rb_define_method(_Digest_XXHash, "hexdigest", _Digest_XXHash_hexdigest, -1);
@@ -1,5 +1,7 @@
1
+ require 'digest'
2
+
1
3
  module Digest
2
- class XXHash
3
- VERSION = "0.0.3"
4
+ class XXHash < Digest::Class
5
+ VERSION = "0.1.0"
4
6
  end
5
7
  end
@@ -22,10 +22,10 @@ end
22
22
  it "produces correct types of digest outputs" do
23
23
  klass.digest("").must_be_instance_of String
24
24
  klass.hexdigest("").must_be_instance_of String
25
- klass.idigest("").must_be_instance_of Integer
25
+ klass.idigest("").must_be_kind_of Integer
26
26
  klass.new.digest("").must_be_instance_of String
27
27
  klass.new.hexdigest("").must_be_instance_of String
28
- klass.new.idigest("").must_be_instance_of Integer
28
+ klass.new.idigest("").must_be_kind_of Integer
29
29
  end
30
30
 
31
31
  it "produces similar output with its digest, hexdigest and idigest methods" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digest-xxhash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - konsolebox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-07 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -60,10 +60,12 @@ extensions:
60
60
  - ext/digest/xxhash/extconf.rb
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".travis.yml"
63
64
  - Gemfile
64
65
  - LICENSE
65
66
  - README.md
66
67
  - Rakefile
68
+ - appveyor.yml
67
69
  - digest-xxhash.gemspec
68
70
  - ext/digest/xxhash/debug-funcs.h
69
71
  - ext/digest/xxhash/ext.c
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  version: '0'
96
98
  requirements: []
97
99
  rubyforge_project:
98
- rubygems_version: 2.6.12
100
+ rubygems_version: 2.7.4
99
101
  signing_key:
100
102
  specification_version: 4
101
103
  summary: XXHash for Ruby