integer 0.1.5 → 0.1.6

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/integer.gemspec +2 -2
  3. data/lib/integer.rb +2 -2
  4. metadata +4 -4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{integer}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mary Wong"]
12
- s.date = %q{2011-08-11}
12
+ s.date = %q{2011-08-12}
13
13
  s.description = %q{Adds to Integer the method 'closest_fibonacci' which returns the largest fibonacci number that is less than or equal to the integer.}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -1,11 +1,11 @@
1
1
  module Fibonacci
2
2
  def closest_fibonacci
3
-
4
3
  raise "method 'closest_fibonacci' is not available for negative integers" if self < 0
5
4
 
6
5
  sequence = [0, 1]
7
- sequence << sequence[sequence.size-2] + sequence.last while sequence.last <= self
6
+ return self if sequence.include? self
8
7
 
8
+ sequence << sequence[sequence.size-2] + sequence.last while sequence.last <= self
9
9
  sequence[sequence.size-2]
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: integer
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mary Wong
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-11 00:00:00 -07:00
18
+ date: 2011-08-12 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency