daniel_terminal_app 0.1.2 → 0.1.3
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/README.md +6 -1
- data/lib/Countries.rb +3 -2
- data/lib/Daniel.json +1 -1
- data/lib/View.rb +1 -2
- data/lib/daniel_terminal_app.rb +0 -2
- data/lib/daniel_terminal_app/version.rb +1 -1
- metadata +1 -2
- data/lib/experiment.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b720c1b926979ba1da67eaa2de6a63cf290fdd3285054e3a7995aea457e4c57
|
4
|
+
data.tar.gz: 7c620c19307b0d65dd42c03bddf30313fe0b0f0e4c49623f205cb399355931ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ef4f810e472514ce2ffec4d74f352f7cda1d639113d1688ec35dac9ff6e72609a5f1832fe44e3358e556a36a768067e9f97990440822aaa616853f1bf5efc05
|
7
|
+
data.tar.gz: 29cf2ad11d0f93aeb3693903bf04955ec3e542639b32582f5abc57b74ba54cb80059d511a4d3225bf4e988ed3a0d1d24c7c7f70bae4765144a3b7aee48bc1139
|
data/README.md
CHANGED
@@ -72,7 +72,12 @@ All errors or incorrect inputs will prompt the user with an error message and th
|
|
72
72
|
|
73
73
|
## Implementation Plan
|
74
74
|
|
75
|
-
Below
|
75
|
+
To organise my implementation tasks I used trello. Below is a screenshot of my trello part way through project. To see the final board I've added the Trello link below.
|
76
|
+
|
77
|
+

|
78
|
+
|
79
|
+
|
80
|
+
|
76
81
|
## UML Diagram
|
77
82
|
|
78
83
|

|
data/lib/Countries.rb
CHANGED
@@ -6,7 +6,8 @@ class Countries
|
|
6
6
|
attr_accessor :countries
|
7
7
|
|
8
8
|
def initialize
|
9
|
-
|
9
|
+
@root = File.expand_path('..', __FILE__)
|
10
|
+
jsondata_temp = File.read(@root + '/countries.json')
|
10
11
|
@countries = JSON.parse(jsondata_temp)
|
11
12
|
end
|
12
13
|
|
@@ -19,7 +20,7 @@ class Countries
|
|
19
20
|
|
20
21
|
def save_data
|
21
22
|
jsondata = @countries.to_json
|
22
|
-
File.write('countries.json', jsondata)
|
23
|
+
File.write(@root + '/countries.json', jsondata)
|
23
24
|
end
|
24
25
|
|
25
26
|
def make_shortlist(key1, key2)
|
data/lib/Daniel.json
CHANGED
@@ -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"}]}
|
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"}]}
|
data/lib/View.rb
CHANGED
@@ -44,7 +44,7 @@ class View
|
|
44
44
|
|
45
45
|
line
|
46
46
|
|
47
|
-
puts @pastel.bold.underline.
|
47
|
+
puts @pastel.bold.underline.on_yellow('General Information')
|
48
48
|
general_table = TTY::Table.new header: [@pastel.bold('Language'), @pastel.bold('Web Suffix'), @pastel.bold('International Dialing'), @pastel.bold('Independence')], rows: [[hash['languages'][lang_code], hash['tld'][0], hash['idd'].values[0] + hash['idd'].values[1][0].to_s, hash['independent'].to_s]]
|
49
49
|
puts general_table.render(:unicode)
|
50
50
|
|
@@ -90,7 +90,6 @@ class View
|
|
90
90
|
q.modify :strip
|
91
91
|
q.modify :capitalize
|
92
92
|
end
|
93
|
-
puts search
|
94
93
|
search
|
95
94
|
end
|
96
95
|
|
data/lib/daniel_terminal_app.rb
CHANGED
@@ -66,8 +66,6 @@ class Controller
|
|
66
66
|
|
67
67
|
user_uni_travel = current_user.travel_entries.map { |p| { 'country' => p['country'], 'region' => p['region'] } }.uniq
|
68
68
|
|
69
|
-
pp user_uni_travel
|
70
|
-
|
71
69
|
unique_regions = new_short_list.map { |p| p['region'] }.uniq
|
72
70
|
|
73
71
|
@view.show_stat(user_uni_travel.length, new_short_list.length, 'The World')
|
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
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cdask
|
@@ -105,7 +105,6 @@ files:
|
|
105
105
|
- lib/countries.json
|
106
106
|
- lib/daniel_terminal_app.rb
|
107
107
|
- lib/daniel_terminal_app/version.rb
|
108
|
-
- lib/experiment.rb
|
109
108
|
- lib/susu.json
|
110
109
|
- travel-terminal-app.png
|
111
110
|
homepage: https://github.com/cDask/daniel_terminal_app
|
data/lib/experiment.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'json'
|
4
|
-
|
5
|
-
jsondata_temp = File.read('countries.json')
|
6
|
-
countries = JSON.parse(jsondata_temp)
|
7
|
-
|
8
|
-
# pp countries[1]["flag"]
|
9
|
-
jsondata = countries.to_json
|
10
|
-
File.write('countries.json', jsondata)
|
11
|
-
hash = {}
|
12
|
-
puts hash.class.class
|
13
|
-
|
14
|
-
# do
|