active_admin-cep_auto_complete 0.1.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 +7 -0
- data/.editorconfig +13 -0
- data/.gitignore +4 -0
- data/CONTRIBUTING.md +39 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +93 -0
- data/Rakefile +9 -0
- data/active_admin-cep_auto_complete.gemspec +27 -0
- data/app/assets/javascripts/active_admin/cep_auto_complete.js +94 -0
- data/app/assets/javascripts/active_admin/utils.js +19 -0
- data/lib/active_admin/cep_auto_complete.rb +21 -0
- data/lib/active_admin/cep_auto_complete/dsl.rb +39 -0
- data/lib/active_admin/cep_auto_complete/engine.rb +6 -0
- data/lib/active_admin/cep_auto_complete/page.rb +9 -0
- data/lib/active_admin/cep_auto_complete/query.rb +19 -0
- data/lib/active_admin/cep_auto_complete/renderer.rb +45 -0
- data/lib/active_admin/cep_auto_complete/version.rb +10 -0
- data/lib/formtastic/inputs/cep_input.rb +60 -0
- metadata +174 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ee29d09bb0a517cf7e3ee20b168b6ec7bfbc38cc
|
4
|
+
data.tar.gz: f01eab45e449e4cd1c18ee2c8b72d3852c0949db
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4781b7af4563d7a3b843b1510a9325de5b4833aa38d119ba9a306c8842dc42431a1783d8554e75d4a962f351c8b3d87df4bd7de50092236bb69fc0d99b3b8ff9
|
7
|
+
data.tar.gz: 5bd3c1d34ca55f0c7f0159276127359e4bbcf5f7e43bdef18ec795ff79430d320758d4779686cf18873b06f43513c138043b04893cb11f0dbec96a6df7f00497
|
data/.editorconfig
ADDED
data/.gitignore
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
## Issues
|
4
|
+
|
5
|
+
If you want to request a feature or report a bug, please use the following template.
|
6
|
+
|
7
|
+
```markdown
|
8
|
+
## Description
|
9
|
+
|
10
|
+
[Add feature/bug description here]
|
11
|
+
|
12
|
+
## How to reproduce
|
13
|
+
|
14
|
+
[Add steps on how to reproduce this issue]
|
15
|
+
|
16
|
+
## What do you expect
|
17
|
+
|
18
|
+
[Describe what do you expect to happen]
|
19
|
+
|
20
|
+
## What happened instead
|
21
|
+
|
22
|
+
[Describe the actual results]
|
23
|
+
|
24
|
+
## Gem version:
|
25
|
+
|
26
|
+
Version: [Add gem version here]
|
27
|
+
```
|
28
|
+
|
29
|
+
## Writing code
|
30
|
+
|
31
|
+
Once you've made your great commits (include tests, please):
|
32
|
+
|
33
|
+
1. [Fork](http://help.github.com/forking/) the [original repository](http://github.com/dhyegofernando/active_admin-cep_auto_complete)
|
34
|
+
2. Create a topic branch - `git checkout -b my_branch`
|
35
|
+
3. Push to your branch - `git push origin my_branch`
|
36
|
+
4. [Create an Issue](http://github.com/dhyegofernando/active_admin-cep_auto_complete/issues) with a link to your branch
|
37
|
+
5. That's it!
|
38
|
+
|
39
|
+
Please respect the code style using [editorconfig](http://editorconfig.org/) in your text editor.
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Dhyego Fernando
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# ActiveAdmin CEP Auto Complete (brazilian postal code)
|
2
|
+
Auto complete your addresses fields with Brazilian CEP (zip code).
|
3
|
+
|
4
|
+
## Installation
|
5
|
+
Include to your Gemfile
|
6
|
+
```ruby
|
7
|
+
gem 'active_admin-cep_auto_complete'
|
8
|
+
```
|
9
|
+
|
10
|
+
## Usage
|
11
|
+
**1. Create a custom page in `app/admin/cep.rb`**
|
12
|
+
```ruby
|
13
|
+
ActiveAdmin.register_page 'CEP' do
|
14
|
+
include ActiveAdmin::CepAutoComplete::Page
|
15
|
+
end
|
16
|
+
```
|
17
|
+
|
18
|
+
**2. Add a CEP Input**
|
19
|
+
```ruby
|
20
|
+
f.input :cep, as: :cep
|
21
|
+
f.input :street
|
22
|
+
f.input :state
|
23
|
+
f.input :city
|
24
|
+
f.input :neighborhood
|
25
|
+
```
|
26
|
+
|
27
|
+
*p.s. if you have a different input name, you'll have to change your [URL option](https://github.com/dhyegofernando/active_admin-cep_auto_complete#options).*
|
28
|
+
|
29
|
+
**3. It works!!**
|
30
|
+
|
31
|
+
## Options
|
32
|
+
|
33
|
+
**Input options**
|
34
|
+
|
35
|
+
Option | Type | Default | Description
|
36
|
+
--- | --- | --- | ---
|
37
|
+
`url` | *string* | Singular name of the input. e.g. `/cep` | The route URL that CEP will be fetched from.
|
38
|
+
`fields` | *array* | `[:street, :state, :city, :neighborhood]` | The inputs names which will be auto completed.
|
39
|
+
|
40
|
+
## Custom fields
|
41
|
+
|
42
|
+
If you want to add any custom field to be autocompleted, just do the follow:
|
43
|
+
|
44
|
+
**1. Add to the CEP input options**
|
45
|
+
```ruby
|
46
|
+
f.input :cep, as: :cep, fields: [:state_id]
|
47
|
+
f.input :state_id
|
48
|
+
```
|
49
|
+
|
50
|
+
**2. Add the render method to the controller**
|
51
|
+
```ruby
|
52
|
+
ActiveAdmin.register_page 'CEP' do
|
53
|
+
setup_cep_auto_complete do
|
54
|
+
# New field
|
55
|
+
field :state_id do |cep|
|
56
|
+
state = State.where("title LIKE '%?%'", cep.state).take
|
57
|
+
|
58
|
+
if state.any?
|
59
|
+
state.id
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Another new field that uses a result from other one
|
64
|
+
field :some_other_field do |cep|
|
65
|
+
"State number #{cep.state_id}"
|
66
|
+
end
|
67
|
+
|
68
|
+
# Override an original field
|
69
|
+
field :street do |cep|
|
70
|
+
"Street #{cep.street}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
```
|
75
|
+
|
76
|
+
**3. Now, the javascript will auto trigger the field with something like this:**
|
77
|
+
```javascript
|
78
|
+
$('#address_state_id').val(cep.state_id);
|
79
|
+
```
|
80
|
+
|
81
|
+
*p.s. it just a pseudo-code*
|
82
|
+
|
83
|
+
**If you want support a different plugin (like [select2](https://github.com/select2/select2)) or any other javascript render method, you can do:**
|
84
|
+
|
85
|
+
```javascript
|
86
|
+
$('#address_state_id').on('active_admin:cep_auto_complete', function(e, value, cep, input) {
|
87
|
+
$(this).val(cep.state_id);
|
88
|
+
$(this).trigger('change');
|
89
|
+
});
|
90
|
+
```
|
91
|
+
|
92
|
+
## Maintainer
|
93
|
+
[Dhyego Fernando](https://github.com/dhyegofernando)
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
$:.push File.expand_path('../lib', __FILE__)
|
2
|
+
|
3
|
+
require './lib/active_admin/cep_auto_complete/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'active_admin-cep_auto_complete'
|
7
|
+
spec.version = ActiveAdmin::CepAutoComplete::Version::STRING
|
8
|
+
spec.authors = ['Dhyego Fernando']
|
9
|
+
spec.email = ['dhyegofernando@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'Auto complete your addresses fields with Brazilian CEP (zip code).'
|
12
|
+
spec.description = spec.summary
|
13
|
+
spec.homepage = 'http://github.com/dhyegofernando/active_admin-cep_auto_complete'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
|
18
|
+
spec.add_dependency 'railties'
|
19
|
+
spec.add_dependency 'activeadmin', '>= 1.0.0.pre1'
|
20
|
+
spec.add_dependency 'postmon_ruby'
|
21
|
+
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'rake'
|
24
|
+
spec.add_development_dependency 'minitest'
|
25
|
+
spec.add_development_dependency 'minitest-utils'
|
26
|
+
spec.add_development_dependency 'pry-meta'
|
27
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
//= require active_admin/utils
|
2
|
+
|
3
|
+
(function(scope, $) {
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
function CepInput(input) {
|
7
|
+
this.input = input;
|
8
|
+
this.form = input.closest('form');
|
9
|
+
this.scope = this.input.data('scope');
|
10
|
+
this.url = this.input.data('url');
|
11
|
+
this.fields = this.input.data('fields').reduce(function(fields, field) {
|
12
|
+
fields[field] = this.findField(field);
|
13
|
+
return fields;
|
14
|
+
}.bind(this), {});
|
15
|
+
this.cepRegex = new RegExp(this.input.data('cepRegex'));
|
16
|
+
this.onChange = scope.Utils.debounce(this.onChange.bind(this), 300);
|
17
|
+
this.lastQuery = null;
|
18
|
+
this.attachEvents();
|
19
|
+
}
|
20
|
+
|
21
|
+
CepInput.attach = function(selector) {
|
22
|
+
$(selector).each(function() {
|
23
|
+
var self = $(this);
|
24
|
+
self.data('cepInput', new CepInput(self));
|
25
|
+
});
|
26
|
+
};
|
27
|
+
|
28
|
+
CepInput.prototype = {
|
29
|
+
attachEvents: function() {
|
30
|
+
this.input.on('keypress', this.onChange);
|
31
|
+
},
|
32
|
+
|
33
|
+
findField: function(field) {
|
34
|
+
return $('#' + this.scope + '_' + field);
|
35
|
+
},
|
36
|
+
|
37
|
+
onChange: function(e) {
|
38
|
+
if (this.isValid(e.delegateTarget.value)) {
|
39
|
+
this.query(e.delegateTarget.value);
|
40
|
+
}
|
41
|
+
},
|
42
|
+
|
43
|
+
isValid: function(value) {
|
44
|
+
return !!value.match(this.cepRegex);
|
45
|
+
},
|
46
|
+
|
47
|
+
query: function(value) {
|
48
|
+
if (this.lastQuery !== null) {
|
49
|
+
this.lastQuery.abort();
|
50
|
+
}
|
51
|
+
|
52
|
+
this.lockFields();
|
53
|
+
this.lastQuery = $.get(this.url, { cep: value })
|
54
|
+
.then(function(data) {
|
55
|
+
this.render(data);
|
56
|
+
this.lastQuery = null;
|
57
|
+
this.unlockFields();
|
58
|
+
}.bind(this))
|
59
|
+
.fail(function() {
|
60
|
+
this.lastQuery = null;
|
61
|
+
this.unlockFields();
|
62
|
+
}.bind(this));
|
63
|
+
},
|
64
|
+
|
65
|
+
render: function(data) {
|
66
|
+
$.each(this.fields, function(field, element) {
|
67
|
+
var value = data[field];
|
68
|
+
element.val(value);
|
69
|
+
element.trigger('change');
|
70
|
+
element.trigger('active_admin:cep_auto_complete', [value, data, this]);
|
71
|
+
}.bind(this));
|
72
|
+
},
|
73
|
+
|
74
|
+
lockFields: function() {
|
75
|
+
this.toggleFields(true);
|
76
|
+
},
|
77
|
+
|
78
|
+
unlockFields: function() {
|
79
|
+
this.toggleFields(false);
|
80
|
+
},
|
81
|
+
|
82
|
+
toggleFields: function(disabled) {
|
83
|
+
$.each(this.fields, function(field, element) {
|
84
|
+
element.prop('disabled', disabled);
|
85
|
+
});
|
86
|
+
}
|
87
|
+
};
|
88
|
+
|
89
|
+
$(document).ready(function() {
|
90
|
+
CepInput.attach('.cep-auto-complete');
|
91
|
+
});
|
92
|
+
|
93
|
+
scope.CepInput = CepInput;
|
94
|
+
}(window.ActiveAdmin, jQuery));
|
@@ -0,0 +1,19 @@
|
|
1
|
+
(function(scope) {
|
2
|
+
'use strict';
|
3
|
+
|
4
|
+
scope.Utils = scope.Utils || {};
|
5
|
+
scope.Utils.debounce = function debounce(func, wait, immediate) {
|
6
|
+
var timeout;
|
7
|
+
return function() {
|
8
|
+
var context = this, args = arguments;
|
9
|
+
var later = function() {
|
10
|
+
timeout = null;
|
11
|
+
if (!immediate) func.apply(context, args);
|
12
|
+
};
|
13
|
+
var callNow = immediate && !timeout;
|
14
|
+
clearTimeout(timeout);
|
15
|
+
timeout = setTimeout(later, wait);
|
16
|
+
if (callNow) func.apply(context, args);
|
17
|
+
};
|
18
|
+
};
|
19
|
+
}(window.ActiveAdmin));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'active_support/core_ext'
|
2
|
+
require 'active_admin'
|
3
|
+
|
4
|
+
module ActiveAdmin
|
5
|
+
module CepAutoComplete
|
6
|
+
DEFAULT_FIELDS = [:state, :city, :neighborhood, :street].freeze
|
7
|
+
CEP_REGEX_BODY = '[0-9]{2}(\.)?[0-9]{3}(\-)?[0-9]{3}'.freeze
|
8
|
+
|
9
|
+
autoload :Version, 'active_admin/cep_auto_complete/version'
|
10
|
+
autoload :Page, 'active_admin/cep_auto_complete/page'
|
11
|
+
autoload :DSL, 'active_admin/cep_auto_complete/dsl'
|
12
|
+
autoload :Query, 'active_admin/cep_auto_complete/query'
|
13
|
+
autoload :Renderer, 'active_admin/cep_auto_complete/renderer'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
require 'active_admin/cep_auto_complete/engine'
|
18
|
+
require 'formtastic/inputs/cep_input'
|
19
|
+
|
20
|
+
ActiveAdmin::Page.send(:include, ActiveAdmin::CepAutoComplete::Page)
|
21
|
+
ActiveAdmin::DSL.send(:include, ActiveAdmin::CepAutoComplete::DSL)
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module CepAutoComplete
|
3
|
+
module DSL
|
4
|
+
def setup_cep_auto_complete(&block)
|
5
|
+
renderer = config.cep_renderer
|
6
|
+
renderer.instance_eval(&block) if block_given?
|
7
|
+
|
8
|
+
controller do
|
9
|
+
require 'postmon_ruby'
|
10
|
+
|
11
|
+
# TODO: Find another to pass down the renderer variable
|
12
|
+
@@renderer = renderer
|
13
|
+
|
14
|
+
def index
|
15
|
+
if is_cep_valid?
|
16
|
+
query = Query.search(parsed_cep)
|
17
|
+
|
18
|
+
if query
|
19
|
+
render json: @@renderer.render(query)
|
20
|
+
else
|
21
|
+
render nothing: true, status: 404
|
22
|
+
end
|
23
|
+
else
|
24
|
+
render nothing: true, status: 404
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def is_cep_valid?
|
29
|
+
parsed_cep =~ /\A#{CEP_REGEX_BODY}\z/
|
30
|
+
end
|
31
|
+
|
32
|
+
def parsed_cep
|
33
|
+
@parsed_cep ||= params[:cep].to_s.gsub(/[^\d]/, '')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module CepAutoComplete
|
3
|
+
class Query
|
4
|
+
def self.search(cep)
|
5
|
+
address = PostmonRuby::Client.search(:cep, cep)
|
6
|
+
|
7
|
+
unless address.not_found
|
8
|
+
{
|
9
|
+
cep: cep,
|
10
|
+
state: address.estado,
|
11
|
+
city: address.cidade,
|
12
|
+
neighborhood: address.bairro,
|
13
|
+
street: address.logradouro
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module ActiveAdmin
|
2
|
+
module CepAutoComplete
|
3
|
+
class Renderer
|
4
|
+
def initialize(page)
|
5
|
+
@page = page
|
6
|
+
@renderers = DEFAULT_FIELDS.map { |field| [field, default_renderer_for(field)] }.to_h.with_indifferent_access
|
7
|
+
end
|
8
|
+
|
9
|
+
def field(field_name, &block)
|
10
|
+
@renderers[field_name] =
|
11
|
+
if block_given?
|
12
|
+
block
|
13
|
+
else
|
14
|
+
default_renderer_for(field_name)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def render(query)
|
19
|
+
object = build_object(query)
|
20
|
+
|
21
|
+
@renderers.keys.map do |field|
|
22
|
+
value = @renderers[field].call(object)
|
23
|
+
object.public_send("#{field}=", value)
|
24
|
+
[field, value]
|
25
|
+
end.to_h
|
26
|
+
end
|
27
|
+
|
28
|
+
protected
|
29
|
+
|
30
|
+
def default_renderer_for(field)
|
31
|
+
lambda { |cep| cep.public_send(field) }
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def build_object(query)
|
37
|
+
klass.new(*query.values)
|
38
|
+
end
|
39
|
+
|
40
|
+
def klass
|
41
|
+
Struct.new(:cep, *@renderers.keys)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
module Formtastic
|
2
|
+
module Inputs
|
3
|
+
class CepInput < StringInput
|
4
|
+
def input_html_options
|
5
|
+
opts = super
|
6
|
+
data = (opts[:data] || {}).merge(fields: load_fields(input_options[:fields]),
|
7
|
+
url: load_url(input_options[:url]),
|
8
|
+
scope: load_scope(opts[:id]),
|
9
|
+
cep_regex: cep_regex)
|
10
|
+
opts.merge(class: load_class(opts[:class]), data: data)
|
11
|
+
end
|
12
|
+
|
13
|
+
protected
|
14
|
+
|
15
|
+
def load_class(classes)
|
16
|
+
@classes ||= (classes || '').to_s.split(' ').tap { |classes| classes << 'cep-auto-complete' }.join(' ')
|
17
|
+
end
|
18
|
+
|
19
|
+
def load_fields(fields)
|
20
|
+
@fields ||= begin
|
21
|
+
raise "Expected Array got #{fields.class}" if !fields.blank? && !fields.is_a?(Array)
|
22
|
+
(fields || ActiveAdmin::CepAutoComplete::DEFAULT_FIELDS).to_json
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def load_url(url)
|
27
|
+
@url ||= begin
|
28
|
+
if url.nil?
|
29
|
+
url = ['/']
|
30
|
+
|
31
|
+
if ActiveAdmin.application.default_namespace.present?
|
32
|
+
url << "#{ActiveAdmin.application.default_namespace}/"
|
33
|
+
end
|
34
|
+
|
35
|
+
url << urlize_method
|
36
|
+
url.join('')
|
37
|
+
else
|
38
|
+
url
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def load_scope(id)
|
44
|
+
id.chomp('_' + method.to_s)
|
45
|
+
end
|
46
|
+
|
47
|
+
def cep_regex
|
48
|
+
"^#{ActiveAdmin::CepAutoComplete::CEP_REGEX_BODY}$"
|
49
|
+
end
|
50
|
+
|
51
|
+
def association_name
|
52
|
+
method.to_s.singularize.chomp('_id')
|
53
|
+
end
|
54
|
+
|
55
|
+
def urlize_method
|
56
|
+
association_name.underscore
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
metadata
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: active_admin-cep_auto_complete
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dhyego Fernando
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activeadmin
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.0.pre1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.0.0.pre1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: postmon_ruby
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rake
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: minitest
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: minitest-utils
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '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'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: pry-meta
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Auto complete your addresses fields with Brazilian CEP (zip code).
|
126
|
+
email:
|
127
|
+
- dhyegofernando@gmail.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".editorconfig"
|
133
|
+
- ".gitignore"
|
134
|
+
- CONTRIBUTING.md
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- active_admin-cep_auto_complete.gemspec
|
140
|
+
- app/assets/javascripts/active_admin/cep_auto_complete.js
|
141
|
+
- app/assets/javascripts/active_admin/utils.js
|
142
|
+
- lib/active_admin/cep_auto_complete.rb
|
143
|
+
- lib/active_admin/cep_auto_complete/dsl.rb
|
144
|
+
- lib/active_admin/cep_auto_complete/engine.rb
|
145
|
+
- lib/active_admin/cep_auto_complete/page.rb
|
146
|
+
- lib/active_admin/cep_auto_complete/query.rb
|
147
|
+
- lib/active_admin/cep_auto_complete/renderer.rb
|
148
|
+
- lib/active_admin/cep_auto_complete/version.rb
|
149
|
+
- lib/formtastic/inputs/cep_input.rb
|
150
|
+
homepage: http://github.com/dhyegofernando/active_admin-cep_auto_complete
|
151
|
+
licenses:
|
152
|
+
- MIT
|
153
|
+
metadata: {}
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
requirements: []
|
169
|
+
rubyforge_project:
|
170
|
+
rubygems_version: 2.4.8
|
171
|
+
signing_key:
|
172
|
+
specification_version: 4
|
173
|
+
summary: Auto complete your addresses fields with Brazilian CEP (zip code).
|
174
|
+
test_files: []
|