mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00
[ruby/io-console] Define IO::ConsoleMode::VERSION from gemspec
ebdbebf461
This commit is contained in:
parent
5309e3c406
commit
f08400a07a
2 changed files with 7 additions and 0 deletions
|
@ -1672,6 +1672,7 @@ InitVM_console(void)
|
||||||
{
|
{
|
||||||
/* :stopdoc: */
|
/* :stopdoc: */
|
||||||
cConmode = rb_define_class_under(rb_cIO, "ConsoleMode", rb_cObject);
|
cConmode = rb_define_class_under(rb_cIO, "ConsoleMode", rb_cObject);
|
||||||
|
rb_define_const(cConmode, "VERSION", rb_str_new_cstr(STRINGIZE(IO_CONSOLE_VERSION)));
|
||||||
rb_define_alloc_func(cConmode, conmode_alloc);
|
rb_define_alloc_func(cConmode, conmode_alloc);
|
||||||
rb_undef_method(cConmode, "initialize");
|
rb_undef_method(cConmode, "initialize");
|
||||||
rb_define_method(cConmode, "initialize_copy", conmode_init_copy, 1);
|
rb_define_method(cConmode, "initialize_copy", conmode_init_copy, 1);
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
|
version = ["../../..", "."].find do |dir|
|
||||||
|
break File.read(File.join(__dir__, dir, "io-console.gemspec"))[/^_VERSION\s*=\s*"(.*?)"/, 1]
|
||||||
|
rescue
|
||||||
|
end
|
||||||
|
|
||||||
have_func("rb_io_path")
|
have_func("rb_io_path")
|
||||||
have_func("rb_io_descriptor")
|
have_func("rb_io_descriptor")
|
||||||
have_func("rb_io_get_write_io")
|
have_func("rb_io_get_write_io")
|
||||||
|
@ -35,6 +40,7 @@ when true
|
||||||
elsif have_func("rb_scheduler_timeout") # 3.0
|
elsif have_func("rb_scheduler_timeout") # 3.0
|
||||||
have_func("rb_io_wait")
|
have_func("rb_io_wait")
|
||||||
end
|
end
|
||||||
|
$defs << "-D""IO_CONSOLE_VERSION=#{version}"
|
||||||
create_makefile("io/console") {|conf|
|
create_makefile("io/console") {|conf|
|
||||||
conf << "\n""VK_HEADER = #{vk_header}\n"
|
conf << "\n""VK_HEADER = #{vk_header}\n"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue