conecta_address_br 0.1.0 → 0.1.1
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 +4 -4
- data/lib/conecta_address_br.rb +23 -0
- data/lib/conecta_address_br/states/states.rb +5 -1
- data/lib/conecta_address_br/version.rb +1 -1
- data/lib/locales/addressList.yml +32 -1
- metadata +24 -10
- data/.gitignore +0 -8
- data/Gemfile +0 -4
- data/Gemfile.lock +0 -20
- data/Rakefile +0 -2
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/conecta_address_br.gemspec +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2cf32dbcd6da21369dc137964c7a28497d6f847ce7972df80d5db802b7c6c938
|
4
|
+
data.tar.gz: 8bd41c3d2531bcfde8e13f03b5c482b57e022c5d06e8d9c414f8e4daf48016e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb46412dc4446f95bc32a324edf56b756f1c9f4bdeea7c3811debf62bf10b7b2a1b76565933d101bc301cd2800651feb0c4653e2487c6187ba9fe8464bcc88dc
|
7
|
+
data.tar.gz: 0b3f3c030b06732012b575e82defc79a6bc7b97b4801d9910f8b5c477ccfb7e8152d3588c6377bf2b6d215695a2dfd5ddbca09a6b7db83bdb48154fbe5e43524
|
data/lib/conecta_address_br.rb
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
require "conecta_address_br"
|
2
2
|
|
3
|
+
require 'i18n'
|
4
|
+
require 'set' # Fixes a bug in i18n 0.6.11
|
5
|
+
|
6
|
+
I18n.load_path += Dir[File.join(mydir, 'locales', '**/*.yml')]
|
7
|
+
I18n.reload! if I18n.backend.initialized?
|
8
|
+
|
3
9
|
module ConectaAddressBr
|
10
|
+
class Config
|
11
|
+
@locale = nil
|
12
|
+
|
13
|
+
class << self
|
14
|
+
attr_writer :locale
|
15
|
+
|
16
|
+
def locale
|
17
|
+
@locale || I18n.locale
|
18
|
+
end
|
19
|
+
|
20
|
+
def own_locale
|
21
|
+
@locale
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Base
|
4
27
|
def regexify(reg)
|
5
28
|
reg = reg.source if reg.respond_to?(:source) # Handle either a Regexp or a String that looks like a Regexp
|
6
29
|
reg
|
data/lib/locales/addressList.yml
CHANGED
@@ -1,9 +1,40 @@
|
|
1
1
|
brasil:
|
2
|
+
estados:
|
3
|
+
[
|
4
|
+
"Acre",
|
5
|
+
"Alagoas",
|
6
|
+
"Amapá",
|
7
|
+
"Amazonas",
|
8
|
+
"Bahia",
|
9
|
+
"Ceará",
|
10
|
+
"Distrito Federal",
|
11
|
+
"Espírito Santo",
|
12
|
+
"Goiás",
|
13
|
+
"Maranhão",
|
14
|
+
"Mato Grosso",
|
15
|
+
"Mato Grosso do Sul",
|
16
|
+
"Minas Gerais",
|
17
|
+
"Paraíba",
|
18
|
+
"Paraná",
|
19
|
+
"Pará",
|
20
|
+
"Pernambuco",
|
21
|
+
"Piauí",
|
22
|
+
"Rio de Janeiro",
|
23
|
+
"Rio Grande do Norte",
|
24
|
+
"Rio Grande do Sul",
|
25
|
+
"Rondônia",
|
26
|
+
"Roraima",
|
27
|
+
"Santa Catarina",
|
28
|
+
"São Paulo",
|
29
|
+
"Sergipe",
|
30
|
+
"Tocantins"
|
31
|
+
]
|
2
32
|
AC:
|
3
33
|
AL:
|
4
34
|
AP:
|
5
35
|
AM:
|
6
36
|
BA:
|
37
|
+
CE:
|
7
38
|
DF:
|
8
39
|
ES:
|
9
40
|
GO:
|
@@ -17,7 +48,7 @@ brasil:
|
|
17
48
|
PI:
|
18
49
|
RJ:
|
19
50
|
[
|
20
|
-
"Niterói",
|
51
|
+
"Niterói",
|
21
52
|
"Rio de Janeiro",
|
22
53
|
"São Gonçalo",
|
23
54
|
"Macaé"
|
metadata
CHANGED
@@ -1,15 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conecta_address_br
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Eduardo Martins
|
7
|
+
- Daniel Lessa, Eduardo Martins
|
8
|
+
- Matheus Erthal
|
8
9
|
autorequire:
|
9
10
|
bindir: exe
|
10
11
|
cert_chain: []
|
11
12
|
date: 2019-11-06 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: i18n
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.6'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '1.8'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '1.6'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.8'
|
13
34
|
- !ruby/object:Gem::Dependency
|
14
35
|
name: bundler
|
15
36
|
requirement: !ruby/object:Gem::Requirement
|
@@ -40,19 +61,12 @@ dependencies:
|
|
40
61
|
version: '10.0'
|
41
62
|
description: Responsável por relacionar localmente os estados e as cidades brasileiras.
|
42
63
|
email:
|
43
|
-
-
|
64
|
+
- tecnologia@conectaai.com
|
44
65
|
executables: []
|
45
66
|
extensions: []
|
46
67
|
extra_rdoc_files: []
|
47
68
|
files:
|
48
|
-
- ".gitignore"
|
49
|
-
- Gemfile
|
50
|
-
- Gemfile.lock
|
51
69
|
- README.md
|
52
|
-
- Rakefile
|
53
|
-
- bin/console
|
54
|
-
- bin/setup
|
55
|
-
- conecta_address_br.gemspec
|
56
70
|
- lib/conecta_address_br.rb
|
57
71
|
- lib/conecta_address_br/states/states.rb
|
58
72
|
- lib/conecta_address_br/version.rb
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
conecta_address_br (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
rake (10.5.0)
|
10
|
-
|
11
|
-
PLATFORMS
|
12
|
-
ruby
|
13
|
-
|
14
|
-
DEPENDENCIES
|
15
|
-
bundler (~> 2.0)
|
16
|
-
conecta_address_br!
|
17
|
-
rake (~> 10.0)
|
18
|
-
|
19
|
-
BUNDLED WITH
|
20
|
-
2.0.2
|
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "conecta_address_br"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/conecta_address_br.gemspec
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
lib = File.expand_path("lib", __dir__)
|
2
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require "conecta_address_br/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "conecta_address_br"
|
7
|
-
spec.version = ConectaAddressBr::VERSION
|
8
|
-
spec.authors = ["Eduardo Martins"]
|
9
|
-
spec.email = ["eduardomg@id.uff.br"]
|
10
|
-
|
11
|
-
spec.summary = %q{Estados e Cidades do Brasil.}
|
12
|
-
spec.description = %q{Responsável por relacionar localmente os estados e as cidades brasileiras.}
|
13
|
-
spec.homepage = "https://github.com/conectaai/address-br"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
17
|
-
# spec.metadata["homepage_uri"] = spec.homepage
|
18
|
-
# spec.metadata["source_code_uri"] = "https://github.com/conectaai/address-br"
|
19
|
-
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
end
|
25
|
-
spec.bindir = "exe"
|
26
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
-
spec.require_paths = ["lib"]
|
28
|
-
|
29
|
-
spec.add_development_dependency "bundler", "~> 2.0"
|
30
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
-
end
|