mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 20:44:20 +00:00
[ruby/readline-ext] Expose Readline::GEM_VERSION
https://github.com/ruby/readline-ext/commit/70aa84b80e
This commit is contained in:
parent
283c190374
commit
3733ee835b
@ -1,6 +1,16 @@
|
||||
source_version = ["", "ext/readline/"].find do |dir|
|
||||
begin
|
||||
break File.open(File.join(__dir__, "#{dir}readline.c")) {|f|
|
||||
f.gets("\n#define READLINE_VERSION ")
|
||||
f.gets[/\s*"(.+)"/, 1]
|
||||
}
|
||||
rescue Errno::ENOENT
|
||||
end
|
||||
end
|
||||
|
||||
Gem::Specification.new do |spec|
|
||||
spec.name = "readline-ext"
|
||||
spec.version = "0.1.5"
|
||||
spec.version = source_version
|
||||
spec.authors = ["Yukihiro Matsumoto"]
|
||||
spec.email = ["matz@ruby-lang.org"]
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
|
||||
************************************************/
|
||||
|
||||
#define READLINE_VERSION "0.1.5"
|
||||
|
||||
#ifdef RUBY_EXTCONF_H
|
||||
#include RUBY_EXTCONF_H
|
||||
#endif
|
||||
@ -2119,6 +2121,8 @@ Init_readline(void)
|
||||
/* Version string of GNU Readline or libedit. */
|
||||
rb_define_const(mReadline, "VERSION", version);
|
||||
|
||||
rb_define_const(mReadline, "GEM_VERSION", rb_str_new_cstr(READLINE_VERSION));
|
||||
|
||||
rl_attempted_completion_function = readline_attempted_completion_function;
|
||||
#if defined(HAVE_RL_PRE_INPUT_HOOK)
|
||||
rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user