numb 0.3.3 → 0.3.4
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/VERSION +1 -1
- data/lib/numb.rb +1 -5
- data/spec/achilles_spec.rb +1 -1
- data/spec/hyperperfect_spec.rb +1 -1
- data/spec/powerful_spec.rb +1 -1
- data/spec/weird_spec.rb +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
data/lib/numb.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
require 'rubygems'
|
4
|
-
require 'backports'
|
5
|
-
|
6
3
|
libs = %w{abundant achilles automorphic carol deficient dihedral_prime dudeney
|
7
4
|
economical emrip equidigital extravagant factorion frugal happy
|
8
5
|
harshad hilbert hyperperfect impolite kaprekar keith kynea mms_pair mobius
|
@@ -75,6 +72,5 @@ rescue LoadError
|
|
75
72
|
end
|
76
73
|
|
77
74
|
libs.each do |predicate|
|
78
|
-
|
75
|
+
require File.join(File.dirname(__FILE__), "numb/#{predicate}")
|
79
76
|
end
|
80
|
-
|
data/spec/achilles_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Integer, "achilles?" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "returns false for non-Achilles numbers" do
|
14
|
-
((1..5487).to_a - ACHILLES).
|
14
|
+
((1..5487).to_a - ACHILLES).shuffle.first(10).each do |number|
|
15
15
|
number.should_not be_achilles
|
16
16
|
end
|
17
17
|
end
|
data/spec/hyperperfect_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe Integer, "#hyperperfect?" do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "returns false for a non-1-hyperperfect (non-perfect) number" do
|
16
|
-
((1..2000).to_a - PERFECT).
|
16
|
+
((1..2000).to_a - PERFECT).shuffle.first(5).each do |number|
|
17
17
|
number.should_not be_hyperperfect
|
18
18
|
end
|
19
19
|
end
|
data/spec/powerful_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Integer, "#powerful?" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "returns false for a non-powerful number" do
|
14
|
-
((1..999).to_a - POWERFUL).
|
14
|
+
((1..999).to_a - POWERFUL).shuffle.first(10).each do |number|
|
15
15
|
number.should_not be_powerful
|
16
16
|
end
|
17
17
|
end
|
data/spec/weird_spec.rb
CHANGED