digest-xxhash 0.2.1 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,6 @@ require 'digest'
2
2
 
3
3
  module Digest
4
4
  class XXHash < Digest::Class
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.4"
6
6
  end
7
7
  end
@@ -0,0 +1,58 @@
1
+ require 'singleton'
2
+
3
+ # Provides an alternate implementation of 'install' and 'install:local'.
4
+ #
5
+ # This mainly allows options to be forwarded to `gem install`.
6
+ #
7
+ class AltInstallTask < Rake::TaskLib
8
+ module GemName
9
+ def gem_name
10
+ gemspec = Bundler::GemHelper.gemspec
11
+ "#{gemspec.name}-#{gemspec.version}.gem"
12
+ end
13
+ end
14
+
15
+ module TaskComment
16
+ include GemName
17
+
18
+ def comment
19
+ comment = "Build and install #{gem_name} into system gems"
20
+ comment += " without network access" if name.to_s == "install:local"
21
+ comment
22
+ end
23
+
24
+ def full_comment
25
+ comment + "."
26
+ end
27
+ end
28
+
29
+ include Singleton
30
+ include GemName
31
+
32
+ def initialize
33
+ define
34
+ end
35
+
36
+ def define
37
+ [:install, :"install:local"].each do |name|
38
+ task(name).clear.enhance([:build]){ |task| execute_task(task) }
39
+ .singleton_class.prepend(TaskComment)
40
+ end
41
+ end
42
+
43
+ private
44
+ def pkg_dir
45
+ @pkg_dir ||= File.join(Bundler::GemHelper.instance.base, "pkg")
46
+ end
47
+
48
+ def execute_task(task)
49
+ built_gem = File.join(pkg_dir, gem_name)
50
+ raise "Gem '#{built_gem}' unexpectedly doesn't exist." unless File.exist? built_gem
51
+ gem_command = (ENV["GEM_COMMAND"].shellsplit rescue nil) || ["gem"]
52
+ opts = ARGV.select{ |e| e =~ /\A--?/ }
53
+ opts.unshift "--local" if task.name.to_s == "install:local"
54
+ Process.wait spawn(*gem_command, "install", built_gem, *opts)
55
+ end
56
+ end
57
+
58
+ AltInstallTask.instance
data/test/test.rb CHANGED
@@ -110,3 +110,9 @@ describe Digest::XXHash::XXH3_SECRET_SIZE_MIN do
110
110
  _(Digest::XXHash::XXH3_SECRET_SIZE_MIN).must_equal 136
111
111
  end
112
112
  end
113
+
114
+ describe Digest::XXHash do
115
+ it "must have VERSION constant" do
116
+ _(Digest::XXHash.constants).must_include :VERSION
117
+ end
118
+ end
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.2.1
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - konsolebox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-29 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -31,6 +31,15 @@ dependencies:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
+ - - "!="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.1.3
37
+ - - "!="
38
+ - !ruby/object:Gem::Version
39
+ version: 1.1.4
40
+ - - "!="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.1.5
34
43
  type: :development
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -38,6 +47,15 @@ dependencies:
38
47
  - - "~>"
39
48
  - !ruby/object:Gem::Version
40
49
  version: '1.0'
50
+ - - "!="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.1.3
53
+ - - "!="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.1.4
56
+ - - "!="
57
+ - !ruby/object:Gem::Version
58
+ version: 1.1.5
41
59
  - !ruby/object:Gem::Dependency
42
60
  name: minitest
43
61
  requirement: !ruby/object:Gem::Requirement
@@ -74,6 +92,7 @@ files:
74
92
  - ext/digest/xxhash/utils.h
75
93
  - ext/digest/xxhash/xxhash.h
76
94
  - lib/digest/xxhash/version.rb
95
+ - rakelib/alt-install-task.rake
77
96
  - test/produce-vectors-with-ruby-xxhash.rb
78
97
  - test/produce-vectors-with-xxhsum.rb
79
98
  - test/test.rb
@@ -98,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
117
  - !ruby/object:Gem::Version
99
118
  version: '0'
100
119
  requirements: []
101
- rubygems_version: 3.2.14
120
+ rubygems_version: 3.2.22
102
121
  signing_key:
103
122
  specification_version: 4
104
123
  summary: A Digest framework based XXHash library for Ruby