municipitaly 0.1.0 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24fedc34bc956278bced1f028e4a3e799521e9799589e07e9bdf99bfbc929d9d
4
- data.tar.gz: 184216b1d21ec759ee14cea67205c2766b7cdee383fb45571f31520e72ae403b
3
+ metadata.gz: 529e4690277bf3f529559e04fe2e1276c2bb39b3d7ccf27df37dbf93bed85e2f
4
+ data.tar.gz: c1f655da8655f244e376e6e422cda6b1bfde49a91a5e9f39d0379a382022fbcd
5
5
  SHA512:
6
- metadata.gz: 7dc8a21153c609f7e3e896058fa8113ca0e3c380c873514614e1e866ecde75eb85a64c4b9246787777f67421399303dd9e7c5821c4ba987a679ee3fef843480d
7
- data.tar.gz: a51ba9a078bb41ca8ee2d4d47c34ea3e5b4ef5ec89030c63c2037277316114875e8988548254ed77593a2604b1ea789b389e90535bb1759128b4d312271be997
6
+ metadata.gz: 03f8dc76e6b6323d1cb03f117f140124a095e6db26eebed2afd397ed0e3e05270822d64bcb92107af5135d73cf44ce07b75e52d5b60d031753cdcb624bc0c09d
7
+ data.tar.gz: de0cbc36598e3216a54b7787a9a429ece40b9de44c7183c89d892071c2955e0527e9b0f0387021e2a59a86fbb95eb74fc22d6e384acd95cf9f76ca8104dfebb1
@@ -1,7 +1,14 @@
1
1
  ---
2
- sudo: false
2
+ os: linux
3
3
  language: ruby
4
- cache: bundler
5
4
  rvm:
6
5
  - 2.6.5
7
6
  before_install: gem install bundler -v 2.1.4
7
+ before_script:
8
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
9
+ - chmod +x ./cc-test-reporter
10
+ - ./cc-test-reporter before-build
11
+ script:
12
+ - bundle exec rspec
13
+ after_script:
14
+ - ./cc-test-reporter after-build --debug --exit-code $TRAVIS_TEST_RESULT --prefix /home/travis/build/natydev/municipitaly --coverage-input-type simplecov
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.0] - 2020-02-24
9
+
10
+ ### Added
11
+
12
+ -ISO 3166-2 code in province object `#iso3166_2` or alias `#iso3166`
13
+
8
14
 
9
15
  ## [0.1.0] - 2020-02-13
10
16
 
@@ -1,14 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- municipitaly (0.0.3)
4
+ municipitaly (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
9
  ast (2.4.0)
10
10
  diff-lcs (1.3)
11
+ docile (1.3.2)
11
12
  jaro_winkler (1.5.4)
13
+ json (2.3.0)
12
14
  parallel (1.19.1)
13
15
  parser (2.6.5.0)
14
16
  ast (~> 2.4.0)
@@ -35,6 +37,11 @@ GEM
35
37
  ruby-progressbar (~> 1.7)
36
38
  unicode-display_width (>= 1.4.0, < 1.7)
37
39
  ruby-progressbar (1.10.1)
40
+ simplecov (0.17.1)
41
+ docile (~> 1.1)
42
+ json (>= 1.8, < 3)
43
+ simplecov-html (~> 0.10.0)
44
+ simplecov-html (0.10.2)
38
45
  unicode-display_width (1.6.0)
39
46
 
40
47
  PLATFORMS
@@ -46,6 +53,7 @@ DEPENDENCIES
46
53
  rake (~> 13.0.1)
47
54
  rspec (~> 3.9)
48
55
  rubocop (~> 0.77)
56
+ simplecov (~> 0.17.1)
49
57
 
50
58
  BUNDLED WITH
51
59
  2.1.4
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
 
2
2
  # 🇮🇹 Municipitaly
3
3
 
4
+ [![Build Status](https://travis-ci.org/natydev/municipitaly.png?branch=master)](https://travis-ci.org/natydev/municipitaly)
5
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/07a4926100e3df1cdd72/test_coverage)](https://codeclimate.com/github/natydev/municipitaly/test_coverage)
6
+ [![Maintainability](https://api.codeclimate.com/v1/badges/07a4926100e3df1cdd72/maintainability)](https://codeclimate.com/github/natydev/municipitaly/maintainability)
7
+ [![Gem Version](https://badge.fury.io/rb/municipitaly.svg)](https://badge.fury.io/rb/municipitaly)
8
+
4
9
  This gem provide various data about 🇮🇹 Italian subdivisions and municipalities. As well the entire updated list of provinces, regions and municipalities names, it provide useful codes (📯 postal code(s), 🌐 [ISTAT](https://www.istat.it/en/) codes, cadastrial code, population, ...).
5
10
 
6
11
  ## 💾 Installation
@@ -9,7 +9,6 @@ module Municipitaly
9
9
  @@municipalities = []
10
10
 
11
11
  def zones
12
- puts find_csv('zones.csv')
13
12
  if @@zones.empty?
14
13
  CSV.foreach(find_csv('zones.csv'), headers: true) do |row|
15
14
  @@zones << Zone.new(name: row[0], code: row[1])
@@ -27,5 +27,13 @@ module Municipitaly
27
27
  def municipalities
28
28
  @municipalities ||= Search.municipalities_from_province_istat(istat)
29
29
  end
30
+
31
+ # returns ISO 3166-2 code for current province.
32
+ def iso3166_2
33
+ "IT-#{acronym}"
34
+ end
35
+
36
+ alias_method :iso3166, :iso3166_2
37
+
30
38
  end
31
39
  end
@@ -118,7 +118,7 @@ module Municipitaly
118
118
 
119
119
  # returns an array of +Municipitaly::Municipality+ objects from a
120
120
  # <b>municipality name</b> term.
121
- # Term can be a partial string and is case insensitive.
121
+ # Term can be a partial string and is case insensitive.
122
122
  # The optional parameter +greedy+ [boolean] permit to serch exact term
123
123
  # name (if false) or partial word (true by default).
124
124
  #
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Municipitaly
4
4
  # :nodoc:
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'rake', '~> 13.0.1'
34
34
  spec.add_development_dependency 'rspec', '~> 3.9'
35
35
  spec.add_development_dependency 'rubocop', '~> 0.77'
36
+ spec.add_development_dependency 'simplecov', '~> 0.17.1'
36
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: municipitaly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NatyDev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.77'
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.17.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.17.1
69
83
  description: Codes (postal, istat, cadastrian, ...) about Italian subdivisions and
70
84
  municipalities
71
85
  email: