container-source-policy 0.1.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 43dd36d1b31dc8d1bc31680a1ffd365b1e3bf4b31f5b050ad208f8e879881a24
4
+ data.tar.gz: af98fe2b86ef685efe55f3f2c8525982a2ad154c3534226c93687bb1c9da299f
5
+ SHA512:
6
+ metadata.gz: 96757a321f0c3df8704faf1140db52d980e2c1a2223521cc0848206aff606038e349d82fca2bc9dabce5af5403607d36e8464e0426aa9e42c41aec858e248ba1
7
+ data.tar.gz: 25af96167ed8a4b6cb1a3a78d77f73dfcdbddd3bb2dfbdb80657e65a3c7a19dbbea26cf09599db5a8cfa8943f849128d90bfbdd49489a0f1549b4cc860491361
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rubygems"
4
+
5
+ platform = Gem::Platform.new(RUBY_PLATFORM)
6
+ arch =
7
+ case platform.cpu.sub(/\Auniversal\./, '')
8
+ when /\Aarm64/ then "arm64" # Apple reports arm64e on M1 macs
9
+ when /aarch64/ then "arm64"
10
+ when "x86_64" then "x64"
11
+ when "x64" then "x64" # Windows with MINGW64 reports RUBY_PLATFORM as "x64-mingw32"
12
+ else raise "Unknown architecture: #{platform.cpu}"
13
+ end
14
+
15
+ os =
16
+ case platform.os
17
+ when "linux" then "linux"
18
+ when "darwin" then "darwin" # MacOS
19
+ when "windows" then "windows"
20
+ when "mingw32" then "windows" # Windows with MINGW64 reports RUBY_PLATFORM as "x64-mingw32"
21
+ when "mingw" then "windows"
22
+ when "freebsd" then "freebsd"
23
+ else raise "Unknown OS: #{platform.os}"
24
+ end
25
+
26
+ binary = "container-source-policy-#{os}-#{arch}/container-source-policy"
27
+ binary = "#{binary}.exe" if os == "windows"
28
+
29
+ args = $*.map { |x| x.include?(' ') ? "'" + x + "'" : x }
30
+ cmd = File.expand_path "#{File.dirname(__FILE__)}/../libexec/#{binary}"
31
+
32
+ unless File.exist?(cmd)
33
+ raise "Invalid platform. container-source-policy wasn't build for #{RUBY_PLATFORM}"
34
+ end
35
+
36
+ pid = spawn("#{cmd} #{args.join(' ')}")
37
+ Process.wait(pid)
38
+ exit($?.exitstatus)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ContainerSourcePolicy
4
+ VERSION = "0.1.0"
5
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: container-source-policy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Konstantin Vyatkin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-01-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ - tino@vtkn.io
16
+ executables:
17
+ - container-source-policy
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - bin/container-source-policy
22
+ - lib/container-source-policy.rb
23
+ - libexec/container-source-policy-darwin-arm64/container-source-policy
24
+ - libexec/container-source-policy-darwin-x64/container-source-policy
25
+ - libexec/container-source-policy-freebsd-x64/container-source-policy
26
+ - libexec/container-source-policy-linux-arm64/container-source-policy
27
+ - libexec/container-source-policy-linux-x64/container-source-policy
28
+ - libexec/container-source-policy-windows-arm64/container-source-policy.exe
29
+ - libexec/container-source-policy-windows-x64/container-source-policy.exe
30
+ homepage: https://github.com/tinovyatkin/container-source-policy
31
+ licenses:
32
+ - MIT
33
+ metadata: {}
34
+ post_install_message: container-source-policy installed! Run 'container-source-policy
35
+ --help' to see usage.
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.4.20
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Generate Buildx container source policy file for a given Dockerfile
54
+ test_files: []