Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 58f6baac9cd31a17e7bca2fc4c2168f7822a8c1e 1 parent 2ccfda2
John Woods authored August 17, 2012
10  Rakefile
@@ -19,6 +19,16 @@ Rake::ExtensionTask.new do |ext|
19 19
     ext.source_pattern = "**/*.{c,cpp, h}" 
20 20
 end
21 21
 
  22
+gemspec = eval(IO.read("nmatrix.gemspec"))
  23
+
  24
+require "rake/gempackagetask"
  25
+Rake::GemPackageTask.new(gemspec).define
  26
+
  27
+desc "install the gem locally"
  28
+task :install => [:package] do
  29
+  sh %{gem install pkg/nmatrix-#{NMatrix::VERSION}}
  30
+end
  31
+
22 32
 require 'rspec/core/rake_task'
23 33
 require 'rspec/core'
24 34
 require 'rspec/core/rake_task'
18  lib/nmatrix/monkeys.rb
@@ -50,14 +50,18 @@ def to_nm(shape, dtype = nil, stype = :dense)
50 50
 	
51 51
 		if stype != :dense then matrix.cast(stype, dtype) else matrix end
52 52
 	end
53  
-	
54  
-	def max
55  
-		self.inject(self.first) { |m, n| if n < m then n else m end }
56  
-	end
57 53
 
58  
-	def min
59  
-		self.inject(self.first) { |m, n| if n > m then n else m end }
60  
-	end
  54
+  unless method_defined?(:max)
  55
+    def max
  56
+      self.inject(self.first) { |m, n| if n > m then n else m end }
  57
+    end
  58
+  end
  59
+
  60
+  unless method_defined?(:min)
  61
+    def min
  62
+      self.inject(self.first) { |m, n| if n < m then n else m end }
  63
+    end
  64
+  end
61 65
 end
62 66
 
63 67
 class Object
2  lib/nmatrix/version.rb
@@ -22,6 +22,6 @@
22 22
 #
23 23
 
24 24
 class NMatrix
25  
-  VERSION = '0.0.1'
  25
+  VERSION = '0.0.2'
26 26
 end
27 27
 

0 notes on commit 58f6baa

Please sign in to comment.
Something went wrong with that request. Please try again.