multiarray 0.11.2 → 0.11.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/multiarray.rb +15 -0
- data/lib/multiarray/gcccontext.rb +1 -1
- data/lib/multiarray/rgb.rb +20 -0
- metadata +3 -3
data/Rakefile
CHANGED
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 "
|
139
|
+
raise "The following command failed: #{gcc}" unless system gcc
|
140
140
|
require "#{DIRNAME}/#{@lib_name}"
|
141
141
|
end
|
142
142
|
|
data/lib/multiarray/rgb.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.11.
|
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-
|
17
|
+
date: 2010-10-28 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|