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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8b7aefc93d38da2a23783246342051799bae1e0cee0beb842e80c85e10afde8
4
- data.tar.gz: f0a528f4432d060b5c3518cc268a8278facf36bfae9ce8c8e1e701a8db282373
3
+ metadata.gz: 0bfef5ece6adb70826e8aaf5cb4de07334fef2895b25c1f1e26f24da8cb900bd
4
+ data.tar.gz: 1a8d54f3e9243df143b578d160a397e1495cc6ed031a532d7fcc94252d2aa060
5
5
  SHA512:
6
- metadata.gz: 5aaa4ea4c71395e3b013f101f69590f9c94f453ff220169957627f6f894039bc571fe9a11e436114d1fde4873fed8f9ef69c7fea7f277b19a171b06862e2a3a7
7
- data.tar.gz: '0893608e98e986999b174ded384a14f881be7e2113074691293d3d5f8021fb920748ddc68e96df20e0a62f8c75f0ef57e188eb57d9402b39181133cb87c1d2bd'
6
+ metadata.gz: 7b21f6f15b7a15d200996f65be233065e6da0b5905fddf253026dfc2d356c0896137409dc0af6598f346905fe86f578d12af2553ffae4b073bd4ffe0f94995ee
7
+ data.tar.gz: f08065a0337b9befbe5bc24015faeff49c80a12f82e47535884ba7dddb8ed45b76c895412facade5c17f94be9b8166f130c664b7eb820a6ead9c7d0cca09f3ff
data/.codeclimate.yml CHANGED
@@ -7,4 +7,4 @@ plugins:
7
7
  file: ".rubocop.yml"
8
8
  exclude_patterns:
9
9
  - "spec/"
10
- - "!spec/support/helpers"
10
+ - "spec/**/*"
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- autocomplete_zipcode (2.0.0)
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.org/marcelobarreto/autocomplete_zipcode)
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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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
- 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
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 { |f| f.match(%r{^(test|spec|features)/}) }
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.add_development_dependency 'rails', '>= 4.2.0'
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.setup do |config|
12
- config.custom_inputs_namespaces << "AutocompleteZipcode"
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
@@ -4,13 +4,5 @@ require 'autocomplete_zipcode/version'
4
4
  require 'rails'
5
5
 
6
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
7
+ class Engine < ::Rails::Engine; end
16
8
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AutocompleteZicode
4
- VERSION = '2.0.0'
4
+ VERSION = '2.1.1'
5
5
  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.0.0
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: 4.2.0
20
- type: :development
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: 4.2.0
26
+ version: 3.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jquery-rails
29
29
  requirement: !ruby/object:Gem::Requirement