restcountry 0.5.1 → 0.5.2

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
  SHA1:
3
- metadata.gz: 5356b9b16f76595d98f00b88a723a84bcb416792
4
- data.tar.gz: 7c86617050474ccdbc6f690132cbe68f234bf26c
3
+ metadata.gz: 0772e628d7e33207c1cfd7342b4e68a39ea85768
4
+ data.tar.gz: fabef54668f31e8473624fde5ab80b3b15de7202
5
5
  SHA512:
6
- metadata.gz: f1999adb2f28754a4fd021fb2cdddbfbbb7de26ea79b9048831a8abc92244cd35c9d7af1cd057b676bc2b55f80e9ebf2636d1a540c56e73e104c2b2fbccd9bed
7
- data.tar.gz: 337ceca0968d2ebb0db0fec0078a03bb6356c6ba601eab73ac0565b7a9fdf5649705fd97ddae1b2be419622196cbf2074ce247974ec12bfc60c6a09d1a2e89ab
6
+ metadata.gz: 815261d29b8a01fb33b892ca7c07a12e09373e7504c598dd18f807a004824e9c259383dffe1c8c4100b71e4f83ef2f77e05bce4b4da45abf635113940c0e413d
7
+ data.tar.gz: 11e634be63f78605b7239d1d7bb1e0196901639610bf1052d809ef091c52c714612aa109e6dedf563caf2c808f8dc532770c05363e2890d22bfc66d4e8ec5180
@@ -53,7 +53,7 @@ module Restcountry
53
53
  end
54
54
 
55
55
  def self.find(name, fulltext = false)
56
- countries = get_response('name', name + "?fullText=#{fulltext.to_s}")
56
+ countries = get_response('name', name + "?fullText=#{fulltext}")
57
57
  new(countries.first) unless countries.empty?
58
58
  end
59
59
 
@@ -100,14 +100,14 @@ module Restcountry
100
100
  countries = get_response('all')
101
101
  countries.map { |attributes| new(attributes) }
102
102
  end
103
-
103
+
104
104
  private
105
105
 
106
106
  private_class_method
107
107
  def self.get_response(api, action = nil)
108
108
  url = URI.parse(URI.encode("#{API_URL}#{api ? '/' + api : ''}/#{action}"))
109
109
  response = Faraday.get(url)
110
- return response.success? ? JSON.parse(response.body) : []
110
+ response.success? ? JSON.parse(response.body) : []
111
111
  end
112
112
  end
113
113
  end
@@ -1,3 +1,3 @@
1
1
  module Restcountry
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -35,6 +35,13 @@ describe Restcountry do
35
35
  end
36
36
  end
37
37
 
38
+ it 'get capital London from country United Kingdom' do
39
+ VCR.use_cassette 'find' do
40
+ country = Restcountry::Country.find('United Kingdom')
41
+ expect(country.capital).to eq('London')
42
+ end
43
+ end
44
+
38
45
  it 'get region Europe from country Ukraine' do
39
46
  VCR.use_cassette 'find' do
40
47
  country = Restcountry::Country.find('Ukraine')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restcountry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Santangelo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-06 00:00:00.000000000 Z
11
+ date: 2015-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler