From 003e0fb3306342c5070895845d5deb9fa86d735d Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sun, 5 Jan 2025 08:05:01 +0900 Subject: [PATCH] mruby-print: disable the gem unless explicitly specified mruby-print is the duplicate of part of mruby-io. You need it only when limited I/O functionality required. --- mrbgems/full-core.gembox | 2 +- mrbgems/mruby-bin-mruby/mrbgem.rake | 1 - mrbgems/mruby-print/mrbgem.rake | 3 ++- mrbgems/stdlib-io.gembox | 3 --- test/t/kernel.rb | 12 ++++++------ 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/mrbgems/full-core.gembox b/mrbgems/full-core.gembox index fdee3268e..1a3f7a860 100644 --- a/mrbgems/full-core.gembox +++ b/mrbgems/full-core.gembox @@ -1,6 +1,6 @@ MRuby::GemBox.new do |conf| Dir.glob("#{root}/mrbgems/mruby-*/mrbgem.rake") do |x| g = File.basename(File.dirname(x)) - conf.gem :core => g unless g =~ /^mruby-(?:bin-debugger|test)$/ + conf.gem :core => g unless g =~ /^mruby-(?:bin-debugger|test|print)$/ end end diff --git a/mrbgems/mruby-bin-mruby/mrbgem.rake b/mrbgems/mruby-bin-mruby/mrbgem.rake index 36bf2fa61..96daecfce 100644 --- a/mrbgems/mruby-bin-mruby/mrbgem.rake +++ b/mrbgems/mruby-bin-mruby/mrbgem.rake @@ -4,7 +4,6 @@ MRuby::Gem::Specification.new('mruby-bin-mruby') do |spec| spec.summary = 'mruby command' spec.bins = %w(mruby) spec.add_dependency('mruby-compiler', :core => 'mruby-compiler') - spec.add_test_dependency('mruby-print', :core => 'mruby-print') if build.cxx_exception_enabled? build.compile_as_cxx("#{spec.dir}/tools/mruby/mruby.c") diff --git a/mrbgems/mruby-print/mrbgem.rake b/mrbgems/mruby-print/mrbgem.rake index 2ea6e3126..ee89d7dfe 100644 --- a/mrbgems/mruby-print/mrbgem.rake +++ b/mrbgems/mruby-print/mrbgem.rake @@ -1,5 +1,6 @@ MRuby::Gem::Specification.new('mruby-print') do |spec| spec.license = 'MIT' spec.author = 'mruby developers' - spec.summary = 'standard print/puts/p' + spec.summary = 'minimal print/puts' + # mruby-io provides full I/O functionality end diff --git a/mrbgems/stdlib-io.gembox b/mrbgems/stdlib-io.gembox index 384492167..5993d5d48 100644 --- a/mrbgems/stdlib-io.gembox +++ b/mrbgems/stdlib-io.gembox @@ -7,9 +7,6 @@ MRuby::GemBox.new do |conf| # Use standard IO/File class conf.gem :core => "mruby-socket" - # Use standard print/puts/p - conf.gem :core => "mruby-print" - # Use errno extension for a good mruby-io/mruby-socket experience conf.gem :core => "mruby-errno" diff --git a/test/t/kernel.rb b/test/t/kernel.rb index a48771536..39b952fcc 100644 --- a/test/t/kernel.rb +++ b/test/t/kernel.rb @@ -59,11 +59,11 @@ assert('Kernel.loop', '15.3.1.2.8') do assert_equal 100, i end -# Kernel.p is provided by the mruby-print mrbgem. '15.3.1.2.9' +# Kernel.p is provided by the mruby-io mrbgem. '15.3.1.2.9' -# Kernel.print is provided by the mruby-print mrbgem. '15.3.1.2.10' +# Kernel.print is provided by the mruby-io mrbgem. '15.3.1.2.10' -# Kernel.puts is provided by the mruby-print mrbgem. '15.3.1.2.11' +# Kernel.puts is provided by the mruby-io mrbgem. '15.3.1.2.11' assert('Kernel.raise', '15.3.1.2.12') do assert_raise RuntimeError do @@ -377,11 +377,11 @@ assert('Kernel#object_id', '15.3.1.3.33') do assert_kind_of Numeric, 1.0.object_id end -# Kernel#p is defined in mruby-print mrbgem. '15.3.1.3.34' +# Kernel#p is defined in mruby-io mrbgem. '15.3.1.3.34' -# Kernel#print is defined in mruby-print mrbgem. '15.3.1.3.35' +# Kernel#print is defined in mruby-io mrbgem. '15.3.1.3.35' -# Kernel#puts is defined in mruby-print mrbgem. '15.3.1.3.39' +# Kernel#puts is defined in mruby-io mrbgem. '15.3.1.3.39' assert('Kernel#raise', '15.3.1.3.40') do assert_raise RuntimeError do