aws-crt 0.1.5-x86_64-linux → 0.1.7-x86_64-linux

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: e8a956733fdf46d6f283eef1afb6357e2e1db0ed5776d78c2a4380c9f6c3118c
4
- data.tar.gz: f18d0afec9f5948eb8d1f1b77c718206a122589178028818fe71c4eb838b5c05
3
+ metadata.gz: 2aed99a36b77e66203b6ac9786a948c2e304a4f3682641cc351755dfd69a3544
4
+ data.tar.gz: d71562441202eb01cf79ef5b15a4cfe3d5be20a8a4b33f4d99e255305414ec77
5
5
  SHA512:
6
- metadata.gz: c92f2b0adf3b026378c508eb508992af68fbe167abfafc5b4ed82c30ef43b9df128293dd533a6a002728c67523e8248bf0d2205b7be5fee19cd91afa599731bc
7
- data.tar.gz: 246b98dca091f9b94dd1c2bef22c1897f84ea28ad46238aec8c8af46261668d4ad915cae606f08983c5726a5d74714e9fe767fb761d2ce404355082b39a313e5
6
+ metadata.gz: a4f5296e967b0a1730838cc500e2acaf325e6b207a868e1d02b7642c834cef14b4254ad367f431a68166e0b74169a0ad2053b1f06c07bbe33fbfab1484a00226
7
+ data.tar.gz: 9b13d647e01dfb43dc1a653e4e8fa32af273fb8116aaa5b36cc5a8307582fef5535419a0f66e245881f95b1d56451422b86fb49740a0821476a4a35de931d646
data/CHANGELOG.md CHANGED
@@ -1,6 +1,17 @@
1
1
  Unreleased Changes
2
2
  ------------------
3
3
 
4
+ 0.1.7 (2023-02-03)
5
+ ------------------
6
+
7
+ * Issue - Update to the latest aws-crt-ffi.
8
+ * Issue - Add support for overriding crt_bin_dir with `AWS_CRT_RUBY_BIN_DIR`.
9
+
10
+ 0.1.6 (2022-08-12)
11
+ ------------------
12
+
13
+ * Issue - Update to the latest aws-crt-ffi.
14
+
4
15
  0.1.5 (2022-04-05)
5
16
  ------------------
6
17
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.7
Binary file
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'time'
4
+ require 'set'
4
5
 
5
6
  module Aws
6
7
  module Crt
@@ -9,13 +9,17 @@ OS_BINARIES = {
9
9
 
10
10
  DEFAULT_BINARY = 'libaws-crt-ffi.so'
11
11
 
12
- # @return [String] returns Gem::Platform style name for the current system
13
- # similar to Gem::Platform.local but will return systems host os/cpu
14
- # for Jruby
12
+ # @return [Gem::Platform] similar to Gem::Platform.local but will return
13
+ # host os/cpu for Jruby
15
14
  def local_platform
16
15
  Gem::Platform.new(host_string)
17
16
  end
18
17
 
18
+ # @return [Gem::Platform] return Gem::Platform for host os with target cpu
19
+ def target_platform(cpu)
20
+ Gem::Platform.new(target_string(cpu))
21
+ end
22
+
19
23
  # @return [String] return the file name for the CRT library for the platform
20
24
  def crt_bin_name(platform)
21
25
  OS_BINARIES[platform.os] || DEFAULT_BINARY
@@ -23,7 +27,9 @@ end
23
27
 
24
28
  # @return [String] return the directory of the CRT library for the platform
25
29
  def crt_bin_dir(platform)
26
- File.expand_path("../../bin/#{platform.cpu}", File.dirname(__FILE__))
30
+ ENV['AWS_CRT_RUBY_BIN_DIR'] ||
31
+ File.expand_path("../../bin/#{platform.cpu}",
32
+ File.dirname(__FILE__))
27
33
  end
28
34
 
29
35
  # @return [String] return the path to the CRT library for the platform
@@ -31,9 +37,14 @@ def crt_bin_path(platform)
31
37
  File.expand_path(crt_bin_name(platform), crt_bin_dir(platform))
32
38
  end
33
39
 
34
- # @return [String] generate a string that be used with Gem::Platform
40
+ # @return [String] generate a string that can be used with Gem::Platform
35
41
  def host_string
36
- "#{host_cpu}-#{host_os}"
42
+ target_string(host_cpu)
43
+ end
44
+
45
+ # @return [String] generate a string that can be used with Gem::Platform
46
+ def target_string(cpu)
47
+ "#{cpu}-#{host_os}"
37
48
  end
38
49
 
39
50
  # @return [String] host cpu, even on jruby
@@ -17,7 +17,7 @@ module Aws
17
17
  strings.each do |s|
18
18
  e = s.to_s.unpack('c*')
19
19
  buffer << [e.length].pack('N')
20
- buffer << (e).pack('c*')
20
+ buffer << e.pack('c*')
21
21
  end
22
22
  buffer.string.unpack('c*')
23
23
  end
@@ -31,8 +31,8 @@ module Aws
31
31
  i = 0
32
32
  while i < buffer.size
33
33
  len = buffer[i, 4].pack('c*').unpack1('N')
34
- strings << (buffer[i + 4, len].pack('c*'))
35
- .force_encoding(Encoding::UTF_8)
34
+ strings << buffer[i + 4, len].pack('c*')
35
+ .force_encoding(Encoding::UTF_8)
36
36
  i += len + 4
37
37
  end
38
38
  strings
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-crt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-05 00:00:00.000000000 Z
11
+ date: 2023-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi