daniel_terminal_app 0.1.4 → 0.1.5
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 +12 -0
- data/lib/Daniel.json +1 -1
- data/lib/daniel_terminal_app.rb +14 -1
- data/lib/daniel_terminal_app/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 75fd384c6834c49d341e3ca64ae74d9486979a1af00b10571bc125d5ffff4c3b
         | 
| 4 | 
            +
              data.tar.gz: 0eb9b86e4265964453052d495cd5a190f46046d0e74867c2ca88ffa75c6dfdf2
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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.
         | 
    
        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"},{"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"}]}
         | 
    
        data/lib/daniel_terminal_app.rb
    CHANGED
    
    | @@ -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. | 
| 125 | 
            +
            master.pre_start
         |