1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Added StringIO::VERSION

This commit is contained in:
Nobuyoshi Nakada 2019-07-10 01:21:05 +09:00
parent 49cad67635
commit db844749af
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 14 additions and 1 deletions

View file

@ -11,6 +11,8 @@
**********************************************************************/
#define STRINGIO_VERSION "0.0.2"
#include "ruby.h"
#include "ruby/io.h"
#include "ruby/encoding.h"
@ -1629,6 +1631,8 @@ Init_stringio(void)
#undef rb_intern
VALUE StringIO = rb_define_class("StringIO", rb_cData);
rb_define_const(StringIO, "VERSION", rb_str_new_cstr(STRINGIO_VERSION));
rb_include_module(StringIO, rb_mEnumerable);
rb_define_alloc_func(StringIO, strio_s_allocate);
rb_define_singleton_method(StringIO, "new", strio_s_new, -1);

View file

@ -3,9 +3,18 @@
# stub: stringio 0.0.0 ruby lib
# stub: extconf.rb
source_version = ["", "ext/stringio/"].find do |dir|
begin
File.open(File.join(__dir__, "#{dir}stringio.c")) {|f|
f.gets("\n#define STRINGIO_VERSION ")
f.gets[/\s*(".+")/, 1].undump
}
rescue Errno::ENOENT
end
end
Gem::Specification.new do |s|
s.name = "stringio".freeze
s.version = "0.0.2"
s.version = source_version
s.required_rubygems_version = Gem::Requirement.new(">= 2.6".freeze)
s.require_paths = ["lib".freeze]