jets-api 0.2.1 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e69a0ae2689dddcba856316946b3d2819837d05a542b69bf33bbf025f7117d08
4
- data.tar.gz: 0cf8e60cd2423ff63e8aed0f083ae25712a01d2245becae511fcd206dff00a15
3
+ metadata.gz: 51468ca624c4c38cb0195a8d607d3237feafb9aa835b33c2d8d5f545ad665af2
4
+ data.tar.gz: 01a6654c2aa40b6fa26b13f4d6227ffa954c40e17825d70b51e88d61e1094348
5
5
  SHA512:
6
- metadata.gz: b85423d5ffa43da256e6429f98efd7c0371cefe43c15091604f0e25790ac6551ee6292e22290982468fe5964570954ee163f657a2f25ec103d20e4ad82f10801
7
- data.tar.gz: 3e0297e48ab73fbab862d65de8240ceaa26bc4d7f175860d26d46d49cf6f898618a0c0776401f4d6c2ac9b1af62dfd255daec5294f278b0ea875ae0f788168d8
6
+ metadata.gz: 3b1c5fd73342ab8a586797e7c631fb2c9590be9f461c9ac7e6f8efd2a4b96cc67fa6b4542f9ce2315897cc7e2a0e6a43b4f10e6d07ce125af0a94c27ac190d93
7
+ data.tar.gz: 46e54fbcd532c31279c04bdb0fc99f73ee36030f2d5d809f3f0486c10b50c6dc55520967ae0b0d6e62713707708fc10a2648e9a2b4ab6fd2ba53636e5c6d3d19
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.2.2] - 2025-10-11
7
+ - fix clean up gem variants
8
+
6
9
  ## [0.2.1] - 2025-10-11
7
10
  - fix gem detection ffi - gnu suffix and clean up incompatible platform variants
8
11
  - standardrb
@@ -50,14 +50,13 @@ module Jets::Api::Gems::Extract
50
50
  dest
51
51
  end
52
52
 
53
- @@log_level = :info # default level is :info
54
- # @@log_level = :debug # uncomment to debug
53
+ @@log_level = ENV["JETS_API_LOG_LEVEL"] || "info" # default level is :info
55
54
  def log_level=(val)
56
55
  @@log_level = val
57
56
  end
58
57
 
59
- def say(message, level = :info)
60
- enabled = @@log_level == :debug || level == :debug
58
+ def say(message, level = "info")
59
+ enabled = @@log_level == "debug" || level == "debug"
61
60
  puts(message) if enabled
62
61
  end
63
62
  end
@@ -44,38 +44,36 @@ module Jets::Api::Gems::Extract
44
44
  gem_groups[base_name] << {dir: dir, name: name}
45
45
  end
46
46
 
47
- # For each gem group, keep only x86_64-linux variants
48
- gem_groups.each do |base_name, variants|
49
- next if variants.size <= 1 # No cleanup needed if only one variant
47
+ # For each gem group, clean up platform variants
48
+ gem_groups.each { |base_name, variants| cleanup_gem_variants(base_name, variants, specs_dir) }
49
+ end
50
50
 
51
- say "Found #{variants.size} platform variants for #{base_name}:"
52
- variants.each { |v| say " - #{v[:name]}" }
51
+ # Clean up platform variants for a specific gem group
52
+ def cleanup_gem_variants(base_name, variants, specs_dir)
53
+ return if variants.size <= 1 # No cleanup needed if only one variant
53
54
 
54
- # Find x86_64-linux variants (preferred for AWS Lambda)
55
- x86_64_variants = variants.select { |v| v[:name].include?("-x86_64-linux-gnu") || v[:name].include?("-x86_64-linux") }
55
+ say "Found #{variants.size} platform variants for #{base_name}:"
56
+ variants.each { |v| say " - #{v[:name]}" }
56
57
 
57
- if x86_64_variants.any?
58
- # Keep x86_64-linux variants, remove others
59
- keep_variants = x86_64_variants
60
- remove_variants = variants - x86_64_variants
61
- else
62
- # If no x86_64-linux variants, keep the first one alphabetically
63
- keep_variants = [variants.min_by { |v| v[:name] }]
64
- remove_variants = variants - keep_variants
65
- end
58
+ # Always favor base gem variants (without platform suffix) - these are from Jets API
59
+ # Remove all platform-specific variants
60
+ base_variants = variants.select { |v| !v[:name].match(/-[^-]+-[^-]+$/) }
61
+ platform_variants = variants - base_variants
66
62
 
67
- say "Keeping: #{keep_variants.map { |v| v[:name] }.join(", ")}"
68
- say "Removing: #{remove_variants.map { |v| v[:name] }.join(", ")}"
63
+ keep_variants = base_variants.any? ? base_variants : variants
64
+ remove_variants = platform_variants
69
65
 
70
- # Remove incompatible variants
71
- remove_variants.each do |variant|
72
- say "Removing incompatible variant: #{variant[:name]}"
73
- FileUtils.rm_rf(variant[:dir])
66
+ say "Keeping: #{keep_variants.map { |v| v[:name] }.join(", ")}"
67
+ say "Removing: #{remove_variants.map { |v| v[:name] }.join(", ")}"
74
68
 
75
- # Also remove the corresponding gemspec
76
- gemspec_path = "#{specs_dir}/#{variant[:name]}.gemspec"
77
- FileUtils.rm_f(gemspec_path) if File.exist?(gemspec_path)
78
- end
69
+ # Remove incompatible variants
70
+ remove_variants.each do |variant|
71
+ say "Removing incompatible variant: #{variant[:name]}"
72
+ FileUtils.rm_rf(variant[:dir])
73
+
74
+ # Also remove the corresponding gemspec
75
+ gemspec_path = "#{specs_dir}/#{variant[:name]}.gemspec"
76
+ FileUtils.rm_f(gemspec_path) if File.exist?(gemspec_path)
79
77
  end
80
78
  end
81
79
 
@@ -1,5 +1,5 @@
1
1
  module Jets
2
2
  module Api
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jets-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen