sleeping_kangaroo12 0.0.2 → 0.0.3

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: b4d2de10a5eb054f79c78f0582ad189c8cee1ac86bbe089b4adfd4c5f57c84d1
4
- data.tar.gz: 70ebb4254f79085ca629764a7b141066a86e21a99b564b29da9055816c19c2e6
3
+ metadata.gz: 78f06d260dbd9fb1a3519e169c2ad485458c052059ab01052f6e69b1ecc9a145
4
+ data.tar.gz: 386fdd73caa218e6dc8176c20cabf69e771cc2390026bd7863055a67cfeaa622
5
5
  SHA512:
6
- metadata.gz: 3704a7302ed0026463abed7510e748bb89cc9a956b9ef5c298f65f78ca38e6f8bf218a7e3e560731cf69f961d79f9e9073ca32314ed77af7ea36a809a366d946
7
- data.tar.gz: 45d1e038d116ffe9c0848680c0062f33b31d1167c9f360a308890b7c9fef14c6caea48b6ecc1bd221bfdb5eedc3eae7a793aaa335c3a3115918194afe937cc63
6
+ metadata.gz: 4fd121f2cf9c76cf4132e7f4599a379164773ee66ca576c98f0d0a8e4688b92e06013f64a013fca2d0ae9f3fed795932f23e53a806aa17f631c97579eefa3c49
7
+ data.tar.gz: 2dc91a661191d1c398904e7633b168437cff077673bed942e5c20065c9c7f6e69d79b4ae6ab8cb3d08967689d4700ead12e5a9d29f89b260f6ab00b29f3740f5
data/ext/Rakefile CHANGED
@@ -48,7 +48,7 @@ file lib_name => FileList['bin/.build/sleeping_kangaroo12.o', xkcp_static_target
48
48
  end
49
49
 
50
50
  file 'bin/.build/sleeping_kangaroo12.o' => FileList['binding/sleeping_kangaroo12.c', xkcp_static_target] do |t|
51
- sh "gcc -Wall -Wa,-adhln -O3 -march=native -I./xkcp/bin -c #{t.prerequisites.first} -o #{t.name}"
51
+ sh "gcc -Wall -O3 -march=native -I./xkcp/bin -c #{t.prerequisites.first} -o #{t.name}"
52
52
  end
53
53
 
54
54
  file xkcp_static_target => FileList['bin/.build/Makefile'] do |t|
@@ -7,7 +7,7 @@ module SleepingKangaroo12
7
7
  extend ::FFI::Library
8
8
  ffi_lib Build::Loader.find('SleepingKangaroo12')
9
9
 
10
- attach_function :init, :SleepingKangaroo12_Init, [:int], :pointer
10
+ attach_function :init, :SleepingKangaroo12_Init, %i[int], :pointer
11
11
  attach_function :update, :SleepingKangaroo12_Update, %i[pointer pointer size_t], :int
12
12
  attach_function :final, :SleepingKangaroo12_Final, %i[pointer pointer pointer size_t], :int
13
13
  attach_function :destroy, :SleepingKangaroo12_Destroy, %i[pointer], :void
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'base64'
4
+ require 'ffi'
5
+ require 'objspace'
3
6
  require_relative 'binding'
4
7
 
5
8
  module SleepingKangaroo12
@@ -30,14 +33,13 @@ module SleepingKangaroo12
30
33
 
31
34
  def update(data)
32
35
  raise Finalized if @finalized
33
-
34
36
  data_size = data.bytesize
35
37
  data_buffer = ::FFI::MemoryPointer.new(:char, data_size)
36
38
  data_buffer.put_bytes(0, data)
37
39
  Binding.update(@native_instance, data_buffer, data_size).tap do |result|
38
40
  raise UpdatingFailed unless result.zero?
39
41
  end
40
- nil
42
+ self
41
43
  end
42
44
 
43
45
  def <<(*args, **kwargs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SleepingKangaroo12
4
- VERSION = '0.0.2'
4
+ VERSION = '0.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleeping_kangaroo12
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sarun Rattanasiri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-16 00:00:00.000000000 Z
11
+ date: 2022-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -350,7 +350,7 @@ licenses:
350
350
  - BSD-3-Clause
351
351
  metadata:
352
352
  homepage_uri: https://github.com/the-cave/sleeping-kangaroo12
353
- source_code_uri: https://github.com/the-cave/sleeping-kangaroo12/tree/v0.0.2
353
+ source_code_uri: https://github.com/the-cave/sleeping-kangaroo12/tree/v0.0.3
354
354
  post_install_message:
355
355
  rdoc_options: []
356
356
  require_paths: