daniel_terminal_app 0.1.3 → 0.1.4

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: 1b720c1b926979ba1da67eaa2de6a63cf290fdd3285054e3a7995aea457e4c57
4
- data.tar.gz: 7c620c19307b0d65dd42c03bddf30313fe0b0f0e4c49623f205cb399355931ad
3
+ metadata.gz: cdce6da17bfe012d9a8e84888b63437cd77338f6f193db6dd9e0b98653139e3b
4
+ data.tar.gz: ece729ea43637789e37af1e5e46ddf6ead94506c564a9d9a67cbde29e3fb0224
5
5
  SHA512:
6
- metadata.gz: 6ef4f810e472514ce2ffec4d74f352f7cda1d639113d1688ec35dac9ff6e72609a5f1832fe44e3358e556a36a768067e9f97990440822aaa616853f1bf5efc05
7
- data.tar.gz: 29cf2ad11d0f93aeb3693903bf04955ec3e542639b32582f5abc57b74ba54cb80059d511a4d3225bf4e988ed3a0d1d24c7c7f70bae4765144a3b7aee48bc1139
6
+ metadata.gz: 2904345385415a602e108124b5ff4d228fdab70513d348b8819eb79d9fba1abee8c97bc48e1a82bdaa44ddb804fcaaa991366366bee0660afbd5917da0abd03e
7
+ data.tar.gz: d4ca2cc74e86174318595a7b8b59fd896abd328db49dc8b014d9a205dd7053ef44efa3d6a2a0987829842d4c6fcd5510c8473ff1502fcf4a7ab912c721d92abb
data/Daniel.json ADDED
@@ -0,0 +1 @@
1
+ {"login":"Daniel","password":"password","travel_entries":[{"country":"Italy","region":"Europe","date":"2020-03-14"}]}
data/README.md CHANGED
@@ -1,88 +1,146 @@
1
- # DanielTerminalApp
1
+ # Travel Terminal App
2
+
3
+ ## Source
4
+
5
+ https://github.com/cDask/daniel_terminal_app
6
+
7
+ ## Project Objective and Scope
8
+
9
+ This app will allow users to track the countries they visited by making log entries about countries they've visited as well be able to provide some basic information about the countries of the world. It will allow users to create and read travel entries they've made. The data should be persistant betweeen sessions of the app.
10
+
11
+ This app should mainly be used as a basic organisational tool that should allow people to store travel entries as well as track some basic travel statistics. It can also be used as a quick reference, allowing users to look up country information.
12
+
13
+ As a big traveller myself I'm creating this app so that I can easily look up how many countries I've visited and keep track of how many countries I still have left to see in different continents. The target audience would be anyone willing to use this app but mainly for those who are interested in travelling as well as statistics. The terminal app will work directly from the terminal where output and input are handled directly through the terminal.
14
+
15
+ ## Feature Set
16
+
17
+ ### 1. Users
18
+
19
+ The app will need to distinguish between different users making sure that each user having their own independant personal list of travel entries. All users will require a username and a password although password will be placeholder and use no encryption or security. All of this data must be persistant meaning it will be saved between sessions of the app. The way this will be implemented is through the use of JSON files.
20
+
21
+ ### 2. Countries information
22
+
23
+ The app should hold a database of most countries in a persistant JSON file. The app will read this data and be able to display it in a nice legible format. Some important data that will be included are country name, capital, currency, phone extension and region/continent.
24
+
25
+ ### 3. User statistics
26
+
27
+ Based on the two features above the app will be able to show some travel statistics of the each user. The main statistic will be the number of unique countries they visited in the world and the number of unique countries they visited in each region.
2
28
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/daniel_terminal_app`. To experiment with that code, run `bin/console` for an interactive prompt.
29
+ ### 4. Menu system
4
30
 
5
- TODO: Delete this and the text above, and describe your gem
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
+
33
+
34
+ ## App Outline
35
+
36
+ The way users will find out how to use the app should be pretty intuitive. To install the app they should refer to this README file and follow the instructions below under the 'Installation Heading'. Once in the app, prompts and small instructions will be provided that hopefully should be sufficiently self explanatory to guide the user through the menus and features.
37
+
38
+ Inputs and user interaction with be handled by the tty-prompt. Most inputs will be typed into terminal and then submitted through the use of the return key. All menu will be navigated through the use of the arrow keys and then the return key to use that feature.
39
+
40
+ All errors or incorrect inputs will prompt the user with an error message and then returning them to a previous menu or in certain cases ask them to enter a new valid input.
41
+
42
+ ## Implementation Plan
43
+
44
+ To organise my implementation tasks I used trello. Below is a screenshot of my trello part way through the project. To see the final board I've added the Trello link below.
45
+
46
+ ![Trello board](./trelloboard.png)
47
+
48
+ Trello board link:
49
+ https://trello.com/b/p1XRA23m/travel-terminal-app
50
+
51
+ ## UML Diagram
52
+
53
+ ![UML Diagram](./travel-terminal-app.png)
6
54
 
7
55
  ## Installation
8
56
 
9
- Add this line to your application's Gemfile:
57
+ ### Linux
58
+
59
+ #### Git
10
60
 
11
- ```ruby
12
- gem 'daniel_terminal_app'
13
- ```
61
+ First you will need to install git.
14
62
 
15
- And then execute:
63
+ Follow [this guide](https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04) to install git.
16
64
 
17
- $ bundle install
65
+ There are some configurations that we need to perform before going further as well.
18
66
 
19
- Or install it yourself as:
67
+ Run the following commands in terminal
20
68
 
21
- $ gem install daniel_terminal_app
69
+ git config --global color.us true
22
70
 
23
- ## Usage
71
+ git config --global user.name "YOUR NAME"
24
72
 
25
- TODO: Write usage instructions here
73
+ Replace YOUR NAME with your actual name
26
74
 
27
- ## Development
75
+ git config --global user.email "YOUR@EMAIL.com"
28
76
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
77
+ Replace YOUR@EMAIL.com with your actual email address
30
78
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
79
+ You only need to do this configuration once.
32
80
 
33
- ## Contributing
81
+ #### rbenv
34
82
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/daniel_terminal_app.
83
+ Follow [this guide](https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04) to install rbenv.
36
84
 
37
- # Travel Terminal App
85
+ Please only follow the guide up to the end of Step 1.
38
86
 
39
- ## Source
87
+ #### Ruby
40
88
 
41
- https://github.com/cDask/daniel_terminal_app
89
+ rbenv install 2.7.0
42
90
 
43
- ## Project Objective and Scope
91
+ This will install a version of Ruby on your local machine.
44
92
 
45
- This app will allow users to track the countries they visited and make journal entries about their experiences as well as be able to provide some basic information about the countries. It will allow users to create, read, update and delete travel entries as well as country entries. The data should be persistant so as to able to save data between sessions. This app will be a basic organisational app that should allow people to store travel entries as well as track some basic travel statistics. As a big traveller myself I'm creating this app so that I can easily look up how many countries I've visited and keep track how many countries I still have left to see in different continents. The target audience would be anyone willing to use this app but mainly for those who are interested in travelling as well as statistics. The terminal app will work directly from the terminal where output and input and handled directly through the terminal.
93
+ To actually use 2.7.0 globally on your machine you need to run:
46
94
 
47
- ## Feature Set
95
+ rbenv global 2.7.0
48
96
 
49
- ### User
97
+ Run the following command in terminal:
50
98
 
51
- The app will need to distinguish between different users each user having their own personal list of travel entries. All users will require a username and a password although password will be placeholder and use no encryption. All of this data must be persistant meaning it will be saved between sessions of the app. The way this will be implemented is through the use of JSON files.
99
+ ruby --version
52
100
 
53
- ### Countries info
101
+ If you see 2.7.0 you’re good to go.
54
102
 
55
- The app should hold a database of most countries in a persistant JSON file. The app will read this data and be able to display it in a nice legible format. Some must have data will be country name, capital, currency, phone extension and region/countinent.
103
+ ### Mac/Linux Gem Installation
56
104
 
57
- ### User statistics
105
+ Now that you have Git, rbenv and ruby set up you can run ruby gems.
58
106
 
59
- Based on the two features above the app will be able to show some travel statistics of the each user. The main statistic will be the number of unique countries they visited in the world and the number of unique countries they visited in each region.
107
+ Add this line to your application's Gemfile:
108
+
109
+ ```ruby
110
+ gem 'daniel_terminal_app'
111
+ ```
60
112
 
61
- ### Menu system
113
+ And then execute:
62
114
 
63
- The app is required to have an easy navigable menu system 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.
115
+ $ bundle install
64
116
 
65
- ## App Outline
117
+ Or install it yourself as:
66
118
 
67
- The way users will find out how to use the app should be pretty intuitive. To install the app they should refer to this README file and follow the instructions below under the 'Install Instructions Heading'. Once in the app, prompts and small instructions will be provided that hopefully should be sufficiently self explanatory to guide the user through the menus and features.
119
+ $ gem install daniel_terminal_app
68
120
 
69
- Inputs and user interaction with be handled by the tty-prompt. Most inputs will be typed into terminal and then submitted through the use of the return key. All menu will be navigated through the use of the arrow keys and then the return key to use that feature.
121
+ ## Usage
70
122
 
71
- All errors or incorrect inputs will prompt the user with an error message and then returning them to a previous menu or in certain cases ask them to enter a new valid input.
123
+ To run the gem you need to open irb.
72
124
 
73
- ## Implementation Plan
125
+ $ irb
74
126
 
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.
127
+ Once in irb enter:
76
128
 
77
- ![Trello board](./trelloboard.png)
129
+ irb(main):001:0>require 'daniel_terminal_app'
78
130
 
131
+ This should launch the application and it should be ready to use.
132
+ 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.
79
133
 
134
+ ## Testing
80
135
 
81
- ## UML Diagram
136
+ 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.
82
137
 
83
- ![UML Diagram](./travel-terminal-app.png)
138
+ https://docs.google.com/spreadsheets/d/1ZtUioG1ANQXNkF1SdVhGrC1zhpo2_VRq6Gf6T3W1p3s/edit?usp=sharing
139
+
140
+ ## Contributing
141
+
142
+ Bug reports and pull requests are welcome on GitHub at https://github.com/cDask/daniel_terminal_app.
84
143
 
85
- ## Install Instruction
86
144
 
87
145
 
88
146
 
data/lib/Countries.rb CHANGED
@@ -6,7 +6,7 @@ class Countries
6
6
  attr_accessor :countries
7
7
 
8
8
  def initialize
9
- @root = File.expand_path('..', __FILE__)
9
+ @root = File.expand_path(__dir__)
10
10
  jsondata_temp = File.read(@root + '/countries.json')
11
11
  @countries = JSON.parse(jsondata_temp)
12
12
  end
@@ -18,11 +18,6 @@ class Countries
18
18
  nil
19
19
  end
20
20
 
21
- def save_data
22
- jsondata = @countries.to_json
23
- File.write(@root + '/countries.json', jsondata)
24
- end
25
-
26
21
  def make_shortlist(key1, key2)
27
22
  short_list = []
28
23
  @countries.each do |index|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DanielTerminalApp
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
data/trelloboard.png ADDED
Binary file
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - cdask
@@ -90,6 +90,7 @@ files:
90
90
  - ".gitignore"
91
91
  - ".rspec"
92
92
  - ".travis.yml"
93
+ - Daniel.json
93
94
  - Gemfile
94
95
  - Gemfile.lock
95
96
  - README.md
@@ -107,6 +108,7 @@ files:
107
108
  - lib/daniel_terminal_app/version.rb
108
109
  - lib/susu.json
109
110
  - travel-terminal-app.png
111
+ - trelloboard.png
110
112
  homepage: https://github.com/cDask/daniel_terminal_app
111
113
  licenses: []
112
114
  metadata: {}