worldfactbook 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.rdoc +9 -1
  2. data/VERSION +1 -1
  3. data/lib/worldfactbook/cli.rb +22 -24
  4. metadata +3 -5
  5. data/TODO +0 -7
@@ -2,7 +2,15 @@
2
2
 
3
3
  Worldfactbook fetches data on countries for you from the {CIA World Factbook}[https://www.cia.gov/library/publications/the-world-factbook/index.html].
4
4
 
5
- $ sudo gem install worldfactbook
5
+ To install:
6
+
7
+ $ sudo gem install worldfactbook
8
+
9
+ Or in Bundler:
10
+
11
+ gem "worldfactbook"
12
+
13
+ Note: Worldfactbook requires {Nokogiri}[http://nokogiri.org] as a dependency. If you encounter any issues with this gem, it's likely because of the libraries that need to be configured or updated for using Nokogiri. Please refer to its {installation guide}[http://nokogiri.org/tutorials/installing_nokogiri.html] for help.
6
14
 
7
15
  = Usage
8
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -6,13 +6,11 @@ module Worldfactbook
6
6
  query = arguments.join(" ").strip
7
7
  if !['help', 'countries'].include?(query)
8
8
  begin
9
- @country = query
10
- Country.new(query)
9
+ @country = Country.new(query)
11
10
  rescue Worldfactbook::NoCountryAvailable
12
11
  @data = arguments.pop
13
12
  query = arguments.join(" ").strip
14
- @country = query
15
- Country.new(query)
13
+ @country = Country.new(query)
16
14
  end
17
15
  end
18
16
  end
@@ -34,31 +32,31 @@ module Worldfactbook
34
32
  @stdout.puts
35
33
  @stdout.puts CountryCode.new('xx').list
36
34
  elsif @data
37
- @stdout.puts Country.new(@country).send(@data)
35
+ @stdout.puts @country.send(@data)
38
36
  @stdout.puts
39
37
  elsif @country
40
- @stdout.puts "Location: #{Country.new(@country).location}"
41
- @stdout.puts "Major Cities: #{Country.new(@country).major_cities}"
42
- @stdout.puts "Independence: #{Country.new(@country).independence}"
38
+ @stdout.puts "Location: #{@country.location}"
39
+ @stdout.puts "Major Cities: #{@country.major_cities}"
40
+ @stdout.puts "Independence: #{@country.independence}"
43
41
  @stdout.puts
44
- @stdout.puts "Population: #{Country.new(@country).population}"
45
- @stdout.puts "Languages: #{Country.new(@country).languages}"
46
- @stdout.puts "Ethnic Groups: #{Country.new(@country).ethnic_groups}"
47
- @stdout.puts "Religions: #{Country.new(@country).religions}"
48
- @stdout.puts "Age Structure: #{Country.new(@country).age_structure}"
49
- @stdout.puts "Literacy: #{Country.new(@country).literacy}"
42
+ @stdout.puts "Population: #{@country.population}"
43
+ @stdout.puts "Languages: #{@country.languages}"
44
+ @stdout.puts "Ethnic Groups: #{@country.ethnic_groups}"
45
+ @stdout.puts "Religions: #{@country.religions}"
46
+ @stdout.puts "Age Structure: #{@country.age_structure}"
47
+ @stdout.puts "Literacy: #{@country.literacy}"
50
48
  @stdout.puts
51
- @stdout.puts "GDP: #{Country.new(@country).gdp}"
52
- @stdout.puts "GDP (PPP): #{Country.new(@country).gdp_ppp}"
53
- @stdout.puts "GDP growth: #{Country.new(@country).gdp_growth}"
54
- @stdout.puts "GDP sectors: #{Country.new(@country).gdp_sectors}"
55
- @stdout.puts "Debt: #{Country.new(@country).debt}"
56
- @stdout.puts "Unemployment: #{Country.new(@country).unemployment}"
57
- @stdout.puts "Inflation: #{Country.new(@country).inflation}"
49
+ @stdout.puts "GDP: #{@country.gdp}"
50
+ @stdout.puts "GDP (PPP): #{@country.gdp_ppp}"
51
+ @stdout.puts "GDP growth: #{@country.gdp_growth}"
52
+ @stdout.puts "GDP sectors: #{@country.gdp_sectors}"
53
+ @stdout.puts "Debt: #{@country.debt}"
54
+ @stdout.puts "Unemployment: #{@country.unemployment}"
55
+ @stdout.puts "Inflation: #{@country.inflation}"
58
56
  @stdout.puts
59
- @stdout.puts "Telephone Users: #{Country.new(@country).telephones}"
60
- @stdout.puts "Mobile Phone Users: #{Country.new(@country).cellphones}"
61
- @stdout.puts "Internet Users: #{Country.new(@country).internet_users}"
57
+ @stdout.puts "Telephone Users: #{@country.telephones}"
58
+ @stdout.puts "Mobile Phone Users: #{@country.cellphones}"
59
+ @stdout.puts "Internet Users: #{@country.internet_users}"
62
60
  @stdout.puts
63
61
  end
64
62
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: worldfactbook
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.0
5
+ version: 0.0.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sayem Islam
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-14 00:00:00 Z
13
+ date: 2011-08-02 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -130,13 +130,11 @@ extensions: []
130
130
 
131
131
  extra_rdoc_files:
132
132
  - README.rdoc
133
- - TODO
134
133
  files:
135
134
  - Gemfile
136
135
  - Gemfile.lock
137
136
  - README.rdoc
138
137
  - Rakefile
139
- - TODO
140
138
  - VERSION
141
139
  - bin/worldfactbook
142
140
  - lib/worldfactbook.rb
@@ -156,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
154
  requirements:
157
155
  - - ">="
158
156
  - !ruby/object:Gem::Version
159
- hash: -1046849416912465840
157
+ hash: -2847378457398933172
160
158
  segments:
161
159
  - 0
162
160
  version: "0"
data/TODO DELETED
@@ -1,7 +0,0 @@
1
-
2
- - cli tests
3
-
4
-
5
- - release gem and publish it
6
-
7
-