numb 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.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
- require_relative "numb/#{predicate}"
75
+ require File.join(File.dirname(__FILE__), "numb/#{predicate}")
79
76
  end
80
-
@@ -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).sample(10).each do |number|
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
@@ -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).sample(5).each do |number|
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
@@ -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).sample(10).each do |number|
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
@@ -5,7 +5,7 @@ describe Integer, "#weird?" do
5
5
  16730,16870,17272,17570,17990,18410,18830,18970,
6
6
  19390,19670]
7
7
  it "returns true if the number is weird" do
8
- WEIRD.sample(10).each do |number|
8
+ WEIRD.shuffle.first(10).each do |number|
9
9
  number.should be_weird
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Run Paint Run Run