multiarray 0.11.2 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/packagetask'
6
6
  require 'rbconfig'
7
7
 
8
8
  PKG_NAME = 'multiarray'
9
- PKG_VERSION = '0.11.2'
9
+ PKG_VERSION = '0.11.3'
10
10
  RB_FILES = FileList[ 'lib/**/*.rb' ]
11
11
  TC_FILES = FileList[ 'test/tc_*.rb' ]
12
12
  TS_FILES = FileList[ 'test/ts_*.rb' ]
data/lib/multiarray.rb CHANGED
@@ -378,6 +378,21 @@ class Fixnum
378
378
 
379
379
  alias_method_chain :>>, :hornetseye, :shr
380
380
 
381
+ if method_defined? :rpower
382
+
383
+ def power_with_hornetseye( other )
384
+ if other.is_a? Hornetseye::Node
385
+ x, y = other.coerce self
386
+ x ** y
387
+ else
388
+ power_without_hornetseye other
389
+ end
390
+ end
391
+
392
+ alias_method_chain :**, :hornetseye, :power
393
+
394
+ end
395
+
381
396
  end
382
397
 
383
398
  # +Range+ is extended with a few methods
@@ -136,7 +136,7 @@ EOS
136
136
  gcc = "#{LDSHARED} #{CFLAGS} -o #{DIRNAME}/#{@lib_name}.#{DLEXT} " +
137
137
  "#{DIRNAME}/#{@lib_name}.c #{LIBRUBYARG}"
138
138
  # puts template
139
- raise "Error compiling #{DIRNAME}/#{@lib_name}.c" unless system gcc
139
+ raise "The following command failed: #{gcc}" unless system gcc
140
140
  require "#{DIRNAME}/#{@lib_name}"
141
141
  end
142
142
 
@@ -703,3 +703,23 @@ module Hornetseye
703
703
  module_function :DFLOATRGB
704
704
 
705
705
  end
706
+
707
+ class Fixnum
708
+
709
+ if method_defined? :rpower
710
+
711
+ def power_with_rgb( other )
712
+ if other.is_a? Hornetseye::RGB
713
+ x, y = other.coerce self
714
+ x ** y
715
+ else
716
+ power_without_rgb other
717
+ end
718
+ end
719
+
720
+ alias_method_chain :**, :rgb, :power
721
+
722
+ end
723
+
724
+ end
725
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 11
8
- - 2
9
- version: 0.11.2
8
+ - 3
9
+ version: 0.11.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan Wedekind
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-27 00:00:00 +01:00
17
+ date: 2010-10-28 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency