autocomplete_zipcode 0.1.1 → 2.0.0
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 +5 -5
- data/.codeclimate.yml +10 -0
- data/.github/pull_request_template.md +19 -0
- data/.gitignore +5 -1
- data/.rspec +1 -2
- data/.rubocop.yml +7 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +13 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +209 -0
- data/Makefile +2 -0
- data/README.md +123 -0
- data/Rakefile +7 -1
- data/app/inputs/autocomplete_zipcode/city_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/ibge_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/neighborhood_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/state_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/state_select_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/street_input.rb +9 -0
- data/app/inputs/autocomplete_zipcode/zipcode_input.rb +9 -0
- data/autocomplete_zipcode.gemspec +21 -12
- data/bin/console +7 -7
- data/bin/rails +19 -0
- data/config/initializers/simple_form_autocomplete_zipcode.rb +13 -0
- data/lib/autocomplete_zipcode.rb +13 -6
- data/lib/autocomplete_zipcode/version.rb +3 -1
- data/vendor/assets/javascripts/autocomplete_zipcode.js +45 -22
- metadata +125 -114
- data/example/.gitignore +0 -21
- data/example/Gemfile +0 -55
- data/example/Gemfile.lock +0 -186
- data/example/README.md +0 -24
- data/example/Rakefile +0 -6
- data/example/app/assets/config/manifest.js +0 -3
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/javascripts/addresses.coffee +0 -3
- data/example/app/assets/javascripts/application.js +0 -17
- data/example/app/assets/javascripts/cable.js +0 -13
- data/example/app/assets/javascripts/channels/.keep +0 -0
- data/example/app/assets/stylesheets/addresses.scss +0 -3
- data/example/app/assets/stylesheets/application.css +0 -15
- data/example/app/assets/stylesheets/scaffolds.scss +0 -89
- data/example/app/channels/application_cable/channel.rb +0 -4
- data/example/app/channels/application_cable/connection.rb +0 -4
- data/example/app/controllers/addresses_controller.rb +0 -74
- data/example/app/controllers/application_controller.rb +0 -3
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/helpers/addresses_helper.rb +0 -2
- data/example/app/helpers/application_helper.rb +0 -2
- data/example/app/jobs/application_job.rb +0 -2
- data/example/app/mailers/application_mailer.rb +0 -4
- data/example/app/models/address.rb +0 -2
- data/example/app/models/application_record.rb +0 -3
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/views/addresses/_address.json.jbuilder +0 -2
- data/example/app/views/addresses/_form.html.erb +0 -17
- data/example/app/views/addresses/edit.html.erb +0 -6
- data/example/app/views/addresses/index.html.erb +0 -33
- data/example/app/views/addresses/index.json.jbuilder +0 -1
- data/example/app/views/addresses/new.html.erb +0 -5
- data/example/app/views/addresses/show.html.erb +0 -24
- data/example/app/views/addresses/show.json.jbuilder +0 -1
- data/example/app/views/layouts/application.html.erb +0 -14
- data/example/app/views/layouts/mailer.html.erb +0 -13
- data/example/app/views/layouts/mailer.text.erb +0 -1
- data/example/bin/bundle +0 -3
- data/example/bin/rails +0 -9
- data/example/bin/rake +0 -9
- data/example/bin/setup +0 -34
- data/example/bin/spring +0 -17
- data/example/bin/update +0 -29
- data/example/config.ru +0 -5
- data/example/config/application.rb +0 -15
- data/example/config/boot.rb +0 -3
- data/example/config/cable.yml +0 -9
- data/example/config/database.yml +0 -25
- data/example/config/environment.rb +0 -5
- data/example/config/environments/development.rb +0 -54
- data/example/config/environments/production.rb +0 -86
- data/example/config/environments/test.rb +0 -42
- data/example/config/initializers/application_controller_renderer.rb +0 -6
- data/example/config/initializers/assets.rb +0 -11
- data/example/config/initializers/backtrace_silencers.rb +0 -7
- data/example/config/initializers/cookies_serializer.rb +0 -5
- data/example/config/initializers/filter_parameter_logging.rb +0 -4
- data/example/config/initializers/inflections.rb +0 -16
- data/example/config/initializers/mime_types.rb +0 -4
- data/example/config/initializers/new_framework_defaults.rb +0 -24
- data/example/config/initializers/session_store.rb +0 -3
- data/example/config/initializers/simple_form.rb +0 -169
- data/example/config/initializers/wrap_parameters.rb +0 -14
- data/example/config/locales/en.yml +0 -23
- data/example/config/locales/simple_form.en.yml +0 -31
- data/example/config/puma.rb +0 -47
- data/example/config/routes.rb +0 -4
- data/example/config/secrets.yml +0 -22
- data/example/config/spring.rb +0 -6
- data/example/db/migrate/20170425234824_create_addresses.rb +0 -13
- data/example/db/schema.rb +0 -25
- data/example/db/seeds.rb +0 -7
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/lib/templates/erb/scaffold/_form.html.erb +0 -13
- data/example/log/.keep +0 -0
- data/example/public/404.html +0 -67
- data/example/public/422.html +0 -67
- data/example/public/500.html +0 -66
- data/example/public/apple-touch-icon-precomposed.png +0 -0
- data/example/public/apple-touch-icon.png +0 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +0 -5
- data/example/test/controllers/.keep +0 -0
- data/example/test/controllers/addresses_controller_test.rb +0 -48
- data/example/test/fixtures/.keep +0 -0
- data/example/test/fixtures/addresses.yml +0 -13
- data/example/test/fixtures/files/.keep +0 -0
- data/example/test/helpers/.keep +0 -0
- data/example/test/integration/.keep +0 -0
- data/example/test/mailers/.keep +0 -0
- data/example/test/models/.keep +0 -0
- data/example/test/models/address_test.rb +0 -7
- data/example/test/test_helper.rb +0 -10
- data/example/tmp/.keep +0 -0
- data/example/vendor/assets/javascripts/.keep +0 -0
- data/example/vendor/assets/stylesheets/.keep +0 -0
- data/lib/autocomplete_zipcode/simple_form/city_input.rb +0 -7
- data/lib/autocomplete_zipcode/simple_form/neighborhood_input.rb +0 -7
- data/lib/autocomplete_zipcode/simple_form/state_input.rb +0 -7
- data/lib/autocomplete_zipcode/simple_form/street_input.rb +0 -7
- data/lib/autocomplete_zipcode/simple_form/zipcode_input.rb +0 -7
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::CityInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :city })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::IbgeInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :ibge })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::NeighborhoodInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :neighborhood })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::StateInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :state })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::StateSelectInput < SimpleForm::Inputs::CollectionSelectInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :state })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::StreetInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :street })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class AutocompleteZipcode::ZipcodeInput < SimpleForm::Inputs::StringInput
|
|
4
|
+
def input(wrapper_options)
|
|
5
|
+
input_html_options[:data] ||= {}
|
|
6
|
+
input_html_options[:data].merge!({ autocomplete_zipcode_provider: :zipcode })
|
|
7
|
+
super
|
|
8
|
+
end
|
|
9
|
+
end
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
5
|
require 'autocomplete_zipcode/version'
|
|
5
6
|
|
|
6
7
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
8
|
+
spec.name = 'autocomplete_zipcode'
|
|
8
9
|
spec.version = AutocompleteZicode::VERSION
|
|
9
|
-
spec.
|
|
10
|
-
spec.
|
|
10
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6')
|
|
11
|
+
spec.authors = ['Marcelo Barreto (@marcelobarreto)']
|
|
12
|
+
spec.email = ['marcelobarretojunior@gmail.com']
|
|
11
13
|
|
|
12
|
-
spec.summary =
|
|
13
|
-
spec.homepage =
|
|
14
|
+
spec.summary = 'Fill in your brazillian addresses automagically'
|
|
15
|
+
spec.homepage = 'https://github.com/marcelobarreto/autocomplete_zipcode'
|
|
14
16
|
|
|
15
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
16
|
-
spec.bindir =
|
|
18
|
+
spec.bindir = 'exe'
|
|
17
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
18
|
-
spec.require_paths = [
|
|
20
|
+
spec.require_paths = ['lib']
|
|
21
|
+
|
|
22
|
+
spec.add_development_dependency 'rails', '>= 4.2.0'
|
|
19
23
|
|
|
20
|
-
spec.add_development_dependency
|
|
21
|
-
spec.add_development_dependency
|
|
22
|
-
|
|
24
|
+
spec.add_development_dependency 'jquery-rails', '~> 4.4.0'
|
|
25
|
+
spec.add_development_dependency 'pry', '~> 0.14.0'
|
|
26
|
+
spec.add_development_dependency 'rake', '~> 13.0.3'
|
|
27
|
+
spec.add_development_dependency 'rspec-rails', '~> 5.0.0'
|
|
28
|
+
spec.add_development_dependency 'rubocop', '~> 1.12.0'
|
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.20.0'
|
|
30
|
+
spec.add_development_dependency 'simple_form', '>= 5.1.0'
|
|
31
|
+
spec.add_development_dependency 'sqlite3', '~> 1.4.2'
|
|
23
32
|
end
|
data/bin/console
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'rails'
|
|
6
|
+
require 'simple_form'
|
|
7
|
+
require 'autocomplete_zipcode'
|
|
5
8
|
|
|
6
9
|
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
10
|
# with your gem easier. You can also use a different console, if you like.
|
|
8
11
|
|
|
9
12
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
require "irb"
|
|
14
|
-
IRB.start
|
|
13
|
+
require 'pry'
|
|
14
|
+
Pry.start
|
data/bin/rails
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# This command will automatically be run when you run "rails" with Rails gems
|
|
5
|
+
# installed from the root of your application.
|
|
6
|
+
|
|
7
|
+
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
|
|
8
|
+
|
|
9
|
+
# Set up gems listed in the Gemfile.
|
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
|
|
11
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
|
12
|
+
|
|
13
|
+
require 'rails'
|
|
14
|
+
# Pick the frameworks you want:
|
|
15
|
+
require 'active_model/railtie'
|
|
16
|
+
require 'active_job/railtie'
|
|
17
|
+
require 'active_record/railtie'
|
|
18
|
+
require 'action_controller/railtie'
|
|
19
|
+
require 'rails/engine/commands'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
#
|
|
3
|
+
# Uncomment this and change the path if necessary to include your own
|
|
4
|
+
# components.
|
|
5
|
+
# See https://github.com/heartcombo/simple_form#custom-components to know
|
|
6
|
+
# more about custom components.
|
|
7
|
+
Dir[Rails.root.join('app/inputs/**/*.rb')].each { |f| require f }
|
|
8
|
+
#
|
|
9
|
+
# Use this setup block to configure all options available in SimpleForm.
|
|
10
|
+
|
|
11
|
+
SimpleForm.setup do |config|
|
|
12
|
+
config.custom_inputs_namespaces << "AutocompleteZipcode"
|
|
13
|
+
end
|
data/lib/autocomplete_zipcode.rb
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
end
|
|
3
|
+
require 'autocomplete_zipcode/version'
|
|
4
|
+
require 'rails'
|
|
6
5
|
|
|
7
|
-
module
|
|
8
|
-
|
|
6
|
+
module AutocompleteZipcode
|
|
7
|
+
if defined?(SimpleForm)
|
|
8
|
+
autoload :ZipcodeInput, 'app/inputs/autocomplete_zipcode/zipcode_input'
|
|
9
|
+
autoload :StreetInput, 'app/inputs/autocomplete_zipcode/street_input'
|
|
10
|
+
autoload :NeighborhoodInput, 'app/inputs/autocomplete_zipcode/neighborhood_input'
|
|
11
|
+
autoload :CityInput, 'app/inputs/autocomplete_zipcode/city_input'
|
|
12
|
+
autoload :StateInput, 'app/inputs/autocomplete_zipcode/state_input'
|
|
13
|
+
autoload :StateSelectInput, 'app/inputs/autocomplete_zipcode/state_select_input'
|
|
14
|
+
autoload :IbgeInput, 'app/inputs/autocomplete_zipcode/ibge_input'
|
|
15
|
+
end
|
|
9
16
|
end
|
|
@@ -1,24 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const AutocompleteZipcode = {
|
|
2
|
+
config: {
|
|
3
|
+
container: 'form',
|
|
4
|
+
selectorPrefix: 'data-autocomplete-zipcode-provider',
|
|
5
|
+
serviceUrl: ({ zipcode }) => `https://viacep.com.br/ws/${zipcode}/json`,
|
|
6
|
+
},
|
|
7
|
+
inputs: {
|
|
8
|
+
street: 'logradouro',
|
|
9
|
+
neighborhood: 'bairro',
|
|
10
|
+
city: 'localidade',
|
|
11
|
+
state: 'uf',
|
|
12
|
+
ibge: 'ibge',
|
|
13
|
+
},
|
|
14
|
+
mount: ({ onSuccess, onFail, config = AutocompleteZipcode.config }) => {
|
|
15
|
+
if (typeof jQuery === 'undefined') {
|
|
16
|
+
console.error('jQuery is required by autocomplete_zipcode gem')
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const { inputs } = AutocompleteZipcode;
|
|
20
|
+
const { container, selectorPrefix, serviceUrl } = config;
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
21
|
-
};
|
|
22
|
+
const observable = $(container).find(`[${selectorPrefix}="zipcode"]`);
|
|
23
|
+
|
|
24
|
+
observable.keyup((e) => {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
e.stopPropagation();
|
|
22
27
|
|
|
23
|
-
|
|
24
|
-
$(
|
|
28
|
+
const { target: { value } } = e;
|
|
29
|
+
const $el = $(e.target);
|
|
30
|
+
const $container = $el.parents().closest($(container));
|
|
31
|
+
const zipcode = value.replace(/[^0-9]/g, '');
|
|
32
|
+
|
|
33
|
+
if (zipcode.length === 8) {
|
|
34
|
+
$.get(serviceUrl({ zipcode })).then(response => {
|
|
35
|
+
if (response.erro) {
|
|
36
|
+
onFail?.call(this, $container[0], $el[0]);
|
|
37
|
+
document.dispatchEvent(new Event('zipcode.error'));
|
|
38
|
+
} else {
|
|
39
|
+
for (var key in inputs) $container.find(`[${selectorPrefix}="${key}"]`).val(response[inputs[key]]);
|
|
40
|
+
onSuccess?.call(this, $container[0], $el[0]);
|
|
41
|
+
document.dispatchEvent(new Event('zipcode.success'));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
};
|
metadata
CHANGED
|
@@ -1,43 +1,141 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: autocomplete_zipcode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Marcelo Barreto
|
|
7
|
+
- Marcelo Barreto (@marcelobarreto)
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-04-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: rails
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 4.2.0
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 4.2.0
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: jquery-rails
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
16
30
|
requirements:
|
|
17
31
|
- - "~>"
|
|
18
32
|
- !ruby/object:Gem::Version
|
|
19
|
-
version:
|
|
33
|
+
version: 4.4.0
|
|
20
34
|
type: :development
|
|
21
35
|
prerelease: false
|
|
22
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
37
|
requirements:
|
|
24
38
|
- - "~>"
|
|
25
39
|
- !ruby/object:Gem::Version
|
|
26
|
-
version:
|
|
40
|
+
version: 4.4.0
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: pry
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: 0.14.0
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: 0.14.0
|
|
27
55
|
- !ruby/object:Gem::Dependency
|
|
28
56
|
name: rake
|
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
|
30
58
|
requirements:
|
|
31
59
|
- - "~>"
|
|
32
60
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
61
|
+
version: 13.0.3
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: 13.0.3
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rspec-rails
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: 5.0.0
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: 5.0.0
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: rubocop
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: 1.12.0
|
|
34
90
|
type: :development
|
|
35
91
|
prerelease: false
|
|
36
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
93
|
requirements:
|
|
38
94
|
- - "~>"
|
|
39
95
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
96
|
+
version: 1.12.0
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: simplecov
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: 0.20.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.20.0
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: simple_form
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - ">="
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: 5.1.0
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - ">="
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: 5.1.0
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: sqlite3
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - "~>"
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: 1.4.2
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - "~>"
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: 1.4.2
|
|
41
139
|
description:
|
|
42
140
|
email:
|
|
43
141
|
- marcelobarretojunior@gmail.com
|
|
@@ -45,118 +143,32 @@ executables: []
|
|
|
45
143
|
extensions: []
|
|
46
144
|
extra_rdoc_files: []
|
|
47
145
|
files:
|
|
146
|
+
- ".codeclimate.yml"
|
|
147
|
+
- ".github/pull_request_template.md"
|
|
48
148
|
- ".gitignore"
|
|
49
149
|
- ".rspec"
|
|
150
|
+
- ".rubocop.yml"
|
|
151
|
+
- ".ruby-gemset"
|
|
152
|
+
- ".ruby-version"
|
|
50
153
|
- ".travis.yml"
|
|
51
154
|
- Gemfile
|
|
155
|
+
- Gemfile.lock
|
|
156
|
+
- Makefile
|
|
52
157
|
- README.md
|
|
53
158
|
- Rakefile
|
|
159
|
+
- app/inputs/autocomplete_zipcode/city_input.rb
|
|
160
|
+
- app/inputs/autocomplete_zipcode/ibge_input.rb
|
|
161
|
+
- app/inputs/autocomplete_zipcode/neighborhood_input.rb
|
|
162
|
+
- app/inputs/autocomplete_zipcode/state_input.rb
|
|
163
|
+
- app/inputs/autocomplete_zipcode/state_select_input.rb
|
|
164
|
+
- app/inputs/autocomplete_zipcode/street_input.rb
|
|
165
|
+
- app/inputs/autocomplete_zipcode/zipcode_input.rb
|
|
54
166
|
- autocomplete_zipcode.gemspec
|
|
55
167
|
- bin/console
|
|
168
|
+
- bin/rails
|
|
56
169
|
- bin/setup
|
|
57
|
-
-
|
|
58
|
-
- example/Gemfile
|
|
59
|
-
- example/Gemfile.lock
|
|
60
|
-
- example/README.md
|
|
61
|
-
- example/Rakefile
|
|
62
|
-
- example/app/assets/config/manifest.js
|
|
63
|
-
- example/app/assets/images/.keep
|
|
64
|
-
- example/app/assets/javascripts/addresses.coffee
|
|
65
|
-
- example/app/assets/javascripts/application.js
|
|
66
|
-
- example/app/assets/javascripts/cable.js
|
|
67
|
-
- example/app/assets/javascripts/channels/.keep
|
|
68
|
-
- example/app/assets/stylesheets/addresses.scss
|
|
69
|
-
- example/app/assets/stylesheets/application.css
|
|
70
|
-
- example/app/assets/stylesheets/scaffolds.scss
|
|
71
|
-
- example/app/channels/application_cable/channel.rb
|
|
72
|
-
- example/app/channels/application_cable/connection.rb
|
|
73
|
-
- example/app/controllers/addresses_controller.rb
|
|
74
|
-
- example/app/controllers/application_controller.rb
|
|
75
|
-
- example/app/controllers/concerns/.keep
|
|
76
|
-
- example/app/helpers/addresses_helper.rb
|
|
77
|
-
- example/app/helpers/application_helper.rb
|
|
78
|
-
- example/app/jobs/application_job.rb
|
|
79
|
-
- example/app/mailers/application_mailer.rb
|
|
80
|
-
- example/app/models/address.rb
|
|
81
|
-
- example/app/models/application_record.rb
|
|
82
|
-
- example/app/models/concerns/.keep
|
|
83
|
-
- example/app/views/addresses/_address.json.jbuilder
|
|
84
|
-
- example/app/views/addresses/_form.html.erb
|
|
85
|
-
- example/app/views/addresses/edit.html.erb
|
|
86
|
-
- example/app/views/addresses/index.html.erb
|
|
87
|
-
- example/app/views/addresses/index.json.jbuilder
|
|
88
|
-
- example/app/views/addresses/new.html.erb
|
|
89
|
-
- example/app/views/addresses/show.html.erb
|
|
90
|
-
- example/app/views/addresses/show.json.jbuilder
|
|
91
|
-
- example/app/views/layouts/application.html.erb
|
|
92
|
-
- example/app/views/layouts/mailer.html.erb
|
|
93
|
-
- example/app/views/layouts/mailer.text.erb
|
|
94
|
-
- example/bin/bundle
|
|
95
|
-
- example/bin/rails
|
|
96
|
-
- example/bin/rake
|
|
97
|
-
- example/bin/setup
|
|
98
|
-
- example/bin/spring
|
|
99
|
-
- example/bin/update
|
|
100
|
-
- example/config.ru
|
|
101
|
-
- example/config/application.rb
|
|
102
|
-
- example/config/boot.rb
|
|
103
|
-
- example/config/cable.yml
|
|
104
|
-
- example/config/database.yml
|
|
105
|
-
- example/config/environment.rb
|
|
106
|
-
- example/config/environments/development.rb
|
|
107
|
-
- example/config/environments/production.rb
|
|
108
|
-
- example/config/environments/test.rb
|
|
109
|
-
- example/config/initializers/application_controller_renderer.rb
|
|
110
|
-
- example/config/initializers/assets.rb
|
|
111
|
-
- example/config/initializers/backtrace_silencers.rb
|
|
112
|
-
- example/config/initializers/cookies_serializer.rb
|
|
113
|
-
- example/config/initializers/filter_parameter_logging.rb
|
|
114
|
-
- example/config/initializers/inflections.rb
|
|
115
|
-
- example/config/initializers/mime_types.rb
|
|
116
|
-
- example/config/initializers/new_framework_defaults.rb
|
|
117
|
-
- example/config/initializers/session_store.rb
|
|
118
|
-
- example/config/initializers/simple_form.rb
|
|
119
|
-
- example/config/initializers/wrap_parameters.rb
|
|
120
|
-
- example/config/locales/en.yml
|
|
121
|
-
- example/config/locales/simple_form.en.yml
|
|
122
|
-
- example/config/puma.rb
|
|
123
|
-
- example/config/routes.rb
|
|
124
|
-
- example/config/secrets.yml
|
|
125
|
-
- example/config/spring.rb
|
|
126
|
-
- example/db/migrate/20170425234824_create_addresses.rb
|
|
127
|
-
- example/db/schema.rb
|
|
128
|
-
- example/db/seeds.rb
|
|
129
|
-
- example/lib/assets/.keep
|
|
130
|
-
- example/lib/tasks/.keep
|
|
131
|
-
- example/lib/templates/erb/scaffold/_form.html.erb
|
|
132
|
-
- example/log/.keep
|
|
133
|
-
- example/public/404.html
|
|
134
|
-
- example/public/422.html
|
|
135
|
-
- example/public/500.html
|
|
136
|
-
- example/public/apple-touch-icon-precomposed.png
|
|
137
|
-
- example/public/apple-touch-icon.png
|
|
138
|
-
- example/public/favicon.ico
|
|
139
|
-
- example/public/robots.txt
|
|
140
|
-
- example/test/controllers/.keep
|
|
141
|
-
- example/test/controllers/addresses_controller_test.rb
|
|
142
|
-
- example/test/fixtures/.keep
|
|
143
|
-
- example/test/fixtures/addresses.yml
|
|
144
|
-
- example/test/fixtures/files/.keep
|
|
145
|
-
- example/test/helpers/.keep
|
|
146
|
-
- example/test/integration/.keep
|
|
147
|
-
- example/test/mailers/.keep
|
|
148
|
-
- example/test/models/.keep
|
|
149
|
-
- example/test/models/address_test.rb
|
|
150
|
-
- example/test/test_helper.rb
|
|
151
|
-
- example/tmp/.keep
|
|
152
|
-
- example/vendor/assets/javascripts/.keep
|
|
153
|
-
- example/vendor/assets/stylesheets/.keep
|
|
170
|
+
- config/initializers/simple_form_autocomplete_zipcode.rb
|
|
154
171
|
- lib/autocomplete_zipcode.rb
|
|
155
|
-
- lib/autocomplete_zipcode/simple_form/city_input.rb
|
|
156
|
-
- lib/autocomplete_zipcode/simple_form/neighborhood_input.rb
|
|
157
|
-
- lib/autocomplete_zipcode/simple_form/state_input.rb
|
|
158
|
-
- lib/autocomplete_zipcode/simple_form/street_input.rb
|
|
159
|
-
- lib/autocomplete_zipcode/simple_form/zipcode_input.rb
|
|
160
172
|
- lib/autocomplete_zipcode/version.rb
|
|
161
173
|
- vendor/assets/javascripts/.keep
|
|
162
174
|
- vendor/assets/javascripts/autocomplete_zipcode.js
|
|
@@ -171,16 +183,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
171
183
|
requirements:
|
|
172
184
|
- - ">="
|
|
173
185
|
- !ruby/object:Gem::Version
|
|
174
|
-
version: '
|
|
186
|
+
version: '2.6'
|
|
175
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
176
188
|
requirements:
|
|
177
189
|
- - ">="
|
|
178
190
|
- !ruby/object:Gem::Version
|
|
179
191
|
version: '0'
|
|
180
192
|
requirements: []
|
|
181
|
-
|
|
182
|
-
rubygems_version: 2.6.11
|
|
193
|
+
rubygems_version: 3.0.8
|
|
183
194
|
signing_key:
|
|
184
195
|
specification_version: 4
|
|
185
|
-
summary: Fill in your
|
|
196
|
+
summary: Fill in your brazillian addresses automagically
|
|
186
197
|
test_files: []
|