infinity 0.0.4 → 0.0.5

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/infinity.gemspec +1 -1
  3. data/lib/infinity.rb +5 -0
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.4
1
+ 0.0.5
data/infinity.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{infinity}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Bretoi"]
data/lib/infinity.rb CHANGED
@@ -7,6 +7,8 @@ class Infinity
7
7
  self
8
8
  end
9
9
  def /(obj)
10
+ return 1 if obj == Infinity
11
+ return 1 if obj.kind_of? Infinity
10
12
  self
11
13
  end
12
14
  def *(obj)
@@ -41,6 +43,9 @@ class TC_Infinity < Test::Unit::TestCase
41
43
  assert_equal(Infinity, (Infinity - 23))
42
44
  assert_equal(Infinity, (Infinity / 23))
43
45
  assert_equal(Infinity, (Infinity * 23))
46
+ assert_equal(1, (Infinity / Infinity))
47
+ assert_equal(1, (Infinity.new / Infinity))
48
+ assert_equal(1, (Infinity.new / Infinity.new))
44
49
  end
45
50
 
46
51
  def test_comparable
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infinity
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Bretoi