Skip to content

Commit c778e91

Browse files
committed
bump with corrected rubocop
1 parent ffe2fa2 commit c778e91

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

ext/libv8-node/paths.rb

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,38 @@ def object_paths
2222
end
2323

2424
def platform
25-
@platform ||= begin
26-
local = Gem::Platform.local
27-
parts = [local.cpu, local.os, local.version]
28-
parts[2] = 'musl' if RUBY_PLATFORM =~ /musl/
29-
ideal = parts.compact.reject { |s| s.to_s.empty? }.join('-').gsub(/-darwin-?\d+/, '-darwin')
25+
@platform ||= determine_platform
26+
end
27+
28+
def determine_platform
29+
ideal = construct_ideal_platform_name
30+
return ideal if platform_directory_exists?(ideal)
31+
32+
fallback_platform
33+
end
34+
35+
def construct_ideal_platform_name
36+
local = Gem::Platform.local
37+
parts = [local.cpu, local.os, local.version]
38+
parts[2] = 'musl' if musl_platform?
39+
parts.compact.reject(&:empty?).join('-').gsub(/-darwin-?\d+/, '-darwin')
40+
end
3041

31-
return ideal if File.directory?(File.join(vendored_source_path, ideal))
42+
def musl_platform?
43+
RUBY_PLATFORM =~ /musl/
44+
end
45+
46+
def platform_directory_exists?(name)
47+
File.directory?(File.join(vendored_source_path, name))
48+
end
49+
50+
def fallback_platform
51+
available = available_platform_directories
52+
available.size == 1 ? available.first : construct_ideal_platform_name
53+
end
3254

33-
available = Dir.glob(File.join(vendored_source_path, '*')).select { |d| File.directory?(d) }.map { |d| File.basename(d) } - ['include']
34-
available.size == 1 ? available.first : ideal
35-
end
55+
def available_platform_directories
56+
Dir.glob(File.join(vendored_source_path, '*')).select { |d| File.directory?(d) }.map { |d| File.basename(d) } - ['include']
3657
end
3758

3859
def config

lib/libv8/node/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Libv8
44
end
55

66
module Libv8::Node
7-
VERSION = '24.12.0.0'
7+
VERSION = '24.12.0.1'
88
NODE_VERSION = '24.12.0'
99
LIBV8_VERSION = '13.6.233.17' # from src/node-.../deps/v8/include/v8-version.h
1010
end

0 commit comments

Comments
 (0)