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

Added Etc::VERSION

This commit is contained in:
Nobuyoshi Nakada 2019-07-10 12:33:29 +09:00
parent 612b7b6224
commit 1d2ec4b216
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60
2 changed files with 15 additions and 1 deletions

View file

@ -52,6 +52,8 @@ char *getenv();
#endif
char *getlogin();
#define RUBY_ETC_VERSION "1.0.1"
#include "constdefs.h"
/* call-seq:
@ -1062,6 +1064,7 @@ Init_etc(void)
VALUE mEtc;
mEtc = rb_define_module("Etc");
rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
init_constants(mEtc);
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);

View file

@ -1,8 +1,19 @@
# frozen_string_literal: true
version = ["", "ext/etc/"].find do |dir|
begin
break File.open(File.expand_path("../#{dir}/etc.c", __FILE__)) do |f|
f.gets "\n#define RUBY_ETC_VERSION "
f.gets[/"(.+)"/, 1]
end
rescue
next
end
end
Gem::Specification.new do |spec|
spec.name = "etc"
spec.version = "1.0.1"
spec.version = version
spec.authors = ["Yukihiro Matsumoto"]
spec.email = ["matz@ruby-lang.org"]