bored-wikipedia-explorer 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/command_line_interface.rb +10 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf79c1ca3b3092734ef5b9a8cebad458513ee39687d63055ac631bfb9f25be58
4
- data.tar.gz: 5fc96f3106247e29568087ab1698bd49d72cccef58764e9b74458a90f74f1e37
3
+ metadata.gz: 8abae75c9b526cc285211951c1c71b83d919866ef61fecdd986ece5a55ac3dce
4
+ data.tar.gz: 87d80cdee14d85ffc0bb9adceca1e8637add4e0cef8f52d6bda420c025fb010c
5
5
  SHA512:
6
- metadata.gz: 9d5f2b16b680aae2139dd4715846c00fddf8d4dca5b0ee1b1a9d7acc192d58dab35e27ce7d675876cf3d23596267e11c33fbec02f8cefbfbd45a05b8a8892f55
7
- data.tar.gz: 416000b632164d4f5589519a441ebcfe1301517d8dde0afbe0e6f3127859275b74321ba25cb0fcff1f53c25ca976e5211c0b3fff2eb8e64fc2068c1fd891f763
6
+ metadata.gz: 8fbdacb4ad72dc60c3b20535e04df1e4d168eba373847bee7c7c62cccfbf1ac074228fb0321518d934661bd829780c0832aeccee905f429e85fa1edb2fb30fb8
7
+ data.tar.gz: 9de8ca8c93f90cdfff76c0fc2161aaa03c0cea801a76616db8c65eecb8cf7365c14fbe1befdf02a45661fd230347c5fd242e9e5f2620d1167b02b8684b227a3b
@@ -6,11 +6,13 @@ class CommandLineInterface
6
6
  def self.run
7
7
  puts "Welcome to Did-You-Know Wikipedia Edition!"
8
8
  puts "Please select a topic to be given a random Wikipedia Portal to read:"
9
+ generate_topic_list
10
+ display_all_topics #Displays all available main topics
9
11
  get_inputs #starts cli flow
10
12
  end
11
13
 
12
14
  def self.get_inputs
13
- display_all_topics #Displays all available main topics
15
+ display_all_topics
14
16
  puts "Select a number to explore that topic"
15
17
  get_choice #gets users main topic choice
16
18
  get_rand_url #gets random sub-topic and creates Portal objects
@@ -20,10 +22,15 @@ class CommandLineInterface
20
22
  #beautifies and lists the command line options
21
23
  def self.display_all_topics
22
24
  colors = [:red, :green, :yellow, :blue, :magenta, :cyan, :red, :green, :yellow, :blue, :magenta]
25
+ @list.each_with_index{|item,indx|
26
+ puts "#{indx + 1}. #{item}".colorize(colors[indx])
27
+ }
28
+ end
29
+
30
+ def self.generate_topic_list
23
31
  @list = []
24
- Topic.all_topics_list.each_with_index{|item, indx|
32
+ Topic.all_topics_list.each{|item|
25
33
  @list << item
26
- puts "#{indx + 1}. #{item}".colorize(colors[indx])
27
34
  }
28
35
  end
29
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bored-wikipedia-explorer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Brinson