closest-fibonacci-gem 1.0.4 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = closest-fibonacci-gem
2
2
 
3
- Description goes here.
3
+ Finds the closest fibonacci that is smaller than the given number. For example 156.closest_fibonacci returns 144.
4
4
 
5
5
  == Contributing to closest-fibonacci-gem
6
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.4
1
+ 1.1.0
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{closest-fibonacci-gem}
8
- s.version = "1.0.4"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ramprasad Ramachandran"]
@@ -1,5 +1,5 @@
1
1
  class Fixnum
2
- def findClosestFibonacci
2
+ def closest_fibonacci
3
3
  if self < 0
4
4
  return "Provide a positive integer or 0"
5
5
  end
@@ -3,15 +3,15 @@ require 'helper'
3
3
  class TestClosestFibonacciGem < Test::Unit::TestCase
4
4
  context "a fibonacci" do
5
5
  should "return 144 for 156 as input" do
6
- assert_equal 144, 156.findClosestFibonacci
6
+ assert_equal 144, 156.closest_fibonacci
7
7
  end
8
8
 
9
9
  should "return 89 for 99 as input" do
10
- assert_equal 89, 99.findClosestFibonacci
10
+ assert_equal 89, 99.closest_fibonacci
11
11
  end
12
12
  should "not a positive integer" do
13
13
  num = -10
14
- assert_equal "Provide a positive integer or 0", -10.findClosestFibonacci
14
+ assert_equal "Provide a positive integer or 0", -10.closest_fibonacci
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closest-fibonacci-gem
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
+ - 1
8
9
  - 0
9
- - 4
10
- version: 1.0.4
10
+ version: 1.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ramprasad Ramachandran