spree_br_common 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +14 -0
  7. data/Gemfile +20 -0
  8. data/LICENSE +26 -0
  9. data/README.md +55 -0
  10. data/Rakefile +21 -0
  11. data/app/assets/javascripts/spree/backend/spree_br_common.js +2 -0
  12. data/app/assets/javascripts/spree/frontend/address.js +119 -0
  13. data/app/assets/javascripts/spree/frontend/mask.js +21 -0
  14. data/app/assets/javascripts/spree/frontend/plugins/jquery.mask.extension.js +4 -0
  15. data/app/assets/javascripts/spree/frontend/plugins/jquery.mask.js +395 -0
  16. data/app/assets/javascripts/spree/frontend/routes.js.erb +4 -0
  17. data/app/assets/javascripts/spree/frontend/spree_br_common.js +1 -0
  18. data/app/assets/stylesheets/spree/backend/spree_br_common.css +4 -0
  19. data/app/assets/stylesheets/spree/frontend/spree_br_common.css +4 -0
  20. data/app/controllers/spree/addresses_controller.rb +24 -0
  21. data/app/controllers/spree/api/cities_controller.rb +38 -0
  22. data/app/controllers/spree/user_registrations_controller_decorator.rb +13 -0
  23. data/app/helpers/spree/api/api_helpers_decorator.rb +13 -0
  24. data/app/helpers/spree/base_helper_decorator.rb +5 -0
  25. data/app/models/spree/ability_decorator.rb +21 -0
  26. data/app/models/spree/address_decorator.rb +6 -0
  27. data/app/models/spree/city.rb +7 -0
  28. data/app/models/spree/permitted_attributes_decorator.rb +8 -0
  29. data/app/models/spree/state_decorator.rb +3 -0
  30. data/app/models/spree/user_decorator.rb +52 -0
  31. data/app/overrides/spree/address/_form/add_district.html.erb.deface +5 -0
  32. data/app/overrides/spree/address/_form/add_number.html.erb.deface +5 -0
  33. data/app/overrides/spree/address/_form/hide_country.html.erb.deface +4 -0
  34. data/app/overrides/spree/address/_form/move_city_to_after_state.deface +2 -0
  35. data/app/overrides/spree/address/_form/move_zipcode_after_last_name.deface +2 -0
  36. data/app/overrides/spree/address/_form/replace_city_input_text_by_select.html.erb.deface +18 -0
  37. data/app/overrides/spree/address/_form/set_data_uf_to_state.html.erb.deface +15 -0
  38. data/app/overrides/spree/admin/users/_form/add_extras_fields.html.erb.deface +39 -0
  39. data/app/overrides/spree/shared/_user_form/add_extra_fields.html.erb.deface +19 -0
  40. data/app/overrides/spree/users/show/add_details.html.erb.deface +13 -0
  41. data/app/views/spree/api/cities/index.v1.rabl +11 -0
  42. data/app/views/spree/api/cities/show.v1.rabl +2 -0
  43. data/bin/rails +7 -0
  44. data/config/locales/en.yml +11 -0
  45. data/config/locales/pt-BR.yml +14 -0
  46. data/config/routes.rb +7 -0
  47. data/db/default/country.rb +3 -0
  48. data/db/default/shipping_categories.rb +1 -0
  49. data/db/default/shipping_zones.rb +3 -0
  50. data/db/default/states.rb +31 -0
  51. data/db/default/states_cities_of_acre.rb +26 -0
  52. data/db/default/states_cities_of_alagoas.rb +107 -0
  53. data/db/default/states_cities_of_amapa.rb +20 -0
  54. data/db/default/states_cities_of_amazonas.rb +67 -0
  55. data/db/default/states_cities_of_bahia.rb +421 -0
  56. data/db/default/states_cities_of_ceara.rb +188 -0
  57. data/db/default/states_cities_of_distrito_federal.rb +5 -0
  58. data/db/default/states_cities_of_espirito_santo.rb +82 -0
  59. data/db/default/states_cities_of_goias.rb +250 -0
  60. data/db/default/states_cities_of_maranhao.rb +221 -0
  61. data/db/default/states_cities_of_mato_grosso.rb +145 -0
  62. data/db/default/states_cities_of_mato_grosso_do_sul.rb +82 -0
  63. data/db/default/states_cities_of_minas_gerais.rb +857 -0
  64. data/db/default/states_cities_of_para.rb +147 -0
  65. data/db/default/states_cities_of_paraiba.rb +227 -0
  66. data/db/default/states_cities_of_parana.rb +403 -0
  67. data/db/default/states_cities_of_pernambuco.rb +189 -0
  68. data/db/default/states_cities_of_piaui.rb +227 -0
  69. data/db/default/states_cities_of_rio_de_janeiro.rb +96 -0
  70. data/db/default/states_cities_of_rio_grande_do_norte.rb +171 -0
  71. data/db/default/states_cities_of_rio_grande_do_sul.rb +500 -0
  72. data/db/default/states_cities_of_rondonia.rb +56 -0
  73. data/db/default/states_cities_of_roraima.rb +19 -0
  74. data/db/default/states_cities_of_santa_catarina.rb +297 -0
  75. data/db/default/states_cities_of_sao_paulo.rb +649 -0
  76. data/db/default/states_cities_of_sergipe.rb +79 -0
  77. data/db/default/states_cities_of_tocantins.rb +144 -0
  78. data/db/default/stock.rb +1 -0
  79. data/db/default/tax_categories.rb +1 -0
  80. data/db/default/user.rb +100 -0
  81. data/db/migrate/20150503011715_create_spree_cities.rb +13 -0
  82. data/db/migrate/20150504004509_remove_city_from_spree_address.rb +5 -0
  83. data/db/migrate/20150504004648_add_city_to_spree_address.rb +5 -0
  84. data/db/migrate/20150505020218_add_number_and_district_to_spree_address.rb +6 -0
  85. data/db/migrate/20150505031019_add_details_to_spree_user.rb +10 -0
  86. data/db/seeds.rb +5 -0
  87. data/lib/generators/spree_br_common/install/install_generator.rb +31 -0
  88. data/lib/spree_br_common/engine.rb +20 -0
  89. data/lib/spree_br_common/factories/address_factory.rb +7 -0
  90. data/lib/spree_br_common/factories/city_factory.rb +8 -0
  91. data/lib/spree_br_common/factories/user_factory.rb +12 -0
  92. data/lib/spree_br_common/factories.rb +3 -0
  93. data/lib/spree_br_common.rb +2 -0
  94. data/spec/controllers/features/address_checkout_spec.rb +89 -0
  95. data/spec/controllers/features/user_account_spec.rb +46 -0
  96. data/spec/controllers/features/user_signup_spec.rb +24 -0
  97. data/spec/controllers/spree/addresses_controller_spec.rb +27 -0
  98. data/spec/controllers/spree/api/cities_controller_spec.rb +86 -0
  99. data/spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/does_not_break_the_per-item_shipping_method_calculator.yml +49 -0
  100. data/spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/in_Brazil/should_autocomplete_zipcode.yml +46 -0
  101. data/spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/does_not_find_an_incorrect_cep.yml +38 -0
  102. data/spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/shows_the_correct_address.yml +46 -0
  103. data/spec/models/spree/address_spec.rb +32 -0
  104. data/spec/models/spree/city_spec.rb +7 -0
  105. data/spec/models/spree/user_spec.rb +88 -0
  106. data/spec/spec_helper.rb +94 -0
  107. data/spec/support/controller_hacks.rb +33 -0
  108. data/spec/support/shared_context/checkout_setup.rb +9 -0
  109. data/spec/support/vcr.rb +8 -0
  110. data/spree_br_common.gemspec +33 -0
  111. metadata +351 -0
metadata ADDED
@@ -0,0 +1,351 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_br_common
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Diego Domingues
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: spree_core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: cpf_cnpj
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.2.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.2.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: jc-validates_timeliness
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: rest-client
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.8.0
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.8.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: capybara
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '2.4'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: coffee-rails
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: database_cleaner
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: factory_girl
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '4.5'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '4.5'
125
+ - !ruby/object:Gem::Dependency
126
+ name: ffaker
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rspec-rails
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.1'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.1'
153
+ - !ruby/object:Gem::Dependency
154
+ name: sass-rails
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: 5.0.0.beta1
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 5.0.0.beta1
167
+ - !ruby/object:Gem::Dependency
168
+ name: selenium-webdriver
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: sqlite3
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ description: This extension has goal to provide common aspects as cities, extras address
196
+ informations and some seeds to Brazil
197
+ email: diego.domingues16@gmail.com
198
+ executables: []
199
+ extensions: []
200
+ extra_rdoc_files: []
201
+ files:
202
+ - ".gitignore"
203
+ - ".rspec"
204
+ - ".ruby-gemset"
205
+ - ".ruby-version"
206
+ - ".travis.yml"
207
+ - Gemfile
208
+ - LICENSE
209
+ - README.md
210
+ - Rakefile
211
+ - app/assets/javascripts/spree/backend/spree_br_common.js
212
+ - app/assets/javascripts/spree/frontend/address.js
213
+ - app/assets/javascripts/spree/frontend/mask.js
214
+ - app/assets/javascripts/spree/frontend/plugins/jquery.mask.extension.js
215
+ - app/assets/javascripts/spree/frontend/plugins/jquery.mask.js
216
+ - app/assets/javascripts/spree/frontend/routes.js.erb
217
+ - app/assets/javascripts/spree/frontend/spree_br_common.js
218
+ - app/assets/stylesheets/spree/backend/spree_br_common.css
219
+ - app/assets/stylesheets/spree/frontend/spree_br_common.css
220
+ - app/controllers/spree/addresses_controller.rb
221
+ - app/controllers/spree/api/cities_controller.rb
222
+ - app/controllers/spree/user_registrations_controller_decorator.rb
223
+ - app/helpers/spree/api/api_helpers_decorator.rb
224
+ - app/helpers/spree/base_helper_decorator.rb
225
+ - app/models/spree/ability_decorator.rb
226
+ - app/models/spree/address_decorator.rb
227
+ - app/models/spree/city.rb
228
+ - app/models/spree/permitted_attributes_decorator.rb
229
+ - app/models/spree/state_decorator.rb
230
+ - app/models/spree/user_decorator.rb
231
+ - app/overrides/spree/address/_form/add_district.html.erb.deface
232
+ - app/overrides/spree/address/_form/add_number.html.erb.deface
233
+ - app/overrides/spree/address/_form/hide_country.html.erb.deface
234
+ - app/overrides/spree/address/_form/move_city_to_after_state.deface
235
+ - app/overrides/spree/address/_form/move_zipcode_after_last_name.deface
236
+ - app/overrides/spree/address/_form/replace_city_input_text_by_select.html.erb.deface
237
+ - app/overrides/spree/address/_form/set_data_uf_to_state.html.erb.deface
238
+ - app/overrides/spree/admin/users/_form/add_extras_fields.html.erb.deface
239
+ - app/overrides/spree/shared/_user_form/add_extra_fields.html.erb.deface
240
+ - app/overrides/spree/users/show/add_details.html.erb.deface
241
+ - app/views/spree/api/cities/index.v1.rabl
242
+ - app/views/spree/api/cities/show.v1.rabl
243
+ - bin/rails
244
+ - config/locales/en.yml
245
+ - config/locales/pt-BR.yml
246
+ - config/routes.rb
247
+ - db/default/country.rb
248
+ - db/default/shipping_categories.rb
249
+ - db/default/shipping_zones.rb
250
+ - db/default/states.rb
251
+ - db/default/states_cities_of_acre.rb
252
+ - db/default/states_cities_of_alagoas.rb
253
+ - db/default/states_cities_of_amapa.rb
254
+ - db/default/states_cities_of_amazonas.rb
255
+ - db/default/states_cities_of_bahia.rb
256
+ - db/default/states_cities_of_ceara.rb
257
+ - db/default/states_cities_of_distrito_federal.rb
258
+ - db/default/states_cities_of_espirito_santo.rb
259
+ - db/default/states_cities_of_goias.rb
260
+ - db/default/states_cities_of_maranhao.rb
261
+ - db/default/states_cities_of_mato_grosso.rb
262
+ - db/default/states_cities_of_mato_grosso_do_sul.rb
263
+ - db/default/states_cities_of_minas_gerais.rb
264
+ - db/default/states_cities_of_para.rb
265
+ - db/default/states_cities_of_paraiba.rb
266
+ - db/default/states_cities_of_parana.rb
267
+ - db/default/states_cities_of_pernambuco.rb
268
+ - db/default/states_cities_of_piaui.rb
269
+ - db/default/states_cities_of_rio_de_janeiro.rb
270
+ - db/default/states_cities_of_rio_grande_do_norte.rb
271
+ - db/default/states_cities_of_rio_grande_do_sul.rb
272
+ - db/default/states_cities_of_rondonia.rb
273
+ - db/default/states_cities_of_roraima.rb
274
+ - db/default/states_cities_of_santa_catarina.rb
275
+ - db/default/states_cities_of_sao_paulo.rb
276
+ - db/default/states_cities_of_sergipe.rb
277
+ - db/default/states_cities_of_tocantins.rb
278
+ - db/default/stock.rb
279
+ - db/default/tax_categories.rb
280
+ - db/default/user.rb
281
+ - db/migrate/20150503011715_create_spree_cities.rb
282
+ - db/migrate/20150504004509_remove_city_from_spree_address.rb
283
+ - db/migrate/20150504004648_add_city_to_spree_address.rb
284
+ - db/migrate/20150505020218_add_number_and_district_to_spree_address.rb
285
+ - db/migrate/20150505031019_add_details_to_spree_user.rb
286
+ - db/seeds.rb
287
+ - lib/generators/spree_br_common/install/install_generator.rb
288
+ - lib/spree_br_common.rb
289
+ - lib/spree_br_common/engine.rb
290
+ - lib/spree_br_common/factories.rb
291
+ - lib/spree_br_common/factories/address_factory.rb
292
+ - lib/spree_br_common/factories/city_factory.rb
293
+ - lib/spree_br_common/factories/user_factory.rb
294
+ - spec/controllers/features/address_checkout_spec.rb
295
+ - spec/controllers/features/user_account_spec.rb
296
+ - spec/controllers/features/user_signup_spec.rb
297
+ - spec/controllers/spree/addresses_controller_spec.rb
298
+ - spec/controllers/spree/api/cities_controller_spec.rb
299
+ - spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/does_not_break_the_per-item_shipping_method_calculator.yml
300
+ - spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/in_Brazil/should_autocomplete_zipcode.yml
301
+ - spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/does_not_find_an_incorrect_cep.yml
302
+ - spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/shows_the_correct_address.yml
303
+ - spec/models/spree/address_spec.rb
304
+ - spec/models/spree/city_spec.rb
305
+ - spec/models/spree/user_spec.rb
306
+ - spec/spec_helper.rb
307
+ - spec/support/controller_hacks.rb
308
+ - spec/support/shared_context/checkout_setup.rb
309
+ - spec/support/vcr.rb
310
+ - spree_br_common.gemspec
311
+ homepage: https://github.com/ddomingues/spree_br-common
312
+ licenses: []
313
+ metadata: {}
314
+ post_install_message:
315
+ rdoc_options: []
316
+ require_paths:
317
+ - lib
318
+ required_ruby_version: !ruby/object:Gem::Requirement
319
+ requirements:
320
+ - - ">="
321
+ - !ruby/object:Gem::Version
322
+ version: 2.0.0
323
+ required_rubygems_version: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ requirements:
329
+ - none
330
+ rubyforge_project:
331
+ rubygems_version: 2.4.3
332
+ signing_key:
333
+ specification_version: 4
334
+ summary: Brazil common aspects
335
+ test_files:
336
+ - spec/controllers/features/address_checkout_spec.rb
337
+ - spec/controllers/features/user_account_spec.rb
338
+ - spec/controllers/features/user_signup_spec.rb
339
+ - spec/controllers/spree/addresses_controller_spec.rb
340
+ - spec/controllers/spree/api/cities_controller_spec.rb
341
+ - spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/does_not_break_the_per-item_shipping_method_calculator.yml
342
+ - spec/fixtures/vcr_cassettes/Checkout/visitor_makes_checkout_as_guest_without_registration/full_checkout/in_Brazil/should_autocomplete_zipcode.yml
343
+ - spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/does_not_find_an_incorrect_cep.yml
344
+ - spec/fixtures/vcr_cassettes/Spree_AddressesController/_show/shows_the_correct_address.yml
345
+ - spec/models/spree/address_spec.rb
346
+ - spec/models/spree/city_spec.rb
347
+ - spec/models/spree/user_spec.rb
348
+ - spec/spec_helper.rb
349
+ - spec/support/controller_hacks.rb
350
+ - spec/support/shared_context/checkout_setup.rb
351
+ - spec/support/vcr.rb