postcode_gem 0.2.2 → 0.2.7

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
  SHA256:
3
- metadata.gz: bc14cf37268efe4318eebfcfe4f6ee883286d9daa0ece5ae640d0e077f429ecb
4
- data.tar.gz: 5b36dd891be6aff56afa4f7dae1bc8f00f7cc508726b8b9395e964b4e3c83678
3
+ metadata.gz: 1eab1e7cd2da8739aede700bd989d6b722ed7dd3ffbd070c037e47d2e978d92f
4
+ data.tar.gz: fde152bc2fd49d7879ebe9848ff5fd01022a692bd69b41f061c8ba8ebc10bf4d
5
5
  SHA512:
6
- metadata.gz: aa6d689f6c730cd32b6d2cec2d8835a4cb97c0cfdd8aa14da0fdf30f9ab3d0836d3b145f6157a547f8631ad1f2820b00fe72bb947febd6afb224d12640b4126d
7
- data.tar.gz: ab0540fe6ae211f3ad00b981b332ed611310ba878c482822a819d0b9e321bfd189831c0ae4a1f9dfc1594b174937520e8804fe7d59f45045bf551d9251c9077f
6
+ metadata.gz: 6137797d35904ee9b500d83f9829719cb33db82f363afc3f1e96b1d25441a0100ce7e0911ae145881ded9ac9d30cf47467b748def0c9f226ef75718367f0a581
7
+ data.tar.gz: 790ee54e009f940446fb1ad3efadd9730fb1d2874113e5c57627694d45ca88d7581344ca16c2cbb0fa44a0459ca8280637548e415cd91f8e8b4d3b2bcacfc0c0
data/Gemfile CHANGED
@@ -8,3 +8,4 @@ gem "rspec", "~> 3.0"
8
8
  gem 'tty-spinner'
9
9
  gem 'tty-table'
10
10
  gem 'pry'
11
+ gem 'json'
@@ -1,12 +1,11 @@
1
1
  require "json"
2
2
  require "tty-prompt"
3
3
  require "pry"
4
- require_relative "../lib/postcode_gem/version"
5
4
 
6
5
 
7
6
  module PostcodeGem
8
- DATA = JSON.parse(File.read('../data/postcode_areacode.json'))
9
7
  def self.select_country
8
+ @data = JSON.load(File.read('./data/postcode_areacode.json'))
10
9
  attr_accessor :country, :city, :zipcode
11
10
  prompt = TTY::Prompt.new
12
11
  @country = prompt.select('Enter the country you want to select', %w(Vietnam England Japan))
@@ -19,9 +18,9 @@ module PostcodeGem
19
18
  end
20
19
  def output_zipcode
21
20
  process_input
22
- @city = DATA["#{@country}"].values
23
- @zipcode = DATA["#{@country}"].keys
24
- @data_country = DATA["#{@country}"]
21
+ @city = @data["#{@country}"].values
22
+ @zipcode = @data["#{@country}"].keys
23
+ @data_country = @data["#{@country}"]
25
24
 
26
25
  if @data_country.has_key?(@city_zipcode)
27
26
  puts @data_country.values_at("#{@city_zipcode}")
@@ -1,3 +1,3 @@
1
1
  module PostcodeGem
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postcode_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhuongTr1501
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-09 00:00:00.000000000 Z
11
+ date: 2020-01-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: this is postcode country of mine
14
14
  email: