concurrent-ruby 1.3.1.pre → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b3f7a68382f7fab40500191814c5f26ae1bbe1cbc05d462c813584c28bbb548
4
- data.tar.gz: f3ff0e09369fe9871bfe6de7e378e583ae750253f691a467fe9bda159cceebb5
3
+ metadata.gz: de73718a68b7dd7b019703f83330c6f1ec241ed7b8aed1869c2b75983acb0df7
4
+ data.tar.gz: ef715c39caf7f29e13a926794ffc09a044d956c6c2b7461bcd6aaf23ed848436
5
5
  SHA512:
6
- metadata.gz: 118e62d97725f1394dc99738fc63ddb8a2bec0fb054f38b2d89acc3bd667e22ca010c9057313b465edfa612718816da1140743f8015e08c0b0d16b001b272961
7
- data.tar.gz: c460ea75b66f76b34e42dddce248bceeab9d7c0166b4a80f6ab79d7c6978b815170f06558ea10c35ee94361122bc9974176afaef5c0f0532c887ac379b3c2301
6
+ metadata.gz: c9d669f4db5272834efb50a4cd21517e322a50f3750d1412f65aae78b67f54ab3844ce129dbab042670757ecac9765aa1991762fcbe0bf9c6aa5b954d01a7f83
7
+ data.tar.gz: e659fb2f13b77ae537c82d76508e929716c0d40cad91ab5ea0df47672a13aaebcd016df9eb3ccde1278bdb75fe9a7bb0386407bf7ba22574c9f4d9ed5cbd6b4f
data/CHANGELOG.md CHANGED
@@ -1,13 +1,23 @@
1
1
  ## Current
2
2
 
3
- ## Release v1.3.1 (28 May 2024)
3
+ ## Release v1.3.2, edge v0.7.1 (29 May 2024)
4
+
5
+ concurrent-ruby:
6
+
7
+ * (#1051) Remove dependency on `win32ole`.
8
+
9
+ concurrent-ruby-edge:
10
+
11
+ * (#1052) Fix dependency on `concurrent-ruby` to allow the latest release.
12
+
13
+ ## Release v1.3.1 (29 May 2024)
4
14
 
5
15
  * Release 1.3.0 was broken when pushed to RubyGems. 1.3.1 is a packaging fix.
6
16
 
7
17
  ## Release v1.3.0 (28 May 2024)
8
18
 
9
19
  * (#1042) Align Java Executor Service behavior for `shuttingdown?`, `shutdown?`
10
- * (#1038) Add `Concurrent.usable_processor_count` that is cgroups aware.
20
+ * (#1038) Add `Concurrent.available_processor_count` that is cgroups aware.
11
21
 
12
22
  ## Release v1.2.3 (16 Jan 2024)
13
23
 
data/Rakefile CHANGED
@@ -28,6 +28,10 @@ unless Concurrent.on_jruby? || Concurrent.on_truffleruby?
28
28
  end
29
29
  end
30
30
 
31
+ def which?(executable)
32
+ !`which #{executable} 2>/dev/null`.empty?
33
+ end
34
+
31
35
  require 'rake_compiler_dock'
32
36
  namespace :repackage do
33
37
  desc '* with Windows fat distributions'
@@ -42,12 +46,19 @@ namespace :repackage do
42
46
  Rake::Task['lib/concurrent-ruby/concurrent/concurrent_ruby.jar'].invoke
43
47
 
44
48
  # build all gem files
49
+ rack_compiler_dock_kwargs = {}
50
+ if which?('podman') and (!which?('docker') || `docker --version`.include?('podman'))
51
+ # podman and only podman available, so RakeCompilerDock will use podman, otherwise it uses docker
52
+ rack_compiler_dock_kwargs = {
53
+ options: ['--privileged'], # otherwise the directory in the image is empty
54
+ runas: false
55
+ }
56
+ end
45
57
  %w[x86-mingw32 x64-mingw32].each do |plat|
46
58
  RakeCompilerDock.sh(
47
59
  "bundle install --local && bundle exec rake native:#{plat} gem --trace",
48
60
  platform: plat,
49
- options: ['--privileged'], # otherwise the directory in the image is empty
50
- runas: false)
61
+ **rack_compiler_dock_kwargs)
51
62
  end
52
63
  end
53
64
  end
@@ -256,10 +267,12 @@ namespace :release do
256
267
 
257
268
  Bundler.with_original_env do
258
269
  sh 'ruby -v'
270
+ sh 'bundle install'
259
271
  sh 'bundle exec rake spec:installed'
260
272
 
261
- env = { "PATH" => "#{ENV['CONCURRENT_JRUBY_HOME']}/bin:#{ENV['PATH']}" }
273
+ env = { "PATH" => "#{ENV.fetch('CONCURRENT_JRUBY_HOME')}/bin:#{ENV['PATH']}" }
262
274
  sh env, 'ruby -v'
275
+ sh env, 'bundle install'
263
276
  sh env, 'bundle exec rake spec:installed'
264
277
  end
265
278
 
@@ -271,8 +284,8 @@ namespace :release do
271
284
  task :publish => ['publish:ask', 'publish:tag', 'publish:rubygems', 'publish:post_steps']
272
285
 
273
286
  namespace :publish do
274
- publish_base = true
275
- publish_edge = false
287
+ publish_base = nil
288
+ publish_edge = nil
276
289
 
277
290
  task :ask do
278
291
  begin
@@ -280,8 +293,15 @@ namespace :release do
280
293
  input = STDIN.gets.strip.downcase
281
294
  end until %w(y n).include?(input)
282
295
  exit 1 if input == 'n'
296
+
297
+ begin
298
+ STDOUT.puts 'Do you want to publish `concurrent-ruby`? (y/n)'
299
+ input = STDIN.gets.strip.downcase
300
+ end until %w(y n).include?(input)
301
+ publish_base = input == 'y'
302
+
283
303
  begin
284
- STDOUT.puts 'It will publish `concurrent-ruby`. Do you want to publish `concurrent-ruby-edge`? (y/n)'
304
+ STDOUT.puts 'Do you want to publish `concurrent-ruby-edge`? (y/n)'
285
305
  input = STDIN.gets.strip.downcase
286
306
  end until %w(y n).include?(input)
287
307
  publish_edge = input == 'y'
@@ -68,10 +68,20 @@ module Concurrent
68
68
  end
69
69
  cores.count
70
70
  when /mswin|mingw/
71
- require 'win32ole'
72
- result_set = WIN32OLE.connect("winmgmts://").ExecQuery(
73
- "select NumberOfCores from Win32_Processor")
74
- result_set.to_enum.collect(&:NumberOfCores).reduce(:+)
71
+ # Get-CimInstance introduced in PowerShell 3 or earlier: https://learn.microsoft.com/en-us/previous-versions/powershell/module/cimcmdlets/get-ciminstance?view=powershell-3.0
72
+ result = run('powershell -command "Get-CimInstance -ClassName Win32_Processor | Select-Object -Property NumberOfCores"')
73
+ if !result || $?.exitstatus != 0
74
+ # fallback to deprecated wmic for older systems
75
+ result = run("wmic cpu get NumberOfCores")
76
+ end
77
+ if !result || $?.exitstatus != 0
78
+ # Bail out if both commands returned something unexpected
79
+ processor_count
80
+ else
81
+ # powershell: "\nNumberOfCores\n-------------\n 4\n\n\n"
82
+ # wmic: "NumberOfCores \n\n4 \n\n\n\n"
83
+ result.scan(/\d+/).map(&:to_i).reduce(:+)
84
+ end
75
85
  else
76
86
  processor_count
77
87
  end
@@ -81,6 +91,11 @@ module Concurrent
81
91
  return 1
82
92
  end
83
93
 
94
+ def run(command)
95
+ IO.popen(command, &:read)
96
+ rescue Errno::ENOENT
97
+ end
98
+
84
99
  def compute_cpu_quota
85
100
  if RbConfig::CONFIG["target_os"].include?("linux")
86
101
  if File.exist?("/sys/fs/cgroup/cpu.max")
@@ -1,3 +1,3 @@
1
1
  module Concurrent
2
- VERSION = '1.3.1.pre'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: concurrent-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1.pre
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jerry D'Antonio
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-05-29 00:00:00.000000000 Z
13
+ date: 2024-06-07 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: |
16
16
  Modern concurrency tools including agents, futures, promises, thread pools, actors, supervisors, and more.
@@ -177,9 +177,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
177
177
  version: '2.3'
178
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  requirements:
180
- - - ">"
180
+ - - ">="
181
181
  - !ruby/object:Gem::Version
182
- version: 1.3.1
182
+ version: '0'
183
183
  requirements: []
184
184
  rubygems_version: 3.3.26
185
185
  signing_key: