countries_cli 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e4fe91fa1cc1758dd9f5b65556abd1f33d98598
4
- data.tar.gz: a3324a90bdd6b57b933aa9e063b21d3f2b91d636
3
+ metadata.gz: ad65c0c12ebcc7c6124678bf7b15f8da54fbe880
4
+ data.tar.gz: 91dff111be7d365d021643e10e73ad7b044e701d
5
5
  SHA512:
6
- metadata.gz: 65c06e1f51f62f5def5f7a9672ba88557f68baa6b123d18af094803fb3eced80293b0613e121ff866eb90174a35e965462019276560f63c69b11c2a023db91bd
7
- data.tar.gz: 426c9b77df96057edf66b65ba3c36188c37d698f42183a5e3a7a32a646741c6534fd3f184b558fa3d039d946420d42ccfffdb33707623d4aa8acea08a186cf74
6
+ metadata.gz: aab3f8c680143aebe51c2fd4a9818f24cc62549b9f00b6e83fc70b554e051815207a49d56374c3c514965256a8688913f5fa0f8ed256a054edfb9e6f5a123c2e
7
+ data.tar.gz: f16879391fa6d8d75196a19d956050e4b283e6b7aa5d469d35fb874938d8c1e6107b1f278b0e09b21271df7bb1925154f794aa85e8171c8e92e2525afcd7efe1
data/Country.gemspec CHANGED
@@ -1,11 +1,11 @@
1
1
 
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "Country/version"
4
+ require "countries_cli/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "countries_cli"
8
- spec.version = Country::VERSION
8
+ spec.version = CountriesCli::VERSION
9
9
  spec.authors = ["Kenneth Young Castro"]
10
10
  spec.email = ["kenneth.young90@gmail.com"]
11
11
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- countries_cli (0.1.3)
4
+ countries_cli (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,84 +4,50 @@ A CLI of countries based on the REST Countries API. It allows you to look for in
4
4
 
5
5
  ## Getting Started
6
6
 
7
- These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
7
+ These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
8
8
 
9
9
  ### Prerequisites
10
10
 
11
- What things you need to install the software and how to install them
11
+ You will need to have bundler installed. To install, go to your terminal and run:
12
12
 
13
13
  ```
14
- Give examples
14
+ gem install bundler
15
15
  ```
16
16
 
17
17
  ### Installing
18
18
 
19
- A step by step series of examples that tell you how to get a development env running
20
-
21
- Say what the step will be
19
+ To install, go to your terminal and run:
22
20
 
23
21
  ```
24
- Give the example
22
+ gem install countries_cli
25
23
  ```
26
24
 
27
- And repeat
25
+ And then:
28
26
 
29
27
  ```
30
- until finished
28
+ country
31
29
  ```
32
30
 
33
- End with an example of getting some data out of the system or using it for a little demo
34
-
35
- ## Running the tests
36
-
37
- Explain how to run the automated tests for this system
31
+ Now you should be seeing a menu similar to this:
38
32
 
39
- ### Break down into end to end tests
33
+ ![countries_cli menu](https://i.imgur.com/NA7eqEr.png)
40
34
 
41
- Explain what these tests test and why
42
-
43
- ```
44
- Give an example
45
- ```
46
-
47
- ### And coding style tests
48
-
49
- Explain what these tests test and why
50
-
51
- ```
52
- Give an example
53
- ```
54
-
55
- ## Deployment
56
-
57
- Add additional notes about how to deploy this on a live system
58
-
59
- ## Built With
60
-
61
- * [Dropwizard](http://www.dropwizard.io/1.0.2/docs/) - The web framework used
62
- * [Maven](https://maven.apache.org/) - Dependency Management
63
- * [ROME](https://rometools.github.io/rome/) - Used to generate RSS Feeds
35
+ Happy Searching! =)
64
36
 
65
37
  ## Contributing
66
38
 
67
- Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
68
-
69
- ## Versioning
70
-
71
- We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).
39
+ Please feel free to contribute :)
72
40
 
73
41
  ## Authors
74
42
 
75
- * **Billie Thompson** - *Initial work* - [PurpleBooth](https://github.com/PurpleBooth)
43
+ * **Kenneth Young Castro** - *Initial work* - [kyoung90](https://github.com/kyoung90)
76
44
 
77
- See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.
45
+ See also the list of [contributors](https://github.com/kyoung90/country/graphs/contributors) who participated in this project.
78
46
 
79
47
  ## License
80
48
 
81
49
  This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
82
50
 
83
- ## Acknowledgments
51
+ ## Link
84
52
 
85
- * Hat tip to anyone whose code was used
86
- * Inspiration
87
- * etc
53
+ * [RubyGem countries_cli](https://rubygems.org/gems/countries_cli)
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "Country"
4
+ require "countries_cli"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/bin/country CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "Country"
4
+ require "countries_cli"
5
5
 
6
- controller = Country::CLI.new
6
+ controller = CountriesCli::CLI.new
7
7
  controller.call
@@ -0,0 +1,9 @@
1
+ require_relative "./countries_cli/version"
2
+ require_relative "./countries_cli/cli"
3
+ require_relative "./countries_cli/country"
4
+ require "open-uri"
5
+ require "json"
6
+
7
+ module CountriesCli
8
+
9
+ end
@@ -2,7 +2,7 @@ require_relative 'country'
2
2
  require 'open-uri'
3
3
  require 'json'
4
4
  # CLI Controller
5
- class Country::CLI
5
+ class CountriesCli::CLI
6
6
 
7
7
  def initialize()
8
8
  # Get all countries from API in JSON format
@@ -10,7 +10,7 @@ class Country::CLI
10
10
  countries = JSON.parse(page.read)
11
11
  # Parse JSON to objects
12
12
  countries.each do |country|
13
- Country::COUNTRY.new(country)
13
+ CountriesCli::COUNTRY.new(country)
14
14
  end
15
15
  end
16
16
 
@@ -69,13 +69,13 @@ class Country::CLI
69
69
  end
70
70
 
71
71
  def list_all_country_names
72
- Country::COUNTRY.all_country_names
72
+ CountriesCli::COUNTRY.all_country_names
73
73
  end
74
74
 
75
75
  def search_by_name
76
76
  puts "Please enter the name: "
77
77
  input = gets.chomp
78
- country = Country::COUNTRY.search_by_name(input)
78
+ country = CountriesCli::COUNTRY.search_by_name(input)
79
79
  if country
80
80
  country.info
81
81
  puts "\n"
@@ -87,7 +87,7 @@ class Country::CLI
87
87
  def search_by_suffix
88
88
  puts "Please enter the suffix: "
89
89
  input = gets.chomp
90
- country = Country::COUNTRY.search_by_suffix(input)
90
+ country = CountriesCli::COUNTRY.search_by_suffix(input)
91
91
  if country
92
92
  country.info
93
93
  puts "\n"
@@ -99,7 +99,7 @@ class Country::CLI
99
99
  def search_by_currency_symbol
100
100
  puts "Please enter the currency symbol: "
101
101
  input = gets.chomp
102
- countries = Country::COUNTRY.search_all_with_currency_symbol(input)
102
+ countries = CountriesCli::COUNTRY.search_all_with_currency_symbol(input)
103
103
  if countries.count > 0
104
104
  countries.each do |country|
105
105
  country.info
@@ -113,7 +113,7 @@ class Country::CLI
113
113
  def search_by_currency_name
114
114
  puts "Please enter the currency name: "
115
115
  input = gets.chomp
116
- countries = Country::COUNTRY.search_all_with_currency_name(input)
116
+ countries = CountriesCli::COUNTRY.search_all_with_currency_name(input)
117
117
  if countries.count > 0
118
118
  countries.each do |country|
119
119
  country.info
@@ -127,7 +127,7 @@ class Country::CLI
127
127
  def search_by_language
128
128
  puts "Please enter a language: "
129
129
  input = gets.chomp
130
- countries = Country::COUNTRY.search_all_with_language(input)
130
+ countries = CountriesCli::COUNTRY.search_all_with_language(input)
131
131
  if countries.count > 0
132
132
  countries.each do |country|
133
133
  country.info
@@ -145,7 +145,7 @@ class Country::CLI
145
145
  if input.downcase == "l" || input.downcase == "lower" || input.downcase == "g" || input.downcase == "greater" || input.downcase == "h" || input.downcase == "higher"
146
146
  puts "Enter population (ex: 10000): "
147
147
  population = gets.chomp.to_i
148
- countries = Country::COUNTRY.search_all_with_population(input, population)
148
+ countries = CountriesCli::COUNTRY.search_all_with_population(input, population)
149
149
  if countries.count > 0
150
150
  countries.each do |country|
151
151
  country.info
@@ -164,13 +164,13 @@ class Country::CLI
164
164
  puts "Ascending(a) or descending(d)?"
165
165
  input = gets.chomp
166
166
  if input == "d"
167
- countries_sorted = Country::COUNTRY.all.sort{|country1, country2| country2.population <=> country1.population}
167
+ countries_sorted = CountriesCli::COUNTRY.all.sort{|country1, country2| country2.population <=> country1.population}
168
168
  countries_sorted.each do |country|
169
169
  country.info
170
170
  puts "\n"
171
171
  end
172
172
  elsif input == "a"
173
- countries_sorted = Country::COUNTRY.all.sort{|country1, country2| country1.population <=> country2.population}
173
+ countries_sorted = CountriesCli::COUNTRY.all.sort{|country1, country2| country1.population <=> country2.population}
174
174
  countries_sorted.each do |country|
175
175
  country.info
176
176
  puts "\n"
@@ -184,7 +184,7 @@ class Country::CLI
184
184
  def search_by_capital
185
185
  puts "Please enter the capital: "
186
186
  input = gets.chomp
187
- country = Country::COUNTRY.search_by_capital(input)
187
+ country = CountriesCli::COUNTRY.search_by_capital(input)
188
188
  if country
189
189
  country.info
190
190
  puts "\n"
@@ -196,7 +196,7 @@ class Country::CLI
196
196
  def search_by_region
197
197
  puts "Please enter the region: "
198
198
  input = gets.chomp
199
- countries = Country::COUNTRY.search_by_region(input)
199
+ countries = CountriesCli::COUNTRY.search_by_region(input)
200
200
  if countries.count > 0
201
201
  countries.each do |country|
202
202
  country.info
@@ -210,7 +210,7 @@ class Country::CLI
210
210
  def search_by_subregion
211
211
  puts "Please enter the subregion: "
212
212
  input = gets.chomp
213
- countries = Country::COUNTRY.search_by_subregion(input)
213
+ countries = CountriesCli::COUNTRY.search_by_subregion(input)
214
214
  if countries.count > 0
215
215
  countries.each do |country|
216
216
  country.info
@@ -1,4 +1,4 @@
1
- class Country::COUNTRY
1
+ class CountriesCli::COUNTRY
2
2
 
3
3
  attr_accessor :name, :currencies, :languages, :flag, :population, :capital, :region, :subregion
4
4
 
@@ -0,0 +1,3 @@
1
+ module CountriesCli
2
+ VERSION = "0.1.4"
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: countries_cli
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
  - Kenneth Young Castro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-06 00:00:00.000000000 Z
11
+ date: 2019-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -88,10 +88,10 @@ files:
88
88
  - bin/console
89
89
  - bin/country
90
90
  - bin/setup
91
- - lib/Country.rb
92
- - lib/Country/cli.rb
93
- - lib/Country/country.rb
94
- - lib/Country/version.rb
91
+ - lib/countries_cli.rb
92
+ - lib/countries_cli/cli.rb
93
+ - lib/countries_cli/country.rb
94
+ - lib/countries_cli/version.rb
95
95
  homepage: https://github.com/kyoung90/country
96
96
  licenses:
97
97
  - MIT
data/lib/Country.rb DELETED
@@ -1,9 +0,0 @@
1
- require_relative "./Country/version"
2
- require_relative "./Country/cli"
3
- require_relative "./Country/country"
4
- require "open-uri"
5
- require "json"
6
-
7
- module Country
8
-
9
- end
@@ -1,3 +0,0 @@
1
- module Country
2
- VERSION = "0.1.3"
3
- end