crew: Fix .blank? call for proc blocks (#12083)

* crew: Fix .blank? call to proc blocks

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Fix rubocop

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

---------

Signed-off-by: SupeChicken666 <me@supechicken666.dev>
This commit is contained in:
SupeChicken666
2025-06-20 17:41:22 +08:00
committed by GitHub
parent 32085aba59
commit c4c437f2bb
6 changed files with 7 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ require 'etc'
require 'open3'
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
CREW_VERSION ||= '1.62.0' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
CREW_VERSION ||= '1.62.1' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
# Kernel architecture.
KERN_ARCH ||= Etc.uname[:machine]

View File

@@ -9,6 +9,7 @@ require_relative 'downloader'
# Reimplementation of .blank? method from ActiveSupport
class NilClass; def blank? = true; end
class Numeric; def blank? = false; end
class Proc; def blank? = false; end
class Array; def blank? = empty?; end
class Hash; def blank? = empty?; end
class Symbol; def blank? = empty?; end

View File

@@ -3,6 +3,7 @@ require 'io/console'
require 'uri'
require_relative 'const'
require_relative 'color'
require_relative 'convenience_functions'
require_relative 'progress_bar'
require_relative 'require_gem'

View File

@@ -4,6 +4,7 @@ require 'etc'
require 'json'
require 'open3'
require_relative 'color'
require_relative 'convenience_functions'
require_relative 'package'
require_relative 'require_gem'

View File

@@ -2,6 +2,7 @@ require 'English'
require 'json'
require_relative 'const'
require_relative 'color'
require_relative 'convenience_functions'
require_relative 'package_helpers'
require_relative 'require_gem'
require_relative 'selector'
@@ -360,7 +361,7 @@ class Package
rescue RuntimeError => e
# Print failed line number and error message.
puts "#{e.backtrace[1]}: #{e.message}".orange
raise InstallError, "`#{env.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')} #{cmd_args.join(' ')}` exited with #{$CHILD_STATUS.exitstatus}".lightred
raise InstallError, "`#{env.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')} #{args.join(' ')}` exited with #{$CHILD_STATUS.exitstatus}".lightred
end
end
end

View File

@@ -1,7 +1,7 @@
module ReportBuildsystemMethods
def print_buildsystem_methods
boolean_list = available_boolean_properties
method_list = methods.reject(&->(m) { boolean_list.include?(m.to_s.delete_suffix('?').to_sym) }).grep(/#{superclass.to_s.downcase}_/).delete_if { |i| send(i).blank? }
method_list = methods.reject(&->(m) { boolean_list.include?(m.to_s.delete_suffix('?').to_sym) }).grep(/#{superclass.to_s.downcase}_/).select(&->(i) { send(i) })
unless method_list.empty?
require_gem 'method_source'