diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-29 00:31:52 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-07-30 19:03:18 +0900 |
commit | b2d96abb42abbe2e01f010ffc9ac51f0f9a50002 (patch) | |
tree | 57791da8a71280c335109916376e13f5e0c63af3 /lib/ostruct.rb | |
parent | cfbae7dae052180e5dde05a27948ae8d779eccab (diff) |
Extract version number from the source
"requiring version.rb" strategy has some issues.
- cannot work when cross-compiling
- often introduces wrong namespace
- must know the superclasses
- costs at each runtime than at build-time
etc.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3375
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r-- | lib/ostruct.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb index a151fc0bed..e062fbdc9c 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -9,8 +9,6 @@ # See OpenStruct for an example. # -require_relative 'ostruct/version' - # # An OpenStruct is a data structure, similar to a Hash, that allows the # definition of arbitrary attributes with their accompanying values. This is @@ -75,6 +73,7 @@ require_relative 'ostruct/version' # of these properties compared to using a Hash or a Struct. # class OpenStruct + VERSION = "0.2.0" # # Creates a new OpenStruct object. By default, the resulting OpenStruct |