devfile 0.4.4-arm64-darwin → 0.4.7-arm64-darwin

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: d8c796167623801b4c3d2c736f6c81236944a0dba178bcd6c7ea204f5fd54a43
4
- data.tar.gz: 43ada828a63fc789b60e24fc8ebbf875bd39709c2b04f4181bd10da42215fd7a
3
+ metadata.gz: aba13be89fff43c154dadaa09181866b90760163abdcd4bf108fc32a05be5f83
4
+ data.tar.gz: d1bec4ef57fe413eca007bfa88a70f9c789d3b0eafa5c575a82432ddfec4d68f
5
5
  SHA512:
6
- metadata.gz: d0057e3ea3c6ac602fa0f2947bf732d1bdc1b1519b97c5da765ff29510037d145719769a7ae966e05da2d78ac32da52112154dd0fc395e86fb0fc942c614ec72
7
- data.tar.gz: 8daa664e89d1aef70967d9489a466568d93683af47f8a4bf44460f2fcd78e63a103f848ee6f346815dce1bf5e741a3c99dec5259584caf0a16bc5a8a43963574
6
+ metadata.gz: 47b97be94a818e3910da4728a87efdbdd4a20d618565b4a3d119c3e31e68634eeb6b8e35765efb1ee4ef378d32c0b04419f7c9987faabbcfb5fb68f359d5d820
7
+ data.tar.gz: a57bf549280006ddf83594d49091cb14ad99240dec7c2569684a88be522dba27ab03c86a88156818262d25abdfb3cbce74a22bf3448f8edd339be8e0e3428df0
data/lib/devfile.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'open3'
4
+ require_relative 'ruby_cpu_to_go_arch'
4
5
 
5
6
  # Module that works with the Devfile standard
6
7
  module Devfile
@@ -9,21 +10,10 @@ module Devfile
9
10
 
10
11
  # Set of services to parse a devfile and output k8s manifests
11
12
  class Parser
12
- FILE_PATH = File.expand_path('./../bin/devfile', File.dirname(__FILE__))
13
13
  DEVFILE_GEMSPEC = Gem.loaded_specs['devfile']
14
- RUBY_CPU_TO_GOARCH = {
15
- 'x86_64' => 'amd64',
16
- 'aarch64' => 'arm64',
17
- 'amd64' => 'amd64',
18
- 'arm64' => 'arm64',
19
- 'universal' => 'arm64'
20
- # This exist because if Rosetta is enabled on mac, it means both arm and amd64 bianries
21
- # can be run so the gem lib sets the CPU as "universal".
22
- # see: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment
23
- }.freeze
24
14
  ARCH = RUBY_CPU_TO_GOARCH[Gem::Platform.local.cpu] || Gem::Platform.local.cpu
25
15
  SYSTEM_PLATFORM = "#{ARCH}-#{Gem::Platform.local.os}"
26
- PLATFORM_SPECIFIC_BINARY_PATH = File.expand_path("./../bin/devfile-#{SYSTEM_PLATFORM}", File.dirname(__FILE__))
16
+ FILE_PATH = File.expand_path("./../out/devfile-#{SYSTEM_PLATFORM}", File.dirname(__FILE__))
27
17
 
28
18
  class << self
29
19
  def get_deployment(devfile, name, namespace, labels, annotations, replicas)
@@ -53,13 +43,9 @@ module Devfile
53
43
  private
54
44
 
55
45
  def call(*cmd)
56
- file_path = FILE_PATH
57
- if ruby_platform?
58
- raise_if_unsupported_system_platform!
59
- file_path = PLATFORM_SPECIFIC_BINARY_PATH
60
- end
46
+ raise_if_unsupported_system_platform! if ruby_platform?
61
47
 
62
- stdout, stderr, status = Open3.capture3({}, file_path, *cmd.map(&:to_s))
48
+ stdout, stderr, status = Open3.capture3({}, FILE_PATH, *cmd.map(&:to_s))
63
49
  raise(CliError, stderr) unless status.success?
64
50
 
65
51
  stdout
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Devfile
4
+ # Gem::Platform.local.cpu can return a varied arch depending on the distribution,
5
+ # but they still refer to the same arch
6
+ RUBY_CPU_TO_GOARCH = {
7
+ 'x86_64' => 'amd64',
8
+ 'aarch64' => 'arm64',
9
+ 'amd64' => 'amd64',
10
+ 'arm64' => 'arm64',
11
+ 'universal' => 'arm64'
12
+ # This exist because if Rosetta is enabled on mac, it means both arm and amd64 bianries
13
+ # can be run so the gem lib sets the CPU as "universal".
14
+ # see: https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment
15
+ }.freeze
16
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devfile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.7
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - GitLab
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-06 00:00:00.000000000 Z
10
+ date: 2025-08-15 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Library used to generate kubernetes manifests from a Devfile.
13
13
  email:
@@ -18,13 +18,14 @@ executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
- - bin/devfile
22
21
  - ext/devfile.go
23
22
  - ext/go.mod
24
23
  - ext/go.sum
25
24
  - ext/main.go
26
25
  - ext/volume.go
27
26
  - lib/devfile.rb
27
+ - lib/ruby_cpu_to_go_arch.rb
28
+ - out/devfile-arm64-darwin
28
29
  homepage: https://gitlab.com
29
30
  licenses:
30
31
  - MIT