daniel_terminal_app 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdce6da17bfe012d9a8e84888b63437cd77338f6f193db6dd9e0b98653139e3b
4
- data.tar.gz: ece729ea43637789e37af1e5e46ddf6ead94506c564a9d9a67cbde29e3fb0224
3
+ metadata.gz: 75fd384c6834c49d341e3ca64ae74d9486979a1af00b10571bc125d5ffff4c3b
4
+ data.tar.gz: 0eb9b86e4265964453052d495cd5a190f46046d0e74867c2ca88ffa75c6dfdf2
5
5
  SHA512:
6
- metadata.gz: 2904345385415a602e108124b5ff4d228fdab70513d348b8819eb79d9fba1abee8c97bc48e1a82bdaa44ddb804fcaaa991366366bee0660afbd5917da0abd03e
7
- data.tar.gz: d4ca2cc74e86174318595a7b8b59fd896abd328db49dc8b014d9a205dd7053ef44efa3d6a2a0987829842d4c6fcd5510c8473ff1502fcf4a7ab912c721d92abb
6
+ metadata.gz: 73fecbac92f92822ceddafb86c5be4673e563acd78d2d5078f4127c738c9d416f20a46943e62585b6142ffe90618c3f8b6097856e0c0ed1c9f8a6f1de9b8260c
7
+ data.tar.gz: b7c2b63ab60feb9b1ed5fa71b5d1c968272844e35b6c7d3fc5ae71e4c0363b030a58fb2182689f5ba39e8acb7bfef3092e73068f8873ce41d582c4b3dd326ebc
data/README.md CHANGED
@@ -30,6 +30,9 @@ Based on the two features above the app will be able to show some travel statist
30
30
 
31
31
  The app is required to have an easy navigable menu system that allows user to easily log in, sign up, search countries or close the app. Once logged in they must be able to add travel entries, search for countries, see their travel statistics, see their travel entries and log out from their account.
32
32
 
33
+ ### 5. ARGV Country Information
34
+
35
+ The app should be able to take an argument from terminal and check if that is a country that exist and quickly show that countries information in terminal. For a better reference check the 'Usage' section below.
33
36
 
34
37
  ## App Outline
35
38
 
@@ -131,6 +134,15 @@ Once in irb enter:
131
134
  This should launch the application and it should be ready to use.
132
135
  To navigate the app all you have to do is used the arrow keys to select menu options and type in input to the terminal when prompted.
133
136
 
137
+ If the app is downloaded from the above github repository the app should be able to be launched from terminal using the below command.
138
+
139
+ ruby daniel_terminal_app.rb
140
+ Using it this way also allows you to pass arguments. This way you can quickly get country information by passing a country name as an argument when executing this code. E.g:
141
+
142
+ ruby daniel_terminal_app.rb sweden
143
+
144
+ The would show the information page for Sweden in the terminal.
145
+
134
146
  ## Testing
135
147
 
136
148
  All testing was done manually but should be automated for future projects. The link below will take you to a google sheet with all the test.
@@ -1 +1 @@
1
- {"login":"Daniel","password":"password","travel_entries":[{"country":"Sweden","region":"Europe","date":"20-20-20"},{"country":"Sweden","region":"Europe","date":"20-20-20"},{"country":"Australia","region":"Oceania","date":"20-20-20"},{"country":"Malaysia","region":"Asia","date":"2020-01-21"},{"country":"Malaysia","region":"Asia","date":"2020-02-20"},{"country":"Russia","region":"Europe","date":"2020-02-20"},{"country":"Spain","region":"Europe","date":"2020-10-06"},{"country":"Spain","region":"Europe","date":"2020-12-20"}]}
1
+ {"login":"Daniel","password":"password","travel_entries":[{"country":"Sweden","region":"Europe","date":"20-20-20"},{"country":"Sweden","region":"Europe","date":"20-20-20"},{"country":"Australia","region":"Oceania","date":"20-20-20"},{"country":"Malaysia","region":"Asia","date":"2020-01-21"},{"country":"Malaysia","region":"Asia","date":"2020-02-20"},{"country":"Russia","region":"Europe","date":"2020-02-20"},{"country":"Spain","region":"Europe","date":"2020-10-06"},{"country":"Spain","region":"Europe","date":"2020-12-20"},{"country":"Italy","region":"Europe","date":"2020-03-14"}]}
@@ -106,7 +106,20 @@ end
106
106
  current_user
107
107
  end
108
108
  end
109
+
110
+ def pre_start
111
+ if ARGV.length > 0
112
+ country = ARGV.map(&:capitalize) * ' '
113
+ if @countries.search_country(country)
114
+ @view.promptCountry(@countries.search_country(country))
115
+ else
116
+ puts "No country by the name: #{country}"
117
+ end
118
+ else
119
+ start
120
+ end
121
+ end
109
122
  end
110
123
 
111
124
  master = Controller.new
112
- master.start
125
+ master.pre_start
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DanielTerminalApp
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daniel_terminal_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - cdask