autocomplete_zipcode 2.0.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/app/inputs/autocomplete_zipcode/city_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/ibge_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/neighborhood_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/state_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/state_select_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/street_input.rb +7 -5
- data/app/inputs/autocomplete_zipcode/zipcode_input.rb +7 -5
- data/autocomplete_zipcode.gemspec +5 -2
- data/config/initializers/simple_form_autocomplete_zipcode.rb +6 -10
- data/lib/autocomplete_zipcode.rb +1 -9
- data/lib/autocomplete_zipcode/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bfef5ece6adb70826e8aaf5cb4de07334fef2895b25c1f1e26f24da8cb900bd
|
4
|
+
data.tar.gz: 1a8d54f3e9243df143b578d160a397e1495cc6ed031a532d7fcc94252d2aa060
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b21f6f15b7a15d200996f65be233065e6da0b5905fddf253026dfc2d356c0896137409dc0af6598f346905fe86f578d12af2553ffae4b073bd4ffe0f94995ee
|
7
|
+
data.tar.gz: f08065a0337b9befbe5bc24015faeff49c80a12f82e47535884ba7dddb8ed45b76c895412facade5c17f94be9b8166f130c664b7eb820a6ead9c7d0cca09f3ff
|
data/.codeclimate.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
autocomplete_zipcode (2.
|
4
|
+
autocomplete_zipcode (2.1.1)
|
5
|
+
rails (>= 3.1.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
@@ -197,7 +198,6 @@ DEPENDENCIES
|
|
197
198
|
autocomplete_zipcode!
|
198
199
|
jquery-rails (~> 4.4.0)
|
199
200
|
pry (~> 0.14.0)
|
200
|
-
rails (>= 4.2.0)
|
201
201
|
rake (~> 13.0.3)
|
202
202
|
rspec-rails (~> 5.0.0)
|
203
203
|
rubocop (~> 1.12.0)
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This gem was built to "automagically" fills an address form, for Rails version >
|
|
4
4
|
|
5
5
|
## Status
|
6
6
|
|
7
|
-
[![Build Status](https://api.travis-ci.com/marcelobarreto/autocomplete_zipcode.svg?branch=master)](https://travis-ci.
|
7
|
+
[![Build Status](https://api.travis-ci.com/marcelobarreto/autocomplete_zipcode.svg?branch=master)](https://travis-ci.com/marcelobarreto/autocomplete_zipcode)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/37008f3eeaaf2ea47122/maintainability)](https://codeclimate.com/github/marcelobarreto/autocomplete_zipcode/maintainability)
|
9
9
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/37008f3eeaaf2ea47122/test_coverage)](https://codeclimate.com/github/marcelobarreto/autocomplete_zipcode/test_coverage)
|
10
10
|
[![RubyGems](http://img.shields.io/gem/dt/autocomplete_zipcode.svg?style=flat)](http://rubygems.org/gems/autocomplete_zipcode)
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class CityInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :city
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class IbgeInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :ibge
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class NeighborhoodInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :neighborhood
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class StateInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :state
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class StateSelectInput < SimpleForm::Inputs::CollectionSelectInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :state
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class StreetInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :street
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,9 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
module AutocompleteZipcode
|
4
|
+
class ZipcodeInput < SimpleForm::Inputs::StringInput
|
5
|
+
def input(wrapper_options)
|
6
|
+
input_html_options[:data] ||= {}
|
7
|
+
input_html_options[:data][:autocomplete_zipcode_provider] = :zipcode
|
8
|
+
super
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -14,12 +14,15 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.summary = 'Fill in your brazillian addresses automagically'
|
15
15
|
spec.homepage = 'https://github.com/marcelobarreto/autocomplete_zipcode'
|
16
16
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
|
18
21
|
spec.bindir = 'exe'
|
19
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
23
|
spec.require_paths = ['lib']
|
21
24
|
|
22
|
-
spec.
|
25
|
+
spec.add_dependency 'rails', '>= 3.1.0'
|
23
26
|
|
24
27
|
spec.add_development_dependency 'jquery-rails', '~> 4.4.0'
|
25
28
|
spec.add_development_dependency 'pry', '~> 0.14.0'
|
@@ -1,13 +1,9 @@
|
|
1
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
2
|
|
11
|
-
SimpleForm
|
12
|
-
|
3
|
+
if defined?(SimpleForm)
|
4
|
+
Dir[Rails.root.join('app/inputs/**/*.rb')].sort.each { |f| require f }
|
5
|
+
|
6
|
+
SimpleForm.setup do |config|
|
7
|
+
config.custom_inputs_namespaces << 'AutocompleteZipcode'
|
8
|
+
end
|
13
9
|
end
|
data/lib/autocomplete_zipcode.rb
CHANGED
@@ -4,13 +4,5 @@ require 'autocomplete_zipcode/version'
|
|
4
4
|
require 'rails'
|
5
5
|
|
6
6
|
module AutocompleteZipcode
|
7
|
-
|
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
|
7
|
+
class Engine < ::Rails::Engine; end
|
16
8
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autocomplete_zipcode
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Barreto (@marcelobarreto)
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
19
|
+
version: 3.1.0
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jquery-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|