Skip to content

Commit 2bf11d1

Browse files
committed
Generate JSON from Ruby
1 parent 2cbd6a1 commit 2bf11d1

File tree

2 files changed

+51
-2
lines changed

2 files changed

+51
-2
lines changed

lib-injection/requirements.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@
2929
}
3030
]
3131
},
32-
"deny": []
33-
}
32+
"deny": [
33+
34+
]
35+
}

lib-injection/requirements.rb

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env ruby
2+
3+
require 'json'
4+
5+
def requirements
6+
{
7+
'$schema' => 'https://raw.githubusercontent.com/DataDog/auto_inject/refs/heads/main/preload_go/cmd/library_requirements_tester/testdata/requirements_schema.json',
8+
'version' => 1,
9+
'native_deps' => {
10+
'glibc' => [
11+
{
12+
'arch' => 'x64',
13+
'supported' => true,
14+
'min' => '2.27',
15+
'description' => 'libffi needs memfd_create',
16+
},
17+
{
18+
'arch' => 'arm64',
19+
'supported' => true,
20+
'min' => '2.27',
21+
'description' => 'libffi needs memfd_create',
22+
},
23+
],
24+
'musl' => [
25+
{
26+
'arch' => 'x64',
27+
'supported' => false,
28+
'description' => 'no musl build',
29+
},
30+
{
31+
'arch' => 'arm64',
32+
'supported' => false,
33+
'description' => 'no musl build',
34+
},
35+
],
36+
},
37+
'deny' => [],
38+
}
39+
end
40+
41+
def write(path)
42+
File.binwrite(path, JSON.pretty_generate(requirements))
43+
end
44+
45+
if $PROGRAM_NAME == __FILE__
46+
write(File.join(__dir__, 'requirements.json'))
47+
end

0 commit comments

Comments
 (0)