pl-zip-codes 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", "~> 1.2.3"
12
+ gem "jeweler", "~> 1.8.4"
13
+ gem "simplecov", ">= 0"
14
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,44 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (3.2.9)
5
+ i18n (~> 0.6)
6
+ multi_json (~> 1.0)
7
+ bourne (1.1.2)
8
+ mocha (= 0.10.5)
9
+ git (1.2.5)
10
+ i18n (0.6.1)
11
+ jeweler (1.8.4)
12
+ bundler (~> 1.0)
13
+ git (>= 1.2.5)
14
+ rake
15
+ rdoc
16
+ json (1.7.5)
17
+ metaclass (0.0.1)
18
+ mocha (0.10.5)
19
+ metaclass (~> 0.0.1)
20
+ multi_json (1.5.0)
21
+ rake (10.0.3)
22
+ rdoc (3.12)
23
+ json (~> 1.4)
24
+ shoulda (3.3.2)
25
+ shoulda-context (~> 1.0.1)
26
+ shoulda-matchers (~> 1.4.1)
27
+ shoulda-context (1.0.2)
28
+ shoulda-matchers (1.4.2)
29
+ activesupport (>= 3.0.0)
30
+ bourne (~> 1.1.2)
31
+ simplecov (0.7.1)
32
+ multi_json (~> 1.0)
33
+ simplecov-html (~> 0.7.1)
34
+ simplecov-html (0.7.1)
35
+
36
+ PLATFORMS
37
+ ruby
38
+
39
+ DEPENDENCIES
40
+ bundler (~> 1.2.3)
41
+ jeweler (~> 1.8.4)
42
+ rdoc (~> 3.12)
43
+ shoulda
44
+ simplecov
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Ernest Bursa
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,40 @@
1
+ = Pl Zip Codes
2
+ {<img src="https://travis-ci.org/swistaczek/pl-zip-codes.png?branch=master" alt="Build Status" />}[https://travis-ci.org/swistaczek/pl-zip-codes]
3
+
4
+ With this simple gem (covered with basic specs) you will be able to get zip codes database for Poland.
5
+ This project uses 17 mb CSV database as data source so first call will take couple seconds to complete.
6
+
7
+ == Instalation
8
+ To use this gem just require it with Bundler support in yours **Gemfile**:
9
+
10
+ gem 'pl-zip-codes'
11
+
12
+ == Usage
13
+
14
+ PlZipCodes.find('60-115').map {|x| x[:street] }
15
+ # => ["Bohaterów Westerplatte", "Jaskiniowa", "Kępińska", "Leszczyńska", "Leszczyńska", "Na Uboczu", "Poniecka", "Przełęcz", "Żlebowa"]
16
+
17
+ PlZipCodes.find('60-115')
18
+ # => [{:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Bohaterów Westerplatte", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Jaskiniowa", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Kępińska", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Leszczyńska", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Leszczyńska", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Na Uboczu", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Poniecka", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Przełęcz", :region=>"Wielkopolskie", :notes=>"m. Poznań"}, {:code=>"60-115", :city=>"Poznań", :province=>"Poznań (poznań-grunwald)", :street=>"Żlebowa", :region=>"Wielkopolskie", :notes=>"m. Poznań"}]
19
+
20
+ PlZipCodes.find {|record| record[:street] == 'Sienkiewicza Henryka' and record[:city] == 'Warszawa' and record[:province].include?('Śródmieście') }
21
+ # => [{:code=>"00-010", :city=>"Warszawa", :province=>"Warszawa (Śródmieście)", :street=>"Sienkiewicza Henryka", :region=>"Mazowieckie", :notes=>"m. st. Warszawa"}, {:code=>"00-015", :city=>"Warszawa", :province=>"Warszawa (Śródmieście)", :street=>"Sienkiewicza Henryka", :region=>"Mazowieckie", :notes=>"m. st. Warszawa"}, {:code=>"00-015", :city=>"Warszawa", :province=>"Warszawa (Śródmieście)", :street=>"Sienkiewicza Henryka", :region=>"Mazowieckie", :notes=>"m. st. Warszawa"}]
22
+
23
+ == Database source
24
+ GUS / Poczta Polska (03.2009).
25
+ Kudos to Piotr Zaniewicz (http://piotr.eldora.pl/) for sharing database.
26
+
27
+ == Contributing to polish-flexive-name-endings
28
+
29
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
30
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
31
+ * Fork the project.
32
+ * Start a feature/bugfix branch.
33
+ * Commit and push until you are happy with your contribution.
34
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
35
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
36
+
37
+ == Copyright
38
+
39
+ Copyright (c) 2013 Ernest Bursa - http://ernest.bzdury.pl
40
+ See LICENSE.txt for further details.
data/Rakefile ADDED
@@ -0,0 +1,46 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "pl-zip-codes"
18
+ gem.homepage = "http://github.com/swistaczek/pl-zip-codes"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Simple zip codes database for Poland}
21
+ gem.description = %Q{Simple zip codes database for Poland}
22
+ gem.email = "ernest@bzdury.pl"
23
+ gem.authors = ["Ernest Bursa"]
24
+ gem.files.include 'lib/**/*'
25
+ # dependencies defined in Gemfile
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rake/testtask'
30
+ Rake::TestTask.new(:test) do |test|
31
+ test.libs << 'lib' << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
34
+ end
35
+
36
+ task :default => :test
37
+
38
+ require 'rdoc/task'
39
+ Rake::RDocTask.new do |rdoc|
40
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
41
+
42
+ rdoc.rdoc_dir = 'rdoc'
43
+ rdoc.title = "pl-zip-codes #{version}"
44
+ rdoc.rdoc_files.include('README*')
45
+ rdoc.rdoc_files.include('lib/**/*.rb')
46
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.5