Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Version bump, and for some reason Array#min and Array#max were switched.

  • Loading branch information...
commit 58f6baac9cd31a17e7bca2fc4c2168f7822a8c1e 1 parent 2ccfda2
@mohawkjohn authored
Showing with 22 additions and 8 deletions.
  1. +10 −0 Rakefile
  2. +11 −7 lib/nmatrix/monkeys.rb
  3. +1 −1  lib/nmatrix/version.rb
View
10 Rakefile
@@ -19,6 +19,16 @@ Rake::ExtensionTask.new do |ext|
ext.source_pattern = "**/*.{c,cpp, h}"
end
+gemspec = eval(IO.read("nmatrix.gemspec"))
+
+require "rake/gempackagetask"
+Rake::GemPackageTask.new(gemspec).define
+
+desc "install the gem locally"
+task :install => [:package] do
+ sh %{gem install pkg/nmatrix-#{NMatrix::VERSION}}
+end
+
require 'rspec/core/rake_task'
require 'rspec/core'
require 'rspec/core/rake_task'
View
18 lib/nmatrix/monkeys.rb
@@ -50,14 +50,18 @@ def to_nm(shape, dtype = nil, stype = :dense)
if stype != :dense then matrix.cast(stype, dtype) else matrix end
end
-
- def max
- self.inject(self.first) { |m, n| if n < m then n else m end }
- end
- def min
- self.inject(self.first) { |m, n| if n > m then n else m end }
- end
+ unless method_defined?(:max)
+ def max
+ self.inject(self.first) { |m, n| if n > m then n else m end }
+ end
+ end
+
+ unless method_defined?(:min)
+ def min
+ self.inject(self.first) { |m, n| if n < m then n else m end }
+ end
+ end
end
class Object
View
2  lib/nmatrix/version.rb
@@ -22,6 +22,6 @@
#
class NMatrix
- VERSION = '0.0.1'
+ VERSION = '0.0.2'
end
Please sign in to comment.
Something went wrong with that request. Please try again.