fruit-info 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cli.rb +5 -3
  3. data/lib/fruit.rb +3 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14edf24625be9c5f471ad5c2907fe315348685673588542129172bebbc91c580
4
- data.tar.gz: 9cee80fba89a37300a887dfcd716a019116e99ee0ee735662830998abf0bca81
3
+ metadata.gz: 744ebaa3799876ecdb42b6c00b147686d51770b27e1dadf8dbe008a621d2ae51
4
+ data.tar.gz: 45fb8f15a9552f0c263f88139a1aa8984d6f87f9dd195f1ddfb1f30db0ab7027
5
5
  SHA512:
6
- metadata.gz: 51dbca0c566aaf8c7cd72e14694be6af09a03323bc72d89362cb149952a5b869c4af742d95f4e00621dd93886d68e074f56dcd7bcba878f1b4cdcb24d7ea9d8f
7
- data.tar.gz: 86278e51c80ad788dc46414e0a19d9af951b7083c37a096dea2f4022ae8c360a8ac0d7cae343e12793474b40ba9048d175824518d1582fb88ce8f454ed8536cf
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
@@ -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.6
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: 2020-12-26 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize