validates-correios-cep 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2c4c6d6198cc1d36d16e6fea490976321e3d12f9fc2824a4c799868099fc2d6
4
- data.tar.gz: 5d4a61bc0cc04a0f6e37ad09b3c5f8d2dd6bd7cf83eeee39aa9f8a7c902f1e83
3
+ metadata.gz: 902f6f2caf0d931ca6bc5156880482865766836539392efc258dcafd5655ab67
4
+ data.tar.gz: 19fd000b656a3ed3596b1bc64c74e72edce8e14005a8453c804a0409242fab2d
5
5
  SHA512:
6
- metadata.gz: 894768f8fd1d35de9022815a7ce81dd65822b458405c44e7ec48d90d79feb0122093b577f105d1763eda8be028eb71ff56200b7d1199f1443b6fb8c318c53c9d
7
- data.tar.gz: 1eebb1e145b8413eb6d222c1ca4ac15d9149d147a0c7bf94ca729775fbaaf03baca98f834d57813a7064dea56381da3a55c8254fe6029c577df382d527273697
6
+ metadata.gz: '0789880d574b3888737e859e22acbe473a78ff87594352e88a217e785548acf845d4dc120ad7817a5109441caea406b7d3da0fdc2b0d2f6a9c8a5aa2f3087a0d'
7
+ data.tar.gz: 8a57223c480a52794a5920efacdfb6c1f370ea620c50e79dc5bf03b90b16e18f134b021e26bfb6812a89bfc738204b184149c4d481249e758a671d673f8f1074
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ tests:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ ruby-version: [2.6, 2.7, 3.0]
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+
14
+ - name: Install Ruby ${{ matrix.ruby-version }}
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby-version }}
18
+
19
+ - name: Install dependencies
20
+ run: bundle install
21
+
22
+ - name: Run tests with Ruby ${{ matrix.ruby-version }}
23
+ run: bundle exec rake
data/.gitignore CHANGED
@@ -8,3 +8,6 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  sftp-config.json
11
+ .rspec_status
12
+ *.gem
13
+ *.log
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,11 @@
1
+ ## [Unreleased]
2
+
3
+ ## 0.1.3 - 2021-08-04
4
+
5
+ - Setup of Github Actions
6
+ - Fixes for new rubies
7
+
8
+ ## [0.1.0...0.1.2] - 2021-06-22
9
+
10
+ - Initial releases
11
+ - Skeleton of gem
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at TODO: Write your email address. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/validates-correios-cep.svg)](https://badge.fury.io/rb/validates-correios-cep)
4
4
  [![Gem](https://img.shields.io/gem/dt/validates-correios-cep.svg)]()
5
- [![Build Status](https://travis-ci.org/pedrofurtado/validates-correios-cep.svg?branch=master)](https://travis-ci.org/pedrofurtado/validates-correios-cep)
5
+ [![CI](https://github.com/pedrofurtado/validates-correios-cep/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/pedrofurtado/validates-correios-cep/actions/workflows/ci.yml)
6
6
  [![license](https://img.shields.io/github/license/pedrofurtado/validates-correios-cep.svg)]()
7
7
 
8
8
  ## Installation
@@ -15,7 +15,7 @@ gem 'validates-correios-cep'
15
15
 
16
16
  And then execute:
17
17
 
18
- $ bundle
18
+ $ bundle install
19
19
 
20
20
  Or install it yourself as:
21
21
 
data/Rakefile CHANGED
@@ -1 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task default: %i[spec]
data/bin/console ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'validates-correios-cep'
6
+ require 'irb'
7
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+ bundle install
@@ -1,5 +1,6 @@
1
1
  require 'correios-cep'
2
2
  require 'active_model'
3
+ require 'net/http'
3
4
 
4
5
  module ActiveModel
5
6
  module Validations
@@ -8,12 +9,12 @@ module ActiveModel
8
9
 
9
10
  def validate_each(record, attribute, value)
10
11
  error_message_scope = begin
11
- "#{CORREIOS_CEP_I18N_SCOPE}.not_exists" if Correios::CEP::AddressFinder.get(value).blank?
12
- rescue EOFError
12
+ "#{CORREIOS_CEP_I18N_SCOPE}.not_exists" if ::Correios::CEP::AddressFinder.get(value).blank?
13
+ rescue EOFError, ::HTTP::ConnectionError
13
14
  "#{CORREIOS_CEP_I18N_SCOPE}.connection_failed"
14
15
  rescue ArgumentError
15
16
  "#{CORREIOS_CEP_I18N_SCOPE}.invalid"
16
- rescue Net::OpenTimeout
17
+ rescue ::Net::OpenTimeout, ::HTTP::TimeoutError
17
18
  "#{CORREIOS_CEP_I18N_SCOPE}.timeouted"
18
19
  end
19
20
 
@@ -1,3 +1,3 @@
1
1
  module ValidatesCorreiosCep
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'validates-correios-cep'
8
8
  spec.version = ValidatesCorreiosCep::VERSION
9
9
  spec.authors = ['Pedro Furtado']
10
- spec.email = ['pedro.felipe.furtado@usp.br']
10
+ spec.email = ['pedro.felipe.azevedo.furtado@gmail.com']
11
11
 
12
12
  spec.summary = %q{Brazilian zipcode validations for ActiveRecord, integrated with correios-cep gem.}
13
13
  spec.description = spec.summary
@@ -20,7 +20,9 @@ Gem::Specification.new do |spec|
20
20
  spec.add_dependency 'rails'
21
21
  spec.add_dependency 'activemodel'
22
22
  spec.add_dependency 'correios-cep'
23
+ spec.add_dependency 'net-http'
23
24
 
24
- spec.add_development_dependency 'bundler'
25
25
  spec.add_development_dependency 'rake'
26
+ spec.add_development_dependency 'rspec'
27
+ spec.add_development_dependency 'sqlite3'
26
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: validates-correios-cep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pedro Furtado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-22 00:00:00.000000000 Z
11
+ date: 2021-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -53,13 +53,13 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: net-http
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- type: :development
62
+ type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
@@ -80,20 +80,54 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: sqlite3
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
83
111
  description: Brazilian zipcode validations for ActiveRecord, integrated with correios-cep
84
112
  gem.
85
113
  email:
86
- - pedro.felipe.furtado@usp.br
114
+ - pedro.felipe.azevedo.furtado@gmail.com
87
115
  executables: []
88
116
  extensions: []
89
117
  extra_rdoc_files: []
90
118
  files:
119
+ - ".github/workflows/ci.yml"
91
120
  - ".github/workflows/publish_to_rubygems.yml"
92
121
  - ".gitignore"
122
+ - ".rspec"
123
+ - CHANGELOG.md
124
+ - CODE_OF_CONDUCT.md
93
125
  - Gemfile
94
126
  - LICENSE.txt
95
127
  - README.md
96
128
  - Rakefile
129
+ - bin/console
130
+ - bin/setup
97
131
  - config/locales/de.yml
98
132
  - config/locales/en.yml
99
133
  - config/locales/es.yml
@@ -124,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
158
  - !ruby/object:Gem::Version
125
159
  version: '0'
126
160
  requirements: []
127
- rubygems_version: 3.2.15
161
+ rubygems_version: 3.2.22
128
162
  signing_key:
129
163
  specification_version: 4
130
164
  summary: Brazilian zipcode validations for ActiveRecord, integrated with correios-cep