fruit-info 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/lib/cli.rb +5 -3
- data/lib/fruit.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 744ebaa3799876ecdb42b6c00b147686d51770b27e1dadf8dbe008a621d2ae51
|
4
|
+
data.tar.gz: 45fb8f15a9552f0c263f88139a1aa8984d6f87f9dd195f1ddfb1f30db0ab7027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2908d889c5806b92e90c2cb66f51e181fd2f53820bbe86dbc26408a553da35bb9a5df809bae46962866ecb68d640fde3065fc9ef2cf369a87bb3cf3378ae0fa7
|
7
|
+
data.tar.gz: 7a198dab4b93d2e3921c7d62527997f39ed3b9f1fdbde2012b28ec8bf09a7620562988461368d56eaaee53016923069c0bf993797032fe951c56404cb4d1b2fc
|
data/lib/cli.rb
CHANGED
@@ -7,19 +7,21 @@ module FruitInfo
|
|
7
7
|
FruityviceAPI.new.make_fruits
|
8
8
|
puts 'Welcome to fruit!'
|
9
9
|
input = nil
|
10
|
-
while input != 'q'
|
10
|
+
while input != 'q' || input != 'exit'
|
11
11
|
puts 'Press ' + 'a'.red + ' to see all fruit'
|
12
12
|
puts 'Press ' + 's'.yellow + ' to see all fruit listed with their scientific names'
|
13
13
|
puts 'Press ' + 'n'.light_yellow + ' to see all fruit listed with their nutrional information'
|
14
14
|
puts 'Press ' + 'm'.green + ' to see the fruits with most nutrition'
|
15
15
|
puts 'Press ' + 'l'.cyan + ' to see the fruits with least nutrition'
|
16
16
|
puts 'Type the ' + 'name of a fruit '.blue + 'to see all of its information'
|
17
|
-
puts 'Press ' + 'q'.magenta + " to quit\n"
|
17
|
+
puts 'Press ' + 'q'.magenta + " or type " + 'exit'.magenta + " to quit\n"
|
18
18
|
print 'What would you like to do: '
|
19
19
|
input = gets.strip.downcase
|
20
20
|
case input
|
21
21
|
when 'q'
|
22
22
|
return
|
23
|
+
when 'exit'
|
24
|
+
return
|
23
25
|
when 'a'
|
24
26
|
display_all_fruit
|
25
27
|
when 's'
|
@@ -109,4 +111,4 @@ module FruitInfo
|
|
109
111
|
puts ''
|
110
112
|
end
|
111
113
|
end
|
112
|
-
end
|
114
|
+
end
|
data/lib/fruit.rb
CHANGED
@@ -49,6 +49,8 @@ module FruitInfo
|
|
49
49
|
self.color = :red
|
50
50
|
when 'Watermelon'
|
51
51
|
self.color = :light_green
|
52
|
+
when 'Guava'
|
53
|
+
self.color = :light_green
|
52
54
|
else
|
53
55
|
self.color = :white
|
54
56
|
end
|
@@ -62,4 +64,4 @@ module FruitInfo
|
|
62
64
|
fruits.each { |fruit| new(fruit) }
|
63
65
|
end
|
64
66
|
end
|
65
|
-
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fruit-info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Grasse-Haroldsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|