itax_code 0.1.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +10 -8
- data/.github/workflows/release.yml +31 -0
- data/.github/workflows/test.yml +10 -7
- data/.gitignore +2 -0
- data/.rubocop.yml +10 -1
- data/CHANGELOG.md +13 -0
- data/Gemfile +10 -0
- data/README.md +5 -5
- data/bin/release +3 -3
- data/itax_code.gemspec +0 -10
- data/lib/itax_code/data/cities.csv +19306 -13832
- data/lib/itax_code/data/countries.csv +277 -277
- data/lib/itax_code/encoder.rb +27 -16
- data/lib/itax_code/parser.rb +45 -37
- data/lib/itax_code/utils.rb +1 -2
- data/lib/itax_code/version.rb +1 -1
- data/rakelib/cities.rake +35 -0
- metadata +5 -116
- data/.github/workflows/build-and-push.yml +0 -27
- data/Gemfile.lock +0 -74
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e7183f6da4c2c4492b53d5942521ff51a9987862016e9b07ece6f0ee41d710
|
4
|
+
data.tar.gz: 89b10833a629223826fd6be3e8b40f04c1e6c6f7fe253e52321277d9ac664e88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67326622ca594d800c0cc30518fcc396182d7b1c8c47da3440eb04f057f4411730753337ab2d2f290f554c9be8eb3f0ad0765a539d8a68358204cc1a5a44fe37
|
7
|
+
data.tar.gz: 280471f1325998e1712b7541e43a579a06b512198470c507d268ce353faeca508bdb2f01f5f7a57b6e874c1e6b9c3494cc3983b706bb737ecd5583220a3c38d1
|
data/.github/workflows/lint.yml
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
name: Lint
|
2
2
|
|
3
|
-
on:
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types:
|
6
|
+
- opened
|
7
|
+
- reopened
|
8
|
+
- synchronize
|
4
9
|
|
5
10
|
jobs:
|
6
11
|
lint:
|
7
12
|
runs-on: ubuntu-latest
|
8
13
|
steps:
|
9
|
-
-
|
10
|
-
|
11
|
-
- name: Set up Ruby
|
12
|
-
uses: ruby/setup-ruby@v1
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
- uses: ruby/setup-ruby@v1
|
13
16
|
with:
|
14
17
|
bundler-cache: true
|
15
|
-
ruby-version: 2.
|
18
|
+
ruby-version: 2.5.0
|
16
19
|
- run: bundle install
|
17
|
-
-
|
18
|
-
run: bundle exec rubocop
|
20
|
+
- run: bundle exec rubocop
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: Release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- main
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
release-please:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: google-github-actions/release-please-action@v3
|
13
|
+
id: release
|
14
|
+
with:
|
15
|
+
package-name: itax_code
|
16
|
+
release-type: ruby
|
17
|
+
token: ${{secrets.GITHUB_TOKEN}}
|
18
|
+
version-file: "lib/itax_code/version.rb"
|
19
|
+
- uses: actions/checkout@v3
|
20
|
+
if: ${{steps.release.outputs.release_created}}
|
21
|
+
- uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
bundler-cache: true
|
24
|
+
ruby-version: 2.7.0
|
25
|
+
if: ${{steps.release.outputs.release_created}}
|
26
|
+
- run: bundle install
|
27
|
+
if: ${{steps.release.outputs.release_created}}
|
28
|
+
- run: ./bin/release
|
29
|
+
env:
|
30
|
+
RUBYGEMS_API_KEY: ${{secrets.RUBYGEMS_API_KEY}}
|
31
|
+
if: ${{steps.release.outputs.release_created}}
|
data/.github/workflows/test.yml
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
name: Test
|
2
2
|
|
3
|
-
on:
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
types:
|
6
|
+
- opened
|
7
|
+
- reopened
|
8
|
+
- synchronize
|
4
9
|
|
5
10
|
jobs:
|
6
11
|
test:
|
7
12
|
runs-on: ubuntu-latest
|
13
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
8
14
|
strategy:
|
9
15
|
fail-fast: false
|
10
16
|
matrix:
|
11
|
-
ruby: [2.5, 2.6, 2.7, head]
|
12
|
-
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
|
17
|
+
ruby: [2.5, 2.6, 2.7, '3.0', 3.1, head]
|
13
18
|
steps:
|
14
|
-
-
|
15
|
-
|
16
|
-
- name: Set up Ruby
|
17
|
-
uses: ruby/setup-ruby@v1
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- uses: ruby/setup-ruby@v1
|
18
21
|
with:
|
19
22
|
bundler-cache: true
|
20
23
|
ruby-version: ${{ matrix.ruby }}
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
require:
|
3
3
|
- rubocop-minitest
|
4
4
|
- rubocop-performance
|
5
|
+
- rubocop-rake
|
6
|
+
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.5
|
5
9
|
|
6
10
|
Bundler/OrderedGems:
|
7
11
|
Enabled: false
|
@@ -16,11 +20,16 @@ Layout/IndentationConsistency:
|
|
16
20
|
|
17
21
|
Layout/LineLength:
|
18
22
|
Enabled: true
|
19
|
-
Max:
|
23
|
+
Max: 100
|
20
24
|
|
21
25
|
Metrics/AbcSize:
|
22
26
|
Enabled: false
|
23
27
|
|
28
|
+
Metrics/BlockLength:
|
29
|
+
Enabled: true
|
30
|
+
Exclude:
|
31
|
+
- 'rakelib/**/*'
|
32
|
+
|
24
33
|
Metrics/ClassLength:
|
25
34
|
Enabled: true
|
26
35
|
Exclude:
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [0.3.0](https://github.com/matteoredz/itax-code/compare/v0.2.0...v0.3.0) (2023-06-30)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* trigger release action on bump ([#9](https://github.com/matteoredz/itax-code/issues/9)) ([412f054](https://github.com/matteoredz/itax-code/commit/412f054a9e93d95bcf86244121c3097c8e76f515))
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* restore release workflow ([#8](https://github.com/matteoredz/itax-code/issues/8)) ([876fc6b](https://github.com/matteoredz/itax-code/commit/876fc6bb69d31e73e611a0e74ee1b27ed2fea966))
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -29,9 +29,9 @@ Or install it yourself as:
|
|
29
29
|
ItaxCode.encode(
|
30
30
|
surname: "Rossi",
|
31
31
|
name: "Mario",
|
32
|
-
gender: "M", #
|
33
|
-
birthdate: "1980-
|
34
|
-
birthplace: "Milano"
|
32
|
+
gender: "M", # M|F
|
33
|
+
birthdate: "1980-01-01", # String|Time|Date|DateTime
|
34
|
+
birthplace: "Milano" # Name(Milano)|code(F205)
|
35
35
|
)
|
36
36
|
```
|
37
37
|
|
@@ -45,7 +45,7 @@ ItaxCode.decode("RSSMRA80A01F205X")
|
|
45
45
|
# {
|
46
46
|
# code: "RSSMRA80A01F205X",
|
47
47
|
# gender: "M",
|
48
|
-
# birthdate: "1980-
|
48
|
+
# birthdate: "1980-01-01",
|
49
49
|
# birthplace: {
|
50
50
|
# code: "F205",
|
51
51
|
# province: "MI",
|
@@ -83,7 +83,7 @@ ItaxCode.valid?(
|
|
83
83
|
surname: "Rossi",
|
84
84
|
name: "Mario",
|
85
85
|
gender: "M",
|
86
|
-
birthdate: "1980-
|
86
|
+
birthdate: "1980-01-01",
|
87
87
|
birthplace: "Milano"
|
88
88
|
}
|
89
89
|
)
|
data/bin/release
CHANGED
@@ -7,9 +7,9 @@ chmod 0600 ~/.gem/credentials
|
|
7
7
|
|
8
8
|
cat << EOF > ~/.gem/credentials
|
9
9
|
---
|
10
|
-
:github: Bearer ${GITHUB_TOKEN}
|
11
10
|
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
12
11
|
EOF
|
13
12
|
|
14
|
-
# Build and
|
15
|
-
|
13
|
+
# Build and Push
|
14
|
+
gem build *.gemspec
|
15
|
+
gem push *.gem
|
data/itax_code.gemspec
CHANGED
@@ -22,15 +22,5 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.bindir = "exe"
|
23
23
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
|
-
|
26
25
|
spec.add_dependency "activesupport"
|
27
|
-
|
28
|
-
spec.add_development_dependency "byebug"
|
29
|
-
spec.add_development_dependency "minitest"
|
30
|
-
spec.add_development_dependency "mocha"
|
31
|
-
spec.add_development_dependency "rake"
|
32
|
-
spec.add_development_dependency "rubocop"
|
33
|
-
spec.add_development_dependency "rubocop-minitest"
|
34
|
-
spec.add_development_dependency "rubocop-performance"
|
35
|
-
spec.add_development_dependency "simplecov"
|
36
26
|
end
|