mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[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
This commit is contained in:
parent
4403130193
commit
423feb53a2
3 changed files with 16 additions and 2 deletions
|
@ -14,6 +14,8 @@
|
|||
|
||||
require "e2mmap"
|
||||
|
||||
require_relative "matrix/version"
|
||||
|
||||
module ExceptionForMatrix # :nodoc:
|
||||
extend Exception2MessageMapper
|
||||
def_e2message(TypeError, "wrong argument type %s (expected %s)")
|
||||
|
|
|
@ -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"]
|
||||
|
|
5
lib/matrix/version.rb
Normal file
5
lib/matrix/version.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Matrix
|
||||
VERSION = "0.1.0"
|
||||
end
|
Loading…
Add table
Reference in a new issue