postcode_gem 0.3.12 → 0.3.13

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: f961bd409cbd3134bdad7fd9e144fda17be505dab9ba329e738bb433aff80feb
4
- data.tar.gz: f4afb94a07fff1958a3a6e52d82cdcc7a9b3a30e21d6fb9e3e01cd2952ac3df3
3
+ metadata.gz: fc78a23dd3c7fb5436238970d3b2344f9011e9c17c6e68cf659d2ed0f46bf5ac
4
+ data.tar.gz: d0ef9d082147e2a4af2ffc84cd6f4da1bfb6c23b50a55541f7f45136beacdd32
5
5
  SHA512:
6
- metadata.gz: 88129424e4881c52a37bb0f84cc8c19d8e3e9578b93dfe2e2af0d2fcf9fc4164d4103b81be962bfeca96fcb1897ca679ebf787781a9534e64e36d10aa038165f
7
- data.tar.gz: 5829fc08b683c564b3fff8860aeced324ee1e9019c85dee364cf480880545af8d78dd428c798a316d587fc5e88f64986a2bdb8664f6be37b73acb822bac676f5
6
+ metadata.gz: 7ceec948c0e15464e0dbc304f3fe8e492116560c745ad0c2dd5662cbfae160ccdc1eea96de2532853379412f9e09865f3ec0fd484454003d131fe0fbfcc393ff
7
+ data.tar.gz: 0b3449c7c19c06f5e0542889b6e0f5edcf4c8bad85ed1a4e31444990440ea8064b1ce5493b8c3a02332a569b33c428e6de1c8776997d7b8d0753cfd4a60f56d0
@@ -1,12 +1,17 @@
1
1
  require_relative '../lib/postcode_gem/version'
2
- require_relative '../lib/postcode_gem/postcode_areacode'
2
+ require 'json'
3
3
  require "tty-prompt"
4
4
  require "pry"
5
5
 
6
6
  module PostcodeGem
7
7
  attr_accessor :country, :city, :zipcode
8
+ module_function
9
+ def export_json
10
+ PostcodeGem::Export.execute
11
+ end
12
+
8
13
  def output_zipcode
9
- @data = PostcodeAreacode::DATA
14
+ @data = JSON.parse(File.open('data/postcode_areacode.json').read)
10
15
  prompt = TTY::Prompt.new
11
16
  @country = prompt.select('Enter the country you want to select', %w(Vietnam England Japan))
12
17
  print "Enter the city or area code you want to search: "
@@ -1,3 +1,3 @@
1
1
  module PostcodeGem
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postcode_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - PhuongTr1501