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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f2c3f0f4ec5466f048ce3ff648bc69d167caced131d06a725c19a1d0f5df49f
4
- data.tar.gz: 2ce9412887f26d241fe597ca726067af2eec4e8bf9a6f9844d8ac4b89d802fd1
3
+ metadata.gz: 2cf32dbcd6da21369dc137964c7a28497d6f847ce7972df80d5db802b7c6c938
4
+ data.tar.gz: 8bd41c3d2531bcfde8e13f03b5c482b57e022c5d06e8d9c414f8e4daf48016e2
5
5
  SHA512:
6
- metadata.gz: c2c46d72d0269bec5a024c3ec5687f14f0b28683e28f9dbceb37e1a7e44faecbeae88d1fd67e9c3c421df6e48fa453b907ac238eb615abc6c9d96e63a6334f5a
7
- data.tar.gz: fc4a7023824fe56e2d6b7dd63f9bbb61f593ed0810fa7902eca1a2fa38585027a651a42460702bc840bca15c413bd4b43da8206aec77a04a25b111fedb02b102
6
+ metadata.gz: fb46412dc4446f95bc32a324edf56b756f1c9f4bdeea7c3811debf62bf10b7b2a1b76565933d101bc301cd2800651feb0c4653e2487c6187ba9fe8464bcc88dc
7
+ data.tar.gz: 0b3f3c030b06732012b575e82defc79a6bc7b97b4801d9910f8b5c477ccfb7e8152d3588c6377bf2b6d215695a2dfd5ddbca09a6b7db83bdb48154fbe5e43524
@@ -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
@@ -1,6 +1,10 @@
1
1
  module ConectaAddressBr
2
2
  class States
3
- def cidades(sigla)
3
+ def all
4
+ fetch("BR.estados")
5
+ end
6
+
7
+ def cities(sigla)
4
8
  fetch("BR.#{sigla}")
5
9
  end
6
10
  end
@@ -1,3 +1,3 @@
1
1
  module ConectaAddressBr
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.0
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
- - eduardomg@id.uff.br
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
@@ -1,8 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in conecta_address_br.gemspec
4
- gemspec
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
@@ -1,2 +0,0 @@
1
- require "bundler/gem_tasks"
2
- task :default => :spec
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
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
@@ -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