brval 0.7.0 → 0.7.1

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: 4618b4783cbc5229fb9b7bc50ead9ec21789fef74a51b5ad998204912509af47
4
- data.tar.gz: 020c85c74febb5e40a12db2c2e3977e604af7093dbb8a99dc8d67da31cb8db57
3
+ metadata.gz: 7260e4530a40cc16c181fc7aa4d12e0bdb359b744dc0862c688475269ac16e01
4
+ data.tar.gz: 4e4bc2bd3d2c9a35ccab8c33a7422179c8c12c6326e23f82effb54cb49fc77d8
5
5
  SHA512:
6
- metadata.gz: 2e0b08c639776a7667150ded10de430653cf103407419cfe809c5b4c7931c378b8e2bbf099428ccf790a8cbd08b1432b0d63330cc10697b00943ab911bb5fac1
7
- data.tar.gz: ad0ae0eb5992eb6aeedd8190c50ff516971b4bfbc7c352c4f9ddfef58b7a3d1ac2b9d8eda502c10c43a49d3a5aef80f203e536afb8cf97fd9f36153ce25d44c8
6
+ metadata.gz: 499890bc5c7a1220692c43d668afe8efa8990b55e474161996dd71a54966e4cdc45748ba7f27514e1c5b3b10dd383599a6c6aafceaf86e5d09ed46879436405f
7
+ data.tar.gz: a761ecc256adf51f505acca1468588f253a711681fa053dbbeaf1eb19a91de7565249a80f62d48aad1570b53ccc52a7d0732c7fec583de1c5a23ad1d17376f78
data/README.md CHANGED
@@ -43,7 +43,7 @@ Brval.cep_valid?('70297-400') # => true
43
43
 
44
44
  ### Lista da Funções
45
45
  ### Functions List
46
- Above is the list with all the functions and validations avaible on Brval gem, after that a resume explaining about CEP validation:
46
+ Above is the list with all the functions and validations avaible on Brval gem.
47
47
 
48
48
  | Function | Return | Description |
49
49
  |-------------------------|--------------|-----------|
@@ -60,7 +60,7 @@ Above is the list with all the functions and validations avaible on Brval gem, a
60
60
 
61
61
 
62
62
  ### CEP Validation
63
- Brazilian postal code, CEP, doesn't has any formula or calculation to check is some CEP is valid or not, the only way to know that is searching in a database with all CEP's in Brazil
63
+ Brazilian postal code, CEP, doesn't has any formula or calculation to check if some CEP is valid or not, the only way to know that is searching in a database with all CEP's in Brazil
64
64
 
65
65
  Apparently Correios doesn't provides any database with all CEP's of Brazil, so some devs developer their own services to search for a CEP info, some of those services are public API's and anyone can use it.
66
66
 
@@ -74,7 +74,7 @@ Considering this, Brval does the CEP validation following this flow:
74
74
 
75
75
  The gem uses the same procedure to get the info of some CEP with the function: `Brval.cep_info(00000000)`
76
76
 
77
- **OBS:** the gem "only" search in three API's, so if a CEP exists but any of these API's doesn't have it, the gem will return a false negative.
77
+ **OBS:** the gem "only" search in three API's, if a CEP exists but any of these API's doesn't have it, the gem will return a false negative.
78
78
 
79
79
 
80
80
  ## Contributing
@@ -85,6 +85,16 @@ If you want to contribute with some code create an issue so we can discuss about
85
85
 
86
86
  Don't forget the tests, Brval use Rspec to test. Update the README with the new info. Also, try to follow the gem pattern to implement your contribution.
87
87
 
88
+ ### Run the gem from local project
89
+ You can run the gem with: `rake console`
90
+
91
+ And before send your PR make a simulation installing the gem locally with your changes, just run the `./build.sh` script.
92
+
93
+ ```
94
+ chmod +x build.sh
95
+ ./build.sh
96
+ ```
97
+
88
98
  Thanks!
89
99
 
90
100
  ## License
@@ -11,7 +11,7 @@ module Cep
11
11
  private
12
12
 
13
13
  def json_valid? json
14
- return false if json.key?('erro')
14
+ return false if json.nil? || json.key?('erro')
15
15
  json.key?('logradouro') && json.key?('bairro') && json.key?('localidade') && json.key?('uf')
16
16
  end
17
17
 
@@ -14,7 +14,7 @@ module Cep
14
14
  private
15
15
 
16
16
  def json_valid? json
17
- return false if json.key?('message')
17
+ return false if json.nil? || json.key?('message')
18
18
  json.key?('district') && json.key?('city') && json.key?('address') && json.key?('state')
19
19
  end
20
20
 
data/lib/brval/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Brval
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brval
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Andrade
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-20 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler