Added Etc::VERSION
This commit is contained in:
parent
612b7b6224
commit
1d2ec4b216
@ -52,6 +52,8 @@ char *getenv();
|
|||||||
#endif
|
#endif
|
||||||
char *getlogin();
|
char *getlogin();
|
||||||
|
|
||||||
|
#define RUBY_ETC_VERSION "1.0.1"
|
||||||
|
|
||||||
#include "constdefs.h"
|
#include "constdefs.h"
|
||||||
|
|
||||||
/* call-seq:
|
/* call-seq:
|
||||||
@ -1062,6 +1064,7 @@ Init_etc(void)
|
|||||||
VALUE mEtc;
|
VALUE mEtc;
|
||||||
|
|
||||||
mEtc = rb_define_module("Etc");
|
mEtc = rb_define_module("Etc");
|
||||||
|
rb_define_const(mEtc, "VERSION", rb_str_new_cstr(RUBY_ETC_VERSION));
|
||||||
init_constants(mEtc);
|
init_constants(mEtc);
|
||||||
|
|
||||||
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
|
rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
|
||||||
|
@ -1,8 +1,19 @@
|
|||||||
# frozen_string_literal: true
|
# 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|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "etc"
|
spec.name = "etc"
|
||||||
spec.version = "1.0.1"
|
spec.version = version
|
||||||
spec.authors = ["Yukihiro Matsumoto"]
|
spec.authors = ["Yukihiro Matsumoto"]
|
||||||
spec.email = ["matz@ruby-lang.org"]
|
spec.email = ["matz@ruby-lang.org"]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user