population_growth_client 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 894320337fcbaf3233e62c5a3b9f0573cf4dad53
4
+ data.tar.gz: e0e3bbccab1372c85f031ca3cfa9fff86b38a3cb
5
+ SHA512:
6
+ metadata.gz: 1b79ae724bdceae7ba1ed746a1137bd545ce40eb58c348330a0ed2e1950c2126979064ca02475e7cd2db618ade1069226e4d048f96eb3997f6c9f964f2f87764
7
+ data.tar.gz: f9fbecfb3c79b82cb9503c936940a36033a1ef3bbf61bf4a519c86ff03d92b053e4640429800c7238d45d9f91e86bf19d26801b9d4b2c8aadf11f5fe5c5776a7
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'population_growth_client'
4
+ puts PopulationGrowthClient.search_zip(ARGV[0])
@@ -0,0 +1,13 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
4
+ # Population growth client
5
+ class PopulationGrowthClient
6
+ # Search population growth by zip code
7
+ def self.search_zip(zip_code)
8
+ url = 'http://population-growth-ps.herokuapp.com/search-zip/'
9
+ uri = URI(url + zip_code.to_s)
10
+ response = Net::HTTP.get_response(uri)
11
+ JSON.parse(response.body) if response.code == '200'
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: population_growth_client
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Macek
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: imacek@gmail.com
15
+ executables:
16
+ - population_growth_client
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/population_growth_client
21
+ - lib/population_growth_client.rb
22
+ homepage: https://github.com/IvanMacek/population-growth-client
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.4.3
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: An client for the search population growth by ZIP codes API.
46
+ test_files: []