concurrent-ruby 1.3.1 → 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: 7841a791b1b148d8e8efea668fc70f3acc98c247f8d49fea58a4c672b45a62e6
4
- data.tar.gz: 380ca8252b5b9251f30cd925d8b08f2afae56db19a210a8726b44c7304e5cd84
3
+ metadata.gz: de73718a68b7dd7b019703f83330c6f1ec241ed7b8aed1869c2b75983acb0df7
4
+ data.tar.gz: ef715c39caf7f29e13a926794ffc09a044d956c6c2b7461bcd6aaf23ed848436
5
5
  SHA512:
6
- metadata.gz: e479a5475e8d6dd7b3589a76300ccc73162cbceb8a15b721462394ff92f02054ba06e8ec5ee3ab08aa391a846d00492c708c893416b4c0c159c53d9b065f755f
7
- data.tar.gz: 52daa298a6820a10756bfbf472aff566f5b5508f4e014352aa7a8d2516873b1e69b6392cde1379c0feaeba7c054c6c6c919613c3e09ac4d2328939cde3f01444
6
+ metadata.gz: c9d669f4db5272834efb50a4cd21517e322a50f3750d1412f65aae78b67f54ab3844ce129dbab042670757ecac9765aa1991762fcbe0bf9c6aa5b954d01a7f83
7
+ data.tar.gz: e659fb2f13b77ae537c82d76508e929716c0d40cad91ab5ea0df47672a13aaebcd016df9eb3ccde1278bdb75fe9a7bb0386407bf7ba22574c9f4d9ed5cbd6b4f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  ## Current
2
2
 
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
+
3
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.
@@ -7,7 +17,7 @@
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'
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
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.