closest_fibonacci 1.2.9 → 1.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/.DS_Store CHANGED
Binary file
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.9
1
+ 1.2.10
data/bin/.DS_Store ADDED
Binary file
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'closest_fibonacci'
4
+
5
+ module Fibonacci
6
+
7
+ def closest_fibonacci
8
+
9
+ def fibonaccit(n)
10
+ return n if (0..1).include? n
11
+ fibonaccit(n-1) + fibonaccit(n-2) if n > 1
12
+ end
13
+
14
+ i = 0
15
+
16
+ while fibonaccit(i) < self do
17
+
18
+ i = i + 1;
19
+
20
+ end
21
+
22
+ fibonaccit(i - 1)
23
+
24
+ end
25
+
26
+ end
27
+
28
+ class Float; include fibonacci; end
29
+ class Fixnum; include fibonacci; end
@@ -5,13 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "closest_fibonacci"
8
- s.version = "1.2.9"
8
+ s.version = "1.2.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Boris Polania"]
12
12
  s.date = "2012-01-25"
13
13
  s.description = "Fibonacci gem for ModCloth"
14
14
  s.email = "boris.polania@gmail.com"
15
+ s.executables = [".DS_Store", "closest_fibonacci"]
15
16
  s.extra_rdoc_files = [
16
17
  "LICENSE.txt",
17
18
  "README.rdoc"
@@ -25,6 +26,8 @@ Gem::Specification.new do |s|
25
26
  "README.rdoc",
26
27
  "Rakefile",
27
28
  "VERSION",
29
+ "bin/.DS_Store",
30
+ "bin/closest_fibonacci",
28
31
  "closest_fibonacci.gemspec",
29
32
  "lib/closest_fibonacci.rb",
30
33
  "test/helper.rb",
@@ -1,3 +1,5 @@
1
+ require 'closest_fibonacci'
2
+
1
3
  module Fibonacci
2
4
 
3
5
  def closest_fibonacci
@@ -15,7 +17,7 @@ module Fibonacci
15
17
 
16
18
  end
17
19
 
18
- fib(i - 1)
20
+ fibonaccit(i - 1)
19
21
 
20
22
  end
21
23
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closest_fibonacci
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 9
10
- version: 1.2.9
9
+ - 10
10
+ version: 1.2.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Boris Polania
@@ -94,8 +94,9 @@ dependencies:
94
94
  requirement: *id005
95
95
  description: Fibonacci gem for ModCloth
96
96
  email: boris.polania@gmail.com
97
- executables: []
98
-
97
+ executables:
98
+ - .DS_Store
99
+ - closest_fibonacci
99
100
  extensions: []
100
101
 
101
102
  extra_rdoc_files:
@@ -110,6 +111,8 @@ files:
110
111
  - README.rdoc
111
112
  - Rakefile
112
113
  - VERSION
114
+ - bin/.DS_Store
115
+ - bin/closest_fibonacci
113
116
  - closest_fibonacci.gemspec
114
117
  - lib/closest_fibonacci.rb
115
118
  - test/helper.rb