jets-api 0.2.1 → 0.2.3

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: b4261e3e051e0cd1697876dc4c80275f1362de52fe457d8758dcbffb684132ef
4
+ data.tar.gz: 8650c84846bb5c354ed92d26bac84a2b96ab63c12328ac905b365ee3d5b2ef25
5
5
  SHA512:
6
- metadata.gz: b85423d5ffa43da256e6429f98efd7c0371cefe43c15091604f0e25790ac6551ee6292e22290982468fe5964570954ee163f657a2f25ec103d20e4ad82f10801
7
- data.tar.gz: 3e0297e48ab73fbab862d65de8240ceaa26bc4d7f175860d26d46d49cf6f898618a0c0776401f4d6c2ac9b1af62dfd255daec5294f278b0ea875ae0f788168d8
6
+ metadata.gz: e5da593f9526858027bb405d6009c98d54f2ff005f01eec429163fb86bd2e65c8b014ae6345a6ba25c10fb5dbba8bb357a3502b1e237c6b7cb013babe91fb26c
7
+ data.tar.gz: d4ccd57b348cd59574f0dcd2a49cd797f3f9abede91ddbcbb193bd40234894897f81b53ef17b9a8c9e666cf7be60cf8d25c3273492a3fc482051b81f1b49f935
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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.3] - 2025-10-16
7
+ - handle http ssl true for newer ruby versions
8
+ - remove report without threads for http ssl true thread safety
9
+
10
+ ## [0.2.2] - 2025-10-11
11
+ - fix clean up gem variants
12
+
6
13
  ## [0.2.1] - 2025-10-11
7
14
  - fix gem detection ffi - gnu suffix and clean up incompatible platform variants
8
15
  - standardrb
data/lib/jets/api/core.rb CHANGED
@@ -77,7 +77,14 @@ module Jets::Api
77
77
  uri = URI(endpoint)
78
78
  http = Net::HTTP.new(uri.host, uri.port)
79
79
  http.open_timeout = http.read_timeout = 30
80
- http.use_ssl = true if uri.scheme == "https"
80
+ if uri.scheme == "https"
81
+ http.use_ssl = true
82
+ # Fix for Ruby 3.4+ where SSL context is frozen by default
83
+ # Create a new SSL context to avoid frozen object modification
84
+ if http.respond_to?(:ssl_context=)
85
+ http.ssl_context = OpenSSL::SSL::SSLContext.new
86
+ end
87
+ end
81
88
  http
82
89
  end
83
90
  memoize :http
@@ -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
 
@@ -9,15 +9,9 @@ class Jets::Api::Gems
9
9
  end
10
10
 
11
11
  def report(gems)
12
- threads = []
13
12
  gems.each do |gem_name|
14
- threads << Thread.new do
15
- Jets::Api::Gems.report(gem_name: gem_name)
16
- end
13
+ Jets::Api::Gems.report(gem_name: gem_name)
17
14
  end
18
- # Wait for request to finish because the command might finish before
19
- # the Threads even send the request. So we join them just case
20
- threads.each(&:join)
21
15
  end
22
16
  end
23
17
  end
@@ -1,5 +1,5 @@
1
1
  module Jets
2
2
  module Api
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,16 +1,14 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-10-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email:
15
13
  - tongueroo@gmail.com
16
14
  executables: []
@@ -45,7 +43,6 @@ licenses:
45
43
  - MIT
46
44
  metadata:
47
45
  homepage_uri: https://github.com/rubyonjets/jets-api
48
- post_install_message:
49
46
  rdoc_options: []
50
47
  require_paths:
51
48
  - lib
@@ -60,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
57
  - !ruby/object:Gem::Version
61
58
  version: '0'
62
59
  requirements: []
63
- rubygems_version: 3.4.19
64
- signing_key:
60
+ rubygems_version: 3.7.2
65
61
  specification_version: 4
66
62
  summary: Jets API Client Library for Jets Ruby Serverless Framework
67
63
  test_files: []