autocomplete_zipcode 0.1.2 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +10 -0
  3. data/.github/pull_request_template.md +19 -0
  4. data/.gitignore +5 -1
  5. data/.rspec +1 -2
  6. data/.rubocop.yml +7 -0
  7. data/.ruby-gemset +1 -0
  8. data/.ruby-version +1 -0
  9. data/.travis.yml +13 -1
  10. data/Gemfile +2 -0
  11. data/Gemfile.lock +209 -0
  12. data/Makefile +2 -0
  13. data/README.md +58 -10
  14. data/Rakefile +7 -1
  15. data/app/inputs/autocomplete_zipcode/city_input.rb +11 -0
  16. data/app/inputs/autocomplete_zipcode/ibge_input.rb +11 -0
  17. data/app/inputs/autocomplete_zipcode/neighborhood_input.rb +11 -0
  18. data/app/inputs/autocomplete_zipcode/state_input.rb +11 -0
  19. data/app/inputs/autocomplete_zipcode/state_select_input.rb +11 -0
  20. data/app/inputs/autocomplete_zipcode/street_input.rb +11 -0
  21. data/app/inputs/autocomplete_zipcode/zipcode_input.rb +11 -0
  22. data/autocomplete_zipcode.gemspec +25 -13
  23. data/bin/console +7 -7
  24. data/bin/rails +19 -0
  25. data/config/initializers/simple_form_autocomplete_zipcode.rb +9 -0
  26. data/lib/autocomplete_zipcode.rb +4 -5
  27. data/lib/autocomplete_zipcode/version.rb +3 -1
  28. data/vendor/assets/javascripts/autocomplete_zipcode.js +43 -28
  29. metadata +125 -114
  30. data/example/.gitignore +0 -21
  31. data/example/Gemfile +0 -55
  32. data/example/Gemfile.lock +0 -184
  33. data/example/README.md +0 -24
  34. data/example/Rakefile +0 -6
  35. data/example/app/assets/config/manifest.js +0 -3
  36. data/example/app/assets/images/.keep +0 -0
  37. data/example/app/assets/javascripts/addresses.coffee +0 -3
  38. data/example/app/assets/javascripts/application.js +0 -26
  39. data/example/app/assets/javascripts/cable.js +0 -13
  40. data/example/app/assets/javascripts/channels/.keep +0 -0
  41. data/example/app/assets/stylesheets/addresses.scss +0 -3
  42. data/example/app/assets/stylesheets/application.css +0 -15
  43. data/example/app/assets/stylesheets/scaffolds.scss +0 -89
  44. data/example/app/channels/application_cable/channel.rb +0 -4
  45. data/example/app/channels/application_cable/connection.rb +0 -4
  46. data/example/app/controllers/addresses_controller.rb +0 -74
  47. data/example/app/controllers/application_controller.rb +0 -3
  48. data/example/app/controllers/concerns/.keep +0 -0
  49. data/example/app/helpers/addresses_helper.rb +0 -2
  50. data/example/app/helpers/application_helper.rb +0 -2
  51. data/example/app/jobs/application_job.rb +0 -2
  52. data/example/app/mailers/application_mailer.rb +0 -4
  53. data/example/app/models/address.rb +0 -2
  54. data/example/app/models/application_record.rb +0 -3
  55. data/example/app/models/concerns/.keep +0 -0
  56. data/example/app/views/addresses/_address.json.jbuilder +0 -2
  57. data/example/app/views/addresses/_form.html.erb +0 -18
  58. data/example/app/views/addresses/edit.html.erb +0 -6
  59. data/example/app/views/addresses/index.html.erb +0 -33
  60. data/example/app/views/addresses/index.json.jbuilder +0 -1
  61. data/example/app/views/addresses/new.html.erb +0 -5
  62. data/example/app/views/addresses/show.html.erb +0 -24
  63. data/example/app/views/addresses/show.json.jbuilder +0 -1
  64. data/example/app/views/layouts/application.html.erb +0 -14
  65. data/example/app/views/layouts/mailer.html.erb +0 -13
  66. data/example/app/views/layouts/mailer.text.erb +0 -1
  67. data/example/bin/bundle +0 -3
  68. data/example/bin/rails +0 -9
  69. data/example/bin/rake +0 -9
  70. data/example/bin/setup +0 -34
  71. data/example/bin/spring +0 -17
  72. data/example/bin/update +0 -29
  73. data/example/config.ru +0 -5
  74. data/example/config/application.rb +0 -15
  75. data/example/config/boot.rb +0 -3
  76. data/example/config/cable.yml +0 -9
  77. data/example/config/database.yml +0 -25
  78. data/example/config/environment.rb +0 -5
  79. data/example/config/environments/development.rb +0 -54
  80. data/example/config/environments/production.rb +0 -86
  81. data/example/config/environments/test.rb +0 -42
  82. data/example/config/initializers/application_controller_renderer.rb +0 -6
  83. data/example/config/initializers/assets.rb +0 -11
  84. data/example/config/initializers/backtrace_silencers.rb +0 -7
  85. data/example/config/initializers/cookies_serializer.rb +0 -5
  86. data/example/config/initializers/filter_parameter_logging.rb +0 -4
  87. data/example/config/initializers/inflections.rb +0 -16
  88. data/example/config/initializers/mime_types.rb +0 -4
  89. data/example/config/initializers/new_framework_defaults.rb +0 -24
  90. data/example/config/initializers/session_store.rb +0 -3
  91. data/example/config/initializers/simple_form.rb +0 -169
  92. data/example/config/initializers/wrap_parameters.rb +0 -14
  93. data/example/config/locales/en.yml +0 -23
  94. data/example/config/locales/simple_form.en.yml +0 -31
  95. data/example/config/puma.rb +0 -47
  96. data/example/config/routes.rb +0 -4
  97. data/example/config/secrets.yml +0 -22
  98. data/example/config/spring.rb +0 -6
  99. data/example/db/migrate/20170425234824_create_addresses.rb +0 -13
  100. data/example/db/schema.rb +0 -25
  101. data/example/db/seeds.rb +0 -7
  102. data/example/lib/assets/.keep +0 -0
  103. data/example/lib/tasks/.keep +0 -0
  104. data/example/lib/templates/erb/scaffold/_form.html.erb +0 -13
  105. data/example/log/.keep +0 -0
  106. data/example/public/404.html +0 -67
  107. data/example/public/422.html +0 -67
  108. data/example/public/500.html +0 -66
  109. data/example/public/apple-touch-icon-precomposed.png +0 -0
  110. data/example/public/apple-touch-icon.png +0 -0
  111. data/example/public/favicon.ico +0 -0
  112. data/example/public/robots.txt +0 -5
  113. data/example/test/controllers/.keep +0 -0
  114. data/example/test/controllers/addresses_controller_test.rb +0 -48
  115. data/example/test/fixtures/.keep +0 -0
  116. data/example/test/fixtures/addresses.yml +0 -13
  117. data/example/test/fixtures/files/.keep +0 -0
  118. data/example/test/helpers/.keep +0 -0
  119. data/example/test/integration/.keep +0 -0
  120. data/example/test/mailers/.keep +0 -0
  121. data/example/test/models/.keep +0 -0
  122. data/example/test/models/address_test.rb +0 -7
  123. data/example/test/test_helper.rb +0 -10
  124. data/example/tmp/.keep +0 -0
  125. data/example/vendor/assets/javascripts/.keep +0 -0
  126. data/example/vendor/assets/stylesheets/.keep +0 -0
  127. data/lib/autocomplete_zipcode/simple_form/city_input.rb +0 -7
  128. data/lib/autocomplete_zipcode/simple_form/neighborhood_input.rb +0 -7
  129. data/lib/autocomplete_zipcode/simple_form/state_input.rb +0 -7
  130. data/lib/autocomplete_zipcode/simple_form/street_input.rb +0 -7
  131. data/lib/autocomplete_zipcode/simple_form/zipcode_input.rb +0 -7
data/example/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
- #
3
- # If you find yourself ignoring temporary files generated by your text editor
4
- # or operating system, you probably want to add a global ignore instead:
5
- # git config --global core.excludesfile '~/.gitignore_global'
6
-
7
- # Ignore bundler config.
8
- /.bundle
9
-
10
- # Ignore the default SQLite database.
11
- /db/*.sqlite3
12
- /db/*.sqlite3-journal
13
-
14
- # Ignore all logfiles and tempfiles.
15
- /log/*
16
- /tmp/*
17
- !/log/.keep
18
- !/tmp/.keep
19
-
20
- # Ignore Byebug command history file.
21
- .byebug_history
data/example/Gemfile DELETED
@@ -1,55 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- git_source(:github) do |repo_name|
4
- repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
- "https://github.com/#{repo_name}.git"
6
- end
7
-
8
-
9
- # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10
- gem 'rails', '~> 5.0.2'
11
- # Use sqlite3 as the database for Active Record
12
- gem 'sqlite3'
13
- # Use Puma as the app server
14
- gem 'puma', '~> 3.0'
15
- # Use SCSS for stylesheets
16
- gem 'sass-rails', '~> 5.0'
17
- # Use Uglifier as compressor for JavaScript assets
18
- gem 'uglifier', '>= 1.3.0'
19
- # Use CoffeeScript for .coffee assets and views
20
- gem 'coffee-rails', '~> 4.2'
21
- # See https://github.com/rails/execjs#readme for more supported runtimes
22
- # gem 'therubyracer', platforms: :ruby
23
-
24
- # Use jquery as the JavaScript library
25
- gem 'jquery-rails'
26
- # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
27
- gem 'turbolinks', '~> 5'
28
- # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
29
- gem 'jbuilder', '~> 2.5'
30
- # Use Redis adapter to run Action Cable in production
31
- # gem 'redis', '~> 3.0'
32
- # Use ActiveModel has_secure_password
33
- # gem 'bcrypt', '~> 3.1.7'
34
-
35
- # Use Capistrano for deployment
36
- # gem 'capistrano-rails', group: :development
37
- gem 'simple_form'
38
- gem 'autocomplete_zipcode', path: '../'
39
-
40
- group :development, :test do
41
- # Call 'byebug' anywhere in the code to stop execution and get a debugger console
42
- gem 'byebug', platform: :mri
43
- end
44
-
45
- group :development do
46
- # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
47
- gem 'web-console', '>= 3.3.0'
48
- gem 'listen', '~> 3.0.5'
49
- # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
50
- gem 'spring'
51
- gem 'spring-watcher-listen', '~> 2.0.0'
52
- end
53
-
54
- # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
55
- gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
data/example/Gemfile.lock DELETED
@@ -1,184 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- autocomplete_zipcode (0.1.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- actioncable (5.0.2)
10
- actionpack (= 5.0.2)
11
- nio4r (>= 1.2, < 3.0)
12
- websocket-driver (~> 0.6.1)
13
- actionmailer (5.0.2)
14
- actionpack (= 5.0.2)
15
- actionview (= 5.0.2)
16
- activejob (= 5.0.2)
17
- mail (~> 2.5, >= 2.5.4)
18
- rails-dom-testing (~> 2.0)
19
- actionpack (5.0.2)
20
- actionview (= 5.0.2)
21
- activesupport (= 5.0.2)
22
- rack (~> 2.0)
23
- rack-test (~> 0.6.3)
24
- rails-dom-testing (~> 2.0)
25
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
- actionview (5.0.2)
27
- activesupport (= 5.0.2)
28
- builder (~> 3.1)
29
- erubis (~> 2.7.0)
30
- rails-dom-testing (~> 2.0)
31
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
- activejob (5.0.2)
33
- activesupport (= 5.0.2)
34
- globalid (>= 0.3.6)
35
- activemodel (5.0.2)
36
- activesupport (= 5.0.2)
37
- activerecord (5.0.2)
38
- activemodel (= 5.0.2)
39
- activesupport (= 5.0.2)
40
- arel (~> 7.0)
41
- activesupport (5.0.2)
42
- concurrent-ruby (~> 1.0, >= 1.0.2)
43
- i18n (~> 0.7)
44
- minitest (~> 5.1)
45
- tzinfo (~> 1.1)
46
- arel (7.1.4)
47
- bindex (0.5.0)
48
- builder (3.2.3)
49
- byebug (9.0.6)
50
- coffee-rails (4.2.1)
51
- coffee-script (>= 2.2.0)
52
- railties (>= 4.0.0, < 5.2.x)
53
- coffee-script (2.4.1)
54
- coffee-script-source
55
- execjs
56
- coffee-script-source (1.12.2)
57
- concurrent-ruby (1.0.5)
58
- erubis (2.7.0)
59
- execjs (2.7.0)
60
- ffi (1.9.18)
61
- globalid (0.4.0)
62
- activesupport (>= 4.2.0)
63
- i18n (0.8.1)
64
- jbuilder (2.6.3)
65
- activesupport (>= 3.0.0, < 5.2)
66
- multi_json (~> 1.2)
67
- jquery-rails (4.3.1)
68
- rails-dom-testing (>= 1, < 3)
69
- railties (>= 4.2.0)
70
- thor (>= 0.14, < 2.0)
71
- listen (3.0.8)
72
- rb-fsevent (~> 0.9, >= 0.9.4)
73
- rb-inotify (~> 0.9, >= 0.9.7)
74
- loofah (2.0.3)
75
- nokogiri (>= 1.5.9)
76
- mail (2.6.4)
77
- mime-types (>= 1.16, < 4)
78
- method_source (0.8.2)
79
- mime-types (3.1)
80
- mime-types-data (~> 3.2015)
81
- mime-types-data (3.2016.0521)
82
- mini_portile2 (2.1.0)
83
- minitest (5.10.1)
84
- multi_json (1.12.1)
85
- nio4r (2.0.0)
86
- nokogiri (1.7.1)
87
- mini_portile2 (~> 2.1.0)
88
- puma (3.8.2)
89
- rack (2.0.1)
90
- rack-test (0.6.3)
91
- rack (>= 1.0)
92
- rails (5.0.2)
93
- actioncable (= 5.0.2)
94
- actionmailer (= 5.0.2)
95
- actionpack (= 5.0.2)
96
- actionview (= 5.0.2)
97
- activejob (= 5.0.2)
98
- activemodel (= 5.0.2)
99
- activerecord (= 5.0.2)
100
- activesupport (= 5.0.2)
101
- bundler (>= 1.3.0, < 2.0)
102
- railties (= 5.0.2)
103
- sprockets-rails (>= 2.0.0)
104
- rails-dom-testing (2.0.2)
105
- activesupport (>= 4.2.0, < 6.0)
106
- nokogiri (~> 1.6)
107
- rails-html-sanitizer (1.0.3)
108
- loofah (~> 2.0)
109
- railties (5.0.2)
110
- actionpack (= 5.0.2)
111
- activesupport (= 5.0.2)
112
- method_source
113
- rake (>= 0.8.7)
114
- thor (>= 0.18.1, < 2.0)
115
- rake (12.0.0)
116
- rb-fsevent (0.9.8)
117
- rb-inotify (0.9.8)
118
- ffi (>= 0.5.0)
119
- sass (3.4.23)
120
- sass-rails (5.0.6)
121
- railties (>= 4.0.0, < 6)
122
- sass (~> 3.1)
123
- sprockets (>= 2.8, < 4.0)
124
- sprockets-rails (>= 2.0, < 4.0)
125
- tilt (>= 1.1, < 3)
126
- simple_form (3.4.0)
127
- actionpack (> 4, < 5.1)
128
- activemodel (> 4, < 5.1)
129
- spring (2.0.1)
130
- activesupport (>= 4.2)
131
- spring-watcher-listen (2.0.1)
132
- listen (>= 2.7, < 4.0)
133
- spring (>= 1.2, < 3.0)
134
- sprockets (3.7.1)
135
- concurrent-ruby (~> 1.0)
136
- rack (> 1, < 3)
137
- sprockets-rails (3.2.0)
138
- actionpack (>= 4.0)
139
- activesupport (>= 4.0)
140
- sprockets (>= 3.0.0)
141
- sqlite3 (1.3.13)
142
- thor (0.19.4)
143
- thread_safe (0.3.6)
144
- tilt (2.0.7)
145
- turbolinks (5.0.1)
146
- turbolinks-source (~> 5)
147
- turbolinks-source (5.0.0)
148
- tzinfo (1.2.3)
149
- thread_safe (~> 0.1)
150
- uglifier (3.2.0)
151
- execjs (>= 0.3.0, < 3)
152
- web-console (3.5.0)
153
- actionview (>= 5.0)
154
- activemodel (>= 5.0)
155
- bindex (>= 0.4.0)
156
- railties (>= 5.0)
157
- websocket-driver (0.6.5)
158
- websocket-extensions (>= 0.1.0)
159
- websocket-extensions (0.1.2)
160
-
161
- PLATFORMS
162
- ruby
163
-
164
- DEPENDENCIES
165
- autocomplete_zipcode!
166
- byebug
167
- coffee-rails (~> 4.2)
168
- jbuilder (~> 2.5)
169
- jquery-rails
170
- listen (~> 3.0.5)
171
- puma (~> 3.0)
172
- rails (~> 5.0.2)
173
- sass-rails (~> 5.0)
174
- simple_form
175
- spring
176
- spring-watcher-listen (~> 2.0.0)
177
- sqlite3
178
- turbolinks (~> 5)
179
- tzinfo-data
180
- uglifier (>= 1.3.0)
181
- web-console (>= 3.3.0)
182
-
183
- BUNDLED WITH
184
- 1.14.6
data/example/README.md DELETED
@@ -1,24 +0,0 @@
1
- # README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
data/example/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require_relative 'config/application'
5
-
6
- Rails.application.load_tasks
@@ -1,3 +0,0 @@
1
- //= link_tree ../images
2
- //= link_directory ../javascripts .js
3
- //= link_directory ../stylesheets .css
File without changes
@@ -1,3 +0,0 @@
1
- # Place all the behaviors and hooks related to the matching controller here.
2
- # All this logic will automatically be available in application.js.
3
- # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -1,26 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require jquery
14
- //= require jquery_ujs
15
- //= require turbolinks
16
- //= require autocomplete_zipcode
17
- //= require_tree .
18
-
19
- $(document).on("turbolinks:load", function() {
20
- document.addEventListener('zipcode.error', function(e) {
21
- $('#error').show()
22
- setTimeout(function() {
23
- $('#error').fadeOut(1000);
24
- }, 5000);
25
- });
26
- })
@@ -1,13 +0,0 @@
1
- // Action Cable provides the framework to deal with WebSockets in Rails.
2
- // You can generate new channels where WebSocket features live using the rails generate channel command.
3
- //
4
- //= require action_cable
5
- //= require_self
6
- //= require_tree ./channels
7
-
8
- (function() {
9
- this.App || (this.App = {});
10
-
11
- App.cable = ActionCable.createConsumer();
12
-
13
- }).call(this);
File without changes
@@ -1,3 +0,0 @@
1
- // Place all the styles related to the Addresses controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -1,15 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
- * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
- * files in this directory. Styles in this file should be added after the last require_* statement.
11
- * It is generally better to create a new file per style scope.
12
- *
13
- *= require_tree .
14
- *= require_self
15
- */
@@ -1,89 +0,0 @@
1
- body {
2
- background-color: #fff;
3
- color: #333;
4
- font-family: verdana, arial, helvetica, sans-serif;
5
- font-size: 13px;
6
- line-height: 18px;
7
- margin: 33px;
8
- }
9
-
10
- p, ol, ul, td {
11
- font-family: verdana, arial, helvetica, sans-serif;
12
- font-size: 13px;
13
- line-height: 18px;
14
- margin: 33px;
15
- }
16
-
17
- pre {
18
- background-color: #eee;
19
- padding: 10px;
20
- font-size: 11px;
21
- }
22
-
23
- a {
24
- color: #000;
25
-
26
- &:visited {
27
- color: #666;
28
- }
29
-
30
- &:hover {
31
- color: #fff;
32
- background-color: #000;
33
- }
34
- }
35
-
36
- th {
37
- padding-bottom: 5px;
38
- }
39
-
40
- td {
41
- padding-bottom: 7px;
42
- padding-left: 5px;
43
- padding-right: 5px;
44
- }
45
-
46
- div {
47
- &.field, &.actions {
48
- margin-bottom: 10px;
49
- }
50
- }
51
-
52
- #notice {
53
- color: green;
54
- }
55
-
56
- .field_with_errors {
57
- padding: 2px;
58
- background-color: red;
59
- display: table;
60
- }
61
-
62
- #error_explanation {
63
- width: 450px;
64
- border: 2px solid red;
65
- padding: 7px;
66
- padding-bottom: 0;
67
- margin-bottom: 20px;
68
- background-color: #f0f0f0;
69
-
70
- h2 {
71
- text-align: left;
72
- font-weight: bold;
73
- padding: 5px 5px 5px 15px;
74
- font-size: 12px;
75
- margin: -7px;
76
- margin-bottom: 0;
77
- background-color: #c00;
78
- color: #fff;
79
- }
80
-
81
- ul li {
82
- font-size: 12px;
83
- list-style: square;
84
- }
85
- }
86
-
87
- label {
88
- display: block;
89
- }