contrast-agent-lib 0.1.0 → 0.1.1

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
2
  SHA256:
3
- metadata.gz: '017349c168822728ffa9a1d6cb823c7f5ae8c58f155dd7271251882fb0fab155'
4
- data.tar.gz: 0f03975b70fd85774a06214b979384dfe13c3fbb4515c87b687c27ba55a99d5b
3
+ metadata.gz: c11ea8c56731ecddea31d1a313c89d255a29d92b6402eb9b8bafb87d4e99eb1e
4
+ data.tar.gz: 8061ccf26b37af4f38b31c7dfa0de84140cacde4b93aa5021ae26619c5d9b00f
5
5
  SHA512:
6
- metadata.gz: 01e99d555474e629b19527e40b446c13994575bcb5a6602d4fbf6b6c2d8cb65bd6b482a6127ede6564f49ed22952d918570a89a8170bbb60c3debb8a47bf7c9c
7
- data.tar.gz: ad5f5bf289a8164d34c38803d46dfffe527a54376fc13b8d6b7f7aa2bfb0b189ed57eefe0970b45d80ff3fe7120cefe6eff95a07ac9b97eb02053dd0c83ebffd
6
+ metadata.gz: e14c613abf66b81c95016f6b51ac3910007acc22d374678e9c06577c05cab0e15751a00aad2beea990d220532def48b45ee69b52cb15ce02ba30e3f9cb91d89b
7
+ data.tar.gz: d8daefc635c0e5fc4c655235e5e9a999610a755f5d542151cc85e06056c7d4f8e2fa89fdd2ee54f61a0fb055e5f2e87f1b234d4389dba4725b6f210daec32478
@@ -1,6 +1,8 @@
1
1
  # Copyright (c) 2022 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
2
2
  # frozen_string_literal: true
3
3
 
4
+ require_relative './lib/utils/version'
5
+
4
6
  # Add the team as authors of the Gem
5
7
  def self.add_authors spec
6
8
  spec.authors = %w[
@@ -19,13 +21,13 @@ end
19
21
 
20
22
  Gem::Specification.new do |spec|
21
23
  spec.name = 'contrast-agent-lib'
22
- spec.version = '0.1.0'
24
+ spec.version = ContrastAgentLib::Version::VERSION
23
25
  spec.summary = "This is the Ruby Interface for Rust Agent Library"
24
26
  spec.description = "Gem including the interface for the Rust Agent Library, which will be used within the Ruby-Agent"
25
27
  spec.email = %w[ruby@contrastsecurity.com]
26
28
  spec.files = %w[lib/utils/os.rb lib/contrast-agent-lib.rb usage_files/libcontrast_c.dylib
27
- usage_files/libcontrast_c.so scripts/build_gem.sh .ruby-version contrast-agent-lib.gemspec
28
- Gemfile LICENSE.txt
29
+ usage_files/libcontrast_c.so usage_files/libcontrast_c_musl.so scripts/build_gem.sh
30
+ .ruby-version contrast-agent-lib.gemspec Gemfile LICENSE.txt
29
31
  ]
30
32
  spec.require_paths = ['lib']
31
33
  spec.homepage = 'https://www.contrastsecurity.com'
@@ -8,7 +8,12 @@ module ContrastAgentLib
8
8
  include ContrastAgentLib::OS
9
9
  LINUX_LIB = File.join(__dir__, '..', 'usage_files/libcontrast_c.so')
10
10
  MAC_LIB = File.join(__dir__, '..', 'usage_files/libcontrast_c.dylib')
11
+ ALPINE_LIB = File.join(__dir__, '..', 'usage_files/libcontrast_c_musl.so')
11
12
  # Since we need two different extensions for each platform we
12
13
  # need to detect the used OS before loading the dynamic library.
13
- CONTRAST_C = ContrastAgentLib::OS.linux? ? LINUX_LIB : MAC_LIB
14
+ CONTRAST_C = if ContrastAgentLib::OS.linux?
15
+ ContrastAgentLib::OS.alpine? ? ALPINE_LIB : LINUX_LIB
16
+ else
17
+ MAC_LIB
18
+ end
14
19
  end
data/lib/utils/os.rb CHANGED
@@ -24,6 +24,13 @@ module ContrastAgentLib
24
24
  def linux?
25
25
  (unix? and !mac?)
26
26
  end
27
+
28
+ def alpine?
29
+ os_release = File.open("./etc/os-release")
30
+ linux? && os_release.include?("alpine")
31
+ rescue
32
+ false
33
+ end
27
34
  end
28
35
  end
29
36
  end
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contrast-agent-lib
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
  - teodor.raychev@contrastsecurity.com
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-05-16 00:00:00.000000000 Z
15
+ date: 2022-07-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: ffi
@@ -51,6 +51,7 @@ files:
51
51
  - scripts/build_gem.sh
52
52
  - usage_files/libcontrast_c.dylib
53
53
  - usage_files/libcontrast_c.so
54
+ - usage_files/libcontrast_c_musl.so
54
55
  homepage: https://www.contrastsecurity.com
55
56
  licenses:
56
57
  - CONTRAST SECURITY (see license file)