summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2019-12-22 19:40:32 -0500
committerMarc-Andre Lafortune <github@marc-andre.ca>2019-12-22 21:48:54 -0500
commit9be3295d53b6fd9f8a3ad8157aa0655b1976d8ac (patch)
treec024d37fc2b0fecef1aed982174f20155c9d76d9 /lib
parent49d94248ebfb7a51e342f8102d21ad132a40f91a (diff)
[ruby/ostruct] Create OpenStruct::VERSION
Diffstat (limited to 'lib')
-rw-r--r--lib/ostruct.rb3
-rw-r--r--lib/ostruct/ostruct.gemspec11
-rw-r--r--lib/ostruct/version.rb5
3 files changed, 17 insertions, 2 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 4d1f0ce4de..c40c897ff6 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -72,6 +72,9 @@
# the objects that are created, as there is much more overhead in the setting
# of these properties compared to using a Hash or a Struct.
#
+
+require_relative 'ostruct/version'
+
class OpenStruct
#
diff --git a/lib/ostruct/ostruct.gemspec b/lib/ostruct/ostruct.gemspec
index 4faf5b84aa..4f8507045e 100644
--- a/lib/ostruct/ostruct.gemspec
+++ b/lib/ostruct/ostruct.gemspec
@@ -1,8 +1,15 @@
# frozen_string_literal: true
+begin
+ require_relative "lib/ostruct/version"
+rescue LoadError
+ # for Ruby core repository
+ require_relative "version"
+end
+
Gem::Specification.new do |spec|
spec.name = "ostruct"
- spec.version = "0.1.0"
+ spec.version = OpenStruct::VERSION
spec.authors = ["Marc-Andre Lafortune"]
spec.email = ["ruby-core@marc-andre.ca"]
@@ -11,7 +18,7 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/ruby/ostruct"
spec.license = "BSD-2-Clause"
- spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/ostruct.rb", "ostruct.gemspec"]
+ spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/ostruct.rb", "lib/ostruct/version.rb", "ostruct.gemspec"]
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
diff --git a/lib/ostruct/version.rb b/lib/ostruct/version.rb
new file mode 100644
index 0000000000..4e26af9909
--- /dev/null
+++ b/lib/ostruct/version.rb
@@ -0,0 +1,5 @@
+# frozen_string_literal: true
+
+class OpenStruct
+ VERSION = "0.1.0"
+end