diff options
author | Marcus Stollsteimer <sto.mar@web.de> | 2019-01-04 00:07:34 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-07-15 00:32:00 +0900 |
commit | 423feb53a20f323d6b7e27e132e68b70b888ffe9 (patch) | |
tree | 369aadf2f3572c31e41e850e47bd7416a6c77925 /lib | |
parent | 4403130193ac895820d9ccc8ec2ab13de37bfea6 (diff) |
[ruby/matrix] Add Matrix::VERSION constant
Add Matrix::VERSION for the gem version, use it in the gemspec,
and make it also available for library users.
https://github.com/ruby/matrix/commit/65c2bb1fa1
Diffstat (limited to 'lib')
-rw-r--r-- | lib/matrix.rb | 2 | ||||
-rw-r--r-- | lib/matrix/matrix.gemspec | 11 | ||||
-rw-r--r-- | lib/matrix/version.rb | 5 |
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/matrix.rb b/lib/matrix.rb index 34602f5c40..b8139b547f 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -14,6 +14,8 @@ require "e2mmap" +require_relative "matrix/version" + module ExceptionForMatrix # :nodoc: extend Exception2MessageMapper def_e2message(TypeError, "wrong argument type %s (expected %s)") diff --git a/lib/matrix/matrix.gemspec b/lib/matrix/matrix.gemspec index c94e8b7cf2..75f6b69a98 100644 --- a/lib/matrix/matrix.gemspec +++ b/lib/matrix/matrix.gemspec @@ -1,8 +1,15 @@ # frozen_string_literal: true +begin + require_relative "lib/matrix/version" +rescue LoadError + # for Ruby core repository + require_relative "version" +end + Gem::Specification.new do |spec| spec.name = "matrix" - spec.version = "0.1.0" + spec.version = Matrix::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/matrix" spec.license = "BSD-2-Clause" - spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/matrix.rb", "lib/matrix/eigenvalue_decomposition.rb", "lib/matrix/lup_decomposition.rb", "matrix.gemspec"] + spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "lib/matrix.rb", "lib/matrix/eigenvalue_decomposition.rb", "lib/matrix/lup_decomposition.rb", "lib/matrix/version.rb", "matrix.gemspec"] spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] diff --git a/lib/matrix/version.rb b/lib/matrix/version.rb new file mode 100644 index 0000000000..f88bf38d96 --- /dev/null +++ b/lib/matrix/version.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class Matrix + VERSION = "0.1.0" +end |