closest_fibonacci 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +13 -17
- data/VERSION +1 -1
- data/closest_fibonacci.gemspec +2 -2
- data/lib/closest_fibonacci.rb +4 -23
- data/test/test_closest_fibonacci.rb +3 -1
- metadata +4 -4
- data/.DS_Store +0 -0
data/README.rdoc
CHANGED
@@ -1,20 +1,16 @@
|
|
1
|
-
= closest_fibonacci
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
where you can set 38 to be any other integer
|
16
|
-
|
17
|
-
enjoy!
|
1
|
+
= closest_fibonacci
|
2
|
+
|
3
|
+
Description goes here.
|
4
|
+
|
5
|
+
== Contributing to closest_fibonacci
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
|
9
|
+
* Fork the project.
|
10
|
+
* Start a feature/bugfix branch.
|
11
|
+
* Commit and push until you are happy with your contribution.
|
12
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
18
14
|
|
19
15
|
== Copyright
|
20
16
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.1.0
|
data/closest_fibonacci.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "closest_fibonacci"
|
8
|
-
s.version = "1.
|
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 = ["Boris Polania"]
|
@@ -17,7 +17,6 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
".DS_Store",
|
21
20
|
".document",
|
22
21
|
"Gemfile",
|
23
22
|
"Gemfile.lock",
|
@@ -25,6 +24,7 @@ Gem::Specification.new do |s|
|
|
25
24
|
"README.rdoc",
|
26
25
|
"Rakefile",
|
27
26
|
"VERSION",
|
27
|
+
"closest_fibonacci-1.1.0.gem",
|
28
28
|
"closest_fibonacci.gemspec",
|
29
29
|
"lib/closest_fibonacci.rb",
|
30
30
|
"test/helper.rb",
|
data/lib/closest_fibonacci.rb
CHANGED
@@ -1,27 +1,8 @@
|
|
1
|
-
|
1
|
+
module SiUnits
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
def closest_fibonacci
|
6
|
-
|
7
|
-
def fibonaccit(n)
|
8
|
-
return n if (0..1).include? n
|
9
|
-
fibonaccit(n-1) + fibonaccit(n-2) if n > 1
|
10
|
-
end
|
11
|
-
|
12
|
-
i = 0
|
13
|
-
|
14
|
-
while fibonaccit(i) < self do
|
15
|
-
|
16
|
-
i = i + 1;
|
17
|
-
|
18
|
-
end
|
19
|
-
|
20
|
-
fibonaccit(i - 1)
|
21
|
-
|
22
|
-
end
|
3
|
+
def kilo; self * 1000; end
|
23
4
|
|
24
5
|
end
|
25
6
|
|
26
|
-
class Float; include
|
27
|
-
class Fixnum; include
|
7
|
+
class Float; include SiUnits; end
|
8
|
+
class Fixnum; include SiUnits; end
|
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 1.0.0
|
10
|
+
version: 1.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Boris Polania
|
@@ -102,7 +102,6 @@ extra_rdoc_files:
|
|
102
102
|
- LICENSE.txt
|
103
103
|
- README.rdoc
|
104
104
|
files:
|
105
|
-
- .DS_Store
|
106
105
|
- .document
|
107
106
|
- Gemfile
|
108
107
|
- Gemfile.lock
|
@@ -110,6 +109,7 @@ files:
|
|
110
109
|
- README.rdoc
|
111
110
|
- Rakefile
|
112
111
|
- VERSION
|
112
|
+
- closest_fibonacci-1.1.0.gem
|
113
113
|
- closest_fibonacci.gemspec
|
114
114
|
- lib/closest_fibonacci.rb
|
115
115
|
- test/helper.rb
|
data/.DS_Store
DELETED
Binary file
|