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.
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 +123 -0
  14. data/Rakefile +7 -1
  15. data/app/inputs/autocomplete_zipcode/city_input.rb +9 -0
  16. data/app/inputs/autocomplete_zipcode/ibge_input.rb +9 -0
  17. data/app/inputs/autocomplete_zipcode/neighborhood_input.rb +9 -0
  18. data/app/inputs/autocomplete_zipcode/state_input.rb +9 -0
  19. data/app/inputs/autocomplete_zipcode/state_select_input.rb +9 -0
  20. data/app/inputs/autocomplete_zipcode/street_input.rb +9 -0
  21. data/app/inputs/autocomplete_zipcode/zipcode_input.rb +9 -0
  22. data/autocomplete_zipcode.gemspec +21 -12
  23. data/bin/console +7 -7
  24. data/bin/rails +19 -0
  25. data/config/initializers/simple_form_autocomplete_zipcode.rb +13 -0
  26. data/lib/autocomplete_zipcode.rb +13 -6
  27. data/lib/autocomplete_zipcode/version.rb +3 -1
  28. data/vendor/assets/javascripts/autocomplete_zipcode.js +45 -22
  29. metadata +125 -114
  30. data/example/.gitignore +0 -21
  31. data/example/Gemfile +0 -55
  32. data/example/Gemfile.lock +0 -186
  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 -17
  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 -17
  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,186 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- autocomplete_zipcode (0.0.1)
5
- rails-assets-jquery
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- actioncable (5.0.2)
11
- actionpack (= 5.0.2)
12
- nio4r (>= 1.2, < 3.0)
13
- websocket-driver (~> 0.6.1)
14
- actionmailer (5.0.2)
15
- actionpack (= 5.0.2)
16
- actionview (= 5.0.2)
17
- activejob (= 5.0.2)
18
- mail (~> 2.5, >= 2.5.4)
19
- rails-dom-testing (~> 2.0)
20
- actionpack (5.0.2)
21
- actionview (= 5.0.2)
22
- activesupport (= 5.0.2)
23
- rack (~> 2.0)
24
- rack-test (~> 0.6.3)
25
- rails-dom-testing (~> 2.0)
26
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
27
- actionview (5.0.2)
28
- activesupport (= 5.0.2)
29
- builder (~> 3.1)
30
- erubis (~> 2.7.0)
31
- rails-dom-testing (~> 2.0)
32
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
33
- activejob (5.0.2)
34
- activesupport (= 5.0.2)
35
- globalid (>= 0.3.6)
36
- activemodel (5.0.2)
37
- activesupport (= 5.0.2)
38
- activerecord (5.0.2)
39
- activemodel (= 5.0.2)
40
- activesupport (= 5.0.2)
41
- arel (~> 7.0)
42
- activesupport (5.0.2)
43
- concurrent-ruby (~> 1.0, >= 1.0.2)
44
- i18n (~> 0.7)
45
- minitest (~> 5.1)
46
- tzinfo (~> 1.1)
47
- arel (7.1.4)
48
- bindex (0.5.0)
49
- builder (3.2.3)
50
- byebug (9.0.6)
51
- coffee-rails (4.2.1)
52
- coffee-script (>= 2.2.0)
53
- railties (>= 4.0.0, < 5.2.x)
54
- coffee-script (2.4.1)
55
- coffee-script-source
56
- execjs
57
- coffee-script-source (1.12.2)
58
- concurrent-ruby (1.0.5)
59
- erubis (2.7.0)
60
- execjs (2.7.0)
61
- ffi (1.9.18)
62
- globalid (0.4.0)
63
- activesupport (>= 4.2.0)
64
- i18n (0.8.1)
65
- jbuilder (2.6.3)
66
- activesupport (>= 3.0.0, < 5.2)
67
- multi_json (~> 1.2)
68
- jquery-rails (4.3.1)
69
- rails-dom-testing (>= 1, < 3)
70
- railties (>= 4.2.0)
71
- thor (>= 0.14, < 2.0)
72
- listen (3.0.8)
73
- rb-fsevent (~> 0.9, >= 0.9.4)
74
- rb-inotify (~> 0.9, >= 0.9.7)
75
- loofah (2.0.3)
76
- nokogiri (>= 1.5.9)
77
- mail (2.6.4)
78
- mime-types (>= 1.16, < 4)
79
- method_source (0.8.2)
80
- mime-types (3.1)
81
- mime-types-data (~> 3.2015)
82
- mime-types-data (3.2016.0521)
83
- mini_portile2 (2.1.0)
84
- minitest (5.10.1)
85
- multi_json (1.12.1)
86
- nio4r (2.0.0)
87
- nokogiri (1.7.1)
88
- mini_portile2 (~> 2.1.0)
89
- puma (3.8.2)
90
- rack (2.0.1)
91
- rack-test (0.6.3)
92
- rack (>= 1.0)
93
- rails (5.0.2)
94
- actioncable (= 5.0.2)
95
- actionmailer (= 5.0.2)
96
- actionpack (= 5.0.2)
97
- actionview (= 5.0.2)
98
- activejob (= 5.0.2)
99
- activemodel (= 5.0.2)
100
- activerecord (= 5.0.2)
101
- activesupport (= 5.0.2)
102
- bundler (>= 1.3.0, < 2.0)
103
- railties (= 5.0.2)
104
- sprockets-rails (>= 2.0.0)
105
- rails-assets-jquery (3.2.1)
106
- rails-dom-testing (2.0.2)
107
- activesupport (>= 4.2.0, < 6.0)
108
- nokogiri (~> 1.6)
109
- rails-html-sanitizer (1.0.3)
110
- loofah (~> 2.0)
111
- railties (5.0.2)
112
- actionpack (= 5.0.2)
113
- activesupport (= 5.0.2)
114
- method_source
115
- rake (>= 0.8.7)
116
- thor (>= 0.18.1, < 2.0)
117
- rake (12.0.0)
118
- rb-fsevent (0.9.8)
119
- rb-inotify (0.9.8)
120
- ffi (>= 0.5.0)
121
- sass (3.4.23)
122
- sass-rails (5.0.6)
123
- railties (>= 4.0.0, < 6)
124
- sass (~> 3.1)
125
- sprockets (>= 2.8, < 4.0)
126
- sprockets-rails (>= 2.0, < 4.0)
127
- tilt (>= 1.1, < 3)
128
- simple_form (3.4.0)
129
- actionpack (> 4, < 5.1)
130
- activemodel (> 4, < 5.1)
131
- spring (2.0.1)
132
- activesupport (>= 4.2)
133
- spring-watcher-listen (2.0.1)
134
- listen (>= 2.7, < 4.0)
135
- spring (>= 1.2, < 3.0)
136
- sprockets (3.7.1)
137
- concurrent-ruby (~> 1.0)
138
- rack (> 1, < 3)
139
- sprockets-rails (3.2.0)
140
- actionpack (>= 4.0)
141
- activesupport (>= 4.0)
142
- sprockets (>= 3.0.0)
143
- sqlite3 (1.3.13)
144
- thor (0.19.4)
145
- thread_safe (0.3.6)
146
- tilt (2.0.7)
147
- turbolinks (5.0.1)
148
- turbolinks-source (~> 5)
149
- turbolinks-source (5.0.0)
150
- tzinfo (1.2.3)
151
- thread_safe (~> 0.1)
152
- uglifier (3.2.0)
153
- execjs (>= 0.3.0, < 3)
154
- web-console (3.5.0)
155
- actionview (>= 5.0)
156
- activemodel (>= 5.0)
157
- bindex (>= 0.4.0)
158
- railties (>= 5.0)
159
- websocket-driver (0.6.5)
160
- websocket-extensions (>= 0.1.0)
161
- websocket-extensions (0.1.2)
162
-
163
- PLATFORMS
164
- ruby
165
-
166
- DEPENDENCIES
167
- autocomplete_zipcode!
168
- byebug
169
- coffee-rails (~> 4.2)
170
- jbuilder (~> 2.5)
171
- jquery-rails
172
- listen (~> 3.0.5)
173
- puma (~> 3.0)
174
- rails (~> 5.0.2)
175
- sass-rails (~> 5.0)
176
- simple_form
177
- spring
178
- spring-watcher-listen (~> 2.0.0)
179
- sqlite3
180
- turbolinks (~> 5)
181
- tzinfo-data
182
- uglifier (>= 1.3.0)
183
- web-console (>= 3.3.0)
184
-
185
- BUNDLED WITH
186
- 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,17 +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 .
@@ -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
- }