awesome_translations 0.0.57 → 0.0.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +1 -1
  3. data/app/controllers/awesome_translations/clean_ups_controller.rb +1 -1
  4. data/app/controllers/awesome_translations/groups_controller.rb +1 -0
  5. data/app/controllers/awesome_translations/handlers_controller.rb +1 -0
  6. data/app/helpers/awesome_translations/application_helper.rb +0 -1
  7. data/app/models/awesome_translations/group.rb +2 -2
  8. data/app/models/awesome_translations/translated_value.rb +6 -3
  9. data/app/models/awesome_translations/translation.rb +9 -4
  10. data/app/views/awesome_translations/duplicates/index.html.erb +2 -2
  11. data/app/views/awesome_translations/groups/show.html.erb +9 -4
  12. data/app/views/awesome_translations/handler_translations/index.html.erb +21 -6
  13. data/app/views/awesome_translations/handlers/show.html.erb +29 -6
  14. data/app/views/awesome_translations/movals/index.html.erb +2 -2
  15. data/lib/awesome_translations/cache_database_generator/group.rb +10 -3
  16. data/lib/awesome_translations/cache_database_generator/handler.rb +9 -2
  17. data/lib/awesome_translations/cache_database_generator/handler_translation.rb +13 -3
  18. data/lib/awesome_translations/cache_database_generator/translation_key.rb +4 -4
  19. data/lib/awesome_translations/cache_database_generator/translation_value.rb +3 -1
  20. data/lib/awesome_translations/cache_database_generator.rb +2 -2
  21. data/lib/awesome_translations/config.rb +3 -3
  22. data/lib/awesome_translations/controller_translate_functionality.rb +2 -2
  23. data/lib/awesome_translations/engine.rb +0 -4
  24. data/lib/awesome_translations/erb_inspector/file_inspector.rb +4 -4
  25. data/lib/awesome_translations/erb_inspector/translation_inspector.rb +8 -8
  26. data/lib/awesome_translations/erb_inspector.rb +1 -0
  27. data/lib/awesome_translations/global_translator.rb +14 -28
  28. data/lib/awesome_translations/handlers/file_handler.rb +1 -0
  29. data/lib/awesome_translations/handlers/model_handler.rb +1 -1
  30. data/lib/awesome_translations/handlers/validations_handler.rb +4 -4
  31. data/lib/awesome_translations/handlers.rb +1 -0
  32. data/lib/awesome_translations/model_inspector.rb +23 -17
  33. data/lib/awesome_translations/object_extensions.rb +2 -2
  34. data/lib/awesome_translations/translation_migrator.rb +3 -3
  35. data/lib/awesome_translations/version.rb +1 -1
  36. data/lib/awesome_translations.rb +1 -1
  37. data/lib/tasks/awesome_translations_tasks.rake +1 -4
  38. data/spec/controllers/groups_controller_spec.rb +5 -5
  39. data/spec/controllers/handlers_controller_spec.rb +4 -4
  40. data/spec/controllers/users_controller_spec.rb +4 -2
  41. data/spec/dummy/Rakefile +1 -1
  42. data/spec/dummy/app/assets/config/manifest.js +3 -0
  43. data/spec/dummy/app/controllers/application_controller.rb +3 -7
  44. data/spec/dummy/app/controllers/users_controller.rb +1 -1
  45. data/spec/dummy/app/mailers/my_mailer.rb +1 -1
  46. data/spec/dummy/app/models/application_record.rb +3 -0
  47. data/spec/dummy/app/models/role.rb +2 -5
  48. data/spec/dummy/app/models/user.rb +1 -1
  49. data/spec/dummy/bin/bundle +1 -1
  50. data/spec/dummy/bin/rails +1 -1
  51. data/spec/dummy/config/application.rb +7 -2
  52. data/spec/dummy/config/boot.rb +2 -2
  53. data/spec/dummy/config/environment.rb +1 -1
  54. data/spec/dummy/config.ru +1 -1
  55. data/spec/dummy/db/awesome_translations.sqlite3 +0 -0
  56. data/spec/dummy/db/development.sqlite3 +0 -0
  57. data/spec/dummy/db/test.sqlite3 +0 -0
  58. data/spec/dummy/log/development.log +52 -0
  59. data/spec/dummy/log/test.log +770 -0
  60. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/2m/2mnPY9uUnBNkGHLxtFaWv5hB3oA7sY2K1ZtwQlZLnAY.cache +2 -0
  61. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/3N/3NnKgR2TsTI1qCXKZpts0uJzp2dRJcoYp3nnFU6YE4o.cache +2 -0
  62. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/5r/5rpKlqLSFsRCibev7g6MQkIOhWuOah-1KAN3aqV_fYI.cache +0 -0
  63. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/6E/6ExTs_VkmUe-fovt99Kw8rq-xCfx0_qGsSoldSWScZI.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8O/8OrG8phjC9s5-_7GAI2TEmRjsrGsuvq1gnJQPdMm8v8.cache +0 -0
  65. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8f/8f4REKYOWkNfHexyAVqGXnbOP3vky_ANapWzlRMDeQ4.cache +3 -0
  66. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/8n/8n_viDw_qMQaQmqHM0ObPADed5uRyEYo3gDZIiTqUyA.cache +1 -0
  67. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/9e/9euY4B26kaHeiqfd1Qc0bsfRjpzmq36X6uqUfaRNtIs.cache +1 -0
  68. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/AB/AB5PxrhEqi8qOm7AmSf-sHDs9ffj_iTsytaHas2ryPA.cache +1 -0
  69. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/AI/AICJO1oM9dzlQ_N1QlHcCN9e8PC0wjtYk7-VmuNdfwg.cache +0 -0
  70. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ca/CaGQBiCuFgkHQ5gw8ZnGQqO8iP1md3GcllDsmaKBFdQ.cache +2 -0
  71. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ch/ChWez9UVXMuuBpLJMDRGuDmMuXy8gIuFo6794-wBgXc.cache +1 -0
  72. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/D9/D9eOwgl8pLlC7LJu-LL59UeHm9d-CH1mPgsA8j6xkMg.cache +1 -0
  73. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Do/Do83AoOat5W-c1g7piDGy2GMmffsY6JY0Qfuh5PY3GM.cache +2 -0
  74. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Hn/Hn53895nYKzu-g1FJKYS_yszYqCADXasTmN615R_qMQ.cache +1 -0
  75. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/It/ItV7jxV0bfHndR-H3cidDwpTFGhvs0ETLRqCTmZMXB8.cache +1 -0
  76. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/LL/LL0EenAcTXP-UNCqfcKtMF4Z8oDeWvdlwLQfuOVRPdw.cache +0 -0
  77. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Mj/MjwYGG9GkHD1fwwH2bg66EBYl3zCA_mqeDF9otey4-U.cache +3 -0
  78. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/NU/NUN9oO9gyoo-sY32AOLHdDACjLIxisCxXdKd84ou6cs.cache +2 -0
  79. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Ob/ObuKkBd-camcT52YpgeuyheU-GDFLZCJnoVtq2plgW0.cache +0 -0
  80. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Og/Og_HPfE6734sqkQ0_h4EkOOx3Aoq1LABLH9ovjl6Bvw.cache +0 -0
  81. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Pw/Pwuhz_6So_JcSrxT0Uf4VaLhh_FFSJMKxLZFMbS0LNQ.cache +0 -0
  82. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/R-/R-nohuDiORrLlJJtKc5bQsjIRS8yTQFVR3EIxJx3JZw.cache +1 -0
  83. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/SX/SXA6qKBlsAQ-MLPi7-KPCPcSx9Gg2VR1xa-lCmgipgA.cache +1 -0
  84. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/Sb/Sb1Vug319YfPL2Rci1PLMLXJjeIFYcNbHb5hKOvO1eo.cache +2 -0
  85. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/_f/_f0DjbdXTMEPb52THCCF5qbKkDs28tHHnap5ag4jsdU.cache +0 -0
  86. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/dT/dTb1O_9BwFdhA3VT1UTxY-XIIoAGDHGHVO9bzRUNIfc.cache +0 -0
  87. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/dV/dVTKOfd8qDIHT3VD-4emnl0yAIxcSF1pY0CUESPHwdM.cache +0 -0
  88. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/i0/i0TQIUsntlYrsibtn9YfB3qbI6bj8hLPom8KUfxR078.cache +1 -0
  89. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/jF/jFFXBsyFdv_TiNykX219AHs3Q7dQInYRP_80cAWZsgE.cache +0 -0
  90. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/mX/mXfx3VRudxpXrRx1aejtNA5YHOwND3kwWUfvdXHSors.cache +2 -0
  91. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/nG/nGQXdOLWsP4c926DJJBNXFUE0cKfZynnqN5aQ4T1I48.cache +1 -0
  92. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/oX/oXeqOS7RZb4eFbKrraeQtr6TUrXPTueLN_Crp7S0RLE.cache +1 -0
  93. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/p2/p27Ube4R6tciXRc0F8lpz6wUzmXIPxwqz7dKaUYVVuc.cache +1 -0
  94. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/pv/pv6tV3CDkIAmLXdU8EPLlNEkXAKJPufVD4VP30o4fWo.cache +2 -0
  95. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/q6/q6BYa32YJF11eGVapO4ouNl6gayPIsARgMavlzZmoi0.cache +2 -0
  96. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/r5/r5draRYO72lGMZZKpqYbscAWxAawJVG7uO0uyx3iw24.cache +1 -0
  97. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/r7/r7kGQJTsdrqs3i-prYAVnngsoc6uAtrjLTULTJdgy9g.cache +1 -0
  98. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/rI/rITk_65QtUwq61bjRPAksGeJxbLUFfz-sFPnQiZPHjw.cache +3 -0
  99. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/rR/rRS9OkVGJ9Wvs1fwZH-raqD4sXkbV8WmlLGIibYpZmI.cache +0 -0
  100. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/u9/u9nsXMBU9hA4UnH4SDHgk19ev_JNeeiS1-EZDrgStCI.cache +1 -0
  101. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/un/unZXcRqhGJwHvVWJmJ1rTizBZq6H5jF28E5-FHyTYL4.cache +1 -0
  102. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/wP/wP-1NwhQC0Sp_5PHpwAI7N0_N99vLNy0TA2FcMd6zgE.cache +0 -0
  103. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/x7/x7KkTV3ibfIEysLB_ug5bfmnn2VLV_BldukPR3EoPBk.cache +2 -0
  104. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/xr/xrDdkyCzfXr-pIE8gfvD8iFiWPuq9EwuZIl-uU9s0_o.cache +1 -0
  105. data/spec/dummy/tmp/cache/assets/sprockets/v4.0.0/yc/yc3EXb1cvVLmwnk8aQN89bgVFeuwsVz2k2p0mvC2c3c.cache +1 -0
  106. data/spec/factories/group.rb +2 -2
  107. data/spec/factories/handler.rb +4 -4
  108. data/spec/factories/handler_translation.rb +5 -5
  109. data/spec/factories/translation_key.rb +1 -1
  110. data/spec/factories/translation_value.rb +3 -3
  111. data/spec/features/clean_ups_spec.rb +2 -5
  112. data/spec/features/duplicates_spec.rb +5 -7
  113. data/spec/features/movals_spec.rb +8 -10
  114. data/spec/handlers/file_handler_spec.rb +8 -8
  115. data/spec/handlers/model_handler_spec.rb +4 -4
  116. data/spec/handlers/validations_handler_spec.rb +3 -3
  117. data/spec/handlers_spec.rb +1 -1
  118. data/spec/lib/cache_database_generator_spec.rb +4 -4
  119. data/spec/lib/erb_inspector/file_inspector_spec.rb +2 -2
  120. data/spec/lib/erb_inspector/translation_inspector_spec.rb +2 -2
  121. data/spec/lib/erb_inspector_spec.rb +5 -5
  122. data/spec/lib/model_inspector_spec.rb +4 -4
  123. data/spec/lib/translation_migrator_spec.rb +3 -3
  124. data/spec/models/awesome_translations/handler_spec.rb +1 -1
  125. data/spec/models/awesome_translations/translated_value_spec.rb +1 -3
  126. data/spec/models/awesome_translations/translation_spec.rb +7 -2
  127. data/spec/spec_helper.rb +7 -8
  128. metadata +186 -101
  129. data/config/initializers/simple_form_ransack.rb +0 -1
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"1processors:type=text/css&file_type=text/scss;TTI"zfile-digest:///home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/application.scss;TTI"?processors:type=text/css&file_type=text/scss&pipeline=self;TTI"ufile-digest:///home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/groups.scss;TTF
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"8file-digest://app/assets/javascripts/application.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTF
@@ -0,0 +1 @@
1
+ I"�/home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/application.scss?type=text/css&pipeline=self&id=8f6d91c9e9738d7eb89b1afcb885f93d3ced675e134504178a6cab61d97d89eb:ET
@@ -0,0 +1,3 @@
1
+ [o:Set:
2
+ @hash}
3
+ I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"xfile-digest:///home/dev/Development/awesome_translations/app/assets/javascripts/awesome_translations/application.js;TTF
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/application.js?type=application/javascript&pipeline=self&id=cd690edccdd0a0a00aaa35f0950b77e22a23c70fa51ae6c582d5f00164093b6c:ET
@@ -0,0 +1 @@
1
+ I"�/home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/application.scss?type=text/css&id=65d66091d21edab70ef798e305fbbbbf55dfeebeec31697d9df49f393c631c50:ET
@@ -0,0 +1 @@
1
+ "%+f����5���N�E�Ȼ�����@��<"���
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"?processors:type=text/css&file_type=text/scss&pipeline=self;TTI"zfile-digest:///home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/application.scss;TTI"ufile-digest:///home/dev/Development/awesome_translations/app/assets/stylesheets/awesome_translations/groups.scss;TTF
@@ -0,0 +1 @@
1
+ I"�app/assets/stylesheets/application.css?type=text/css&pipeline=self&id=bade2183fbf3165fd2ea4f36670e84338d4c74f8a8be8641211f1c7cd717b4b2:ET
@@ -0,0 +1 @@
1
+ "%��Rm�v�S3.��O�L���ڹc�ƕq�=_j�
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash}I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"0file-digest://app/assets/config/manifest.js;TTI"$file-digest://app/assets/images;TTI")file-digest://app/assets/javascripts;TTI"8file-digest://app/assets/javascripts/application.js;TTI"9file-digest://app/assets/javascripts/translations.js;TTI")file-digest://app/assets/stylesheets;TTI"9file-digest://app/assets/stylesheets/application.css;TTF
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/translations.js?type=application/javascript&id=c3be52e6babb59f49bc45b2908a64c0dcd21a814759626ae2afad501aeaee6f0:ET
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/application.js?type=application/javascript&id=d5186d65c547d6cd9bc78150ff19d2257c105dc3c649d86c527cbde0c077d4b0:ET
@@ -0,0 +1,3 @@
1
+ [o:Set:
2
+ @hash}
3
+ I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"8file-digest://app/assets/javascripts/application.js;TTF
@@ -0,0 +1,2 @@
1
+ "%5q<W2q��1ޖ�?�
2
+ �z;�M��Q��
@@ -0,0 +1 @@
1
+ "%��B�����șo�$'�A�d��L���xR�U
@@ -0,0 +1 @@
1
+ I"}app/assets/stylesheets/application.css?type=text/css&id=c3c028504989adf81c83b3336a2842acb7600054c6bb11bd941d3b3625b9d4f4:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"9file-digest://app/assets/javascripts/translations.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTF
@@ -0,0 +1 @@
1
+ "%��B�����șo�$'�A�d��L���xR�U
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"xfile-digest:///home/dev/Development/awesome_translations/app/assets/javascripts/awesome_translations/application.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTF
@@ -0,0 +1 @@
1
+ "%*��}�y€B?x��{w�KBq����5=��
@@ -0,0 +1 @@
1
+ "%�ku9FJʚ�$M���=s���:�BwbՈ%��-�
@@ -0,0 +1 @@
1
+ "%�=��=Z@��ȖV'Q��0߅ch9xJ��|K
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash}I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Lprocessors:type=application/javascript&file_type=application/javascript;TTI"0file-digest://app/assets/config/manifest.js;TTI"8file-digest://app/assets/javascripts/application.js;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"9file-digest://app/assets/javascripts/translations.js;TTI"0processors:type=text/css&file_type=text/css;TTI"9file-digest://app/assets/stylesheets/application.css;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI")file-digest://app/assets/stylesheets;TTI"$file-digest://app/assets/images;TTI")file-digest://app/assets/javascripts;TTF
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI"9file-digest://app/assets/stylesheets/application.css;TTI")file-digest://app/assets/stylesheets;TTF
@@ -0,0 +1 @@
1
+ I"�/home/dev/Development/awesome_translations/app/assets/javascripts/awesome_translations/application.js?type=application/javascript&id=f27330e7f810a85683dd5aa05a1801d663943594a8b1755bc2aadd421edde806:ET
@@ -0,0 +1 @@
1
+ I"�app/assets/config/manifest.js?type=application/javascript&pipeline=self&id=95ca277002eef1086af23325a3588fe4ff8524e9b3788149a28454d2f5f4f02b:ET
@@ -0,0 +1,3 @@
1
+ [o:Set:
2
+ @hash}
3
+ I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"Zprocessors:type=application/javascript&file_type=application/javascript&pipeline=self;TTI"9file-digest://app/assets/javascripts/translations.js;TTF
@@ -0,0 +1 @@
1
+ I"�app/assets/javascripts/translations.js?type=application/javascript&pipeline=self&id=b9dcbfb1c62c86a82e0b61ff094257970a00cd2699f9dcf1aa57864e56e505dd:ET
@@ -0,0 +1 @@
1
+ I"}app/assets/config/manifest.js?type=application/javascript&id=8acaa94dcec260a4b91495367e843c5d681fdc9146bd5f9bda713f44a78e9401:ET
@@ -0,0 +1,2 @@
1
+ [o:Set:
2
+ @hash} I"environment-version:ETTI"environment-paths;TTI"rails-env;TTI"0processors:type=text/css&file_type=text/css;TTI"9file-digest://app/assets/stylesheets/application.css;TTI">processors:type=text/css&file_type=text/css&pipeline=self;TTI")file-digest://app/assets/stylesheets;TTF
@@ -0,0 +1 @@
1
+ I"�/home/dev/Development/awesome_translations/app/assets/javascripts/awesome_translations/application.js?type=application/javascript&pipeline=self&id=332458c2a49c3eb7751b037ee54b84bf0cbe17a7b0cd81a6b8a96566d07ad1e9:ET
@@ -0,0 +1 @@
1
+ "%��B�����șo�$'�A�d��L���xR�U
@@ -2,7 +2,7 @@ FactoryBot.define do
2
2
  factory :group, class: "AwesomeTranslations::CacheDatabaseGenerator::Group" do
3
3
  handler
4
4
 
5
- identifier "tests"
6
- name "Tests"
5
+ identifier { "tests" }
6
+ name { "Tests" }
7
7
  end
8
8
  end
@@ -1,11 +1,11 @@
1
1
  FactoryBot.define do
2
2
  factory :handler, class: "AwesomeTranslations::CacheDatabaseGenerator::Handler" do
3
- identifier "rails_handler"
4
- name "RailsHandler"
3
+ identifier { "rails_handler" }
4
+ name { "RailsHandler" }
5
5
 
6
6
  factory :model_handler do
7
- identifier "model_handler"
8
- name "ModelHandler"
7
+ identifier { "model_handler" }
8
+ name { "ModelHandler" }
9
9
  end
10
10
  end
11
11
  end
@@ -4,10 +4,10 @@ FactoryBot.define do
4
4
  translation_key
5
5
  group
6
6
 
7
- key_show "some.key"
8
- file_path nil
9
- line_no nil
10
- full_path nil
11
- dir "#{Rails.root}/config/locales/awesome_translations/some/key"
7
+ key_show { "some.key" }
8
+ file_path { nil }
9
+ line_no { nil }
10
+ full_path { nil }
11
+ dir { Rails.root.join("config/locales/awesome_translations/some/key") }
12
12
  end
13
13
  end
@@ -3,6 +3,6 @@ FactoryBot.define do
3
3
  handler
4
4
  group
5
5
 
6
- key "some.key"
6
+ key { "some.key" }
7
7
  end
8
8
  end
@@ -2,8 +2,8 @@ FactoryBot.define do
2
2
  factory :translation_value, class: "AwesomeTranslations::CacheDatabaseGenerator::TranslationValue" do
3
3
  translation_key
4
4
 
5
- file_path "#{Rails.root}/config/locales/some_file.yml"
6
- locale "en"
7
- value "English"
5
+ file_path { Rails.root.join("config/locales/some_file.yml") }
6
+ locale { "en" }
7
+ value { "English" }
8
8
  end
9
9
  end
@@ -7,7 +7,7 @@ describe AwesomeTranslations::CleanUpsController do
7
7
  create :translation_value,
8
8
  translation_key: translation_key,
9
9
  locale: "da",
10
- file_path: "#{Rails.root}/config/locales/awesome_translations/some_file.yml"
10
+ file_path: Rails.root.join("config/locales/awesome_translations/some_file.yml")
11
11
  end
12
12
  let(:content) do
13
13
  {
@@ -21,10 +21,7 @@ describe AwesomeTranslations::CleanUpsController do
21
21
 
22
22
  before do
23
23
  FileUtils.mkdir_p(File.dirname(translation_value.file_path))
24
-
25
- File.open(translation_value.file_path, "w") do |fp|
26
- fp.write(YAML.dump(content))
27
- end
24
+ File.write(translation_value.file_path, YAML.dump(content))
28
25
  end
29
26
 
30
27
  it "works" do
@@ -4,18 +4,18 @@ describe AwesomeTranslations::DuplicatesController do
4
4
  let!(:handler_translation) do
5
5
  create :handler_translation,
6
6
  translation_key: translation_key,
7
- dir: Rails.root.join("config", "locales", "some", "right", "path")
7
+ dir: Rails.root.join("config/locales/some/right/path")
8
8
  end
9
9
  let!(:translation_key) { create :translation_key, key: "some.key" }
10
10
  let!(:translation_value) do
11
11
  create :translation_value,
12
12
  translation_key: translation_key,
13
- file_path: Rails.root.join("config", "locales", "some", "right", "path", "en.yml")
13
+ file_path: Rails.root.join("config/locales/some/right/path/en.yml")
14
14
  end
15
15
  let!(:translation_value_duplicate) do
16
16
  create :translation_value,
17
17
  translation_key: translation_key,
18
- file_path: Rails.root.join("config", "locales", "some", "wrong", "path", "en.yml")
18
+ file_path: Rails.root.join("config/locales/some/wrong/path/en.yml")
19
19
  end
20
20
 
21
21
  before do
@@ -30,9 +30,7 @@ describe AwesomeTranslations::DuplicatesController do
30
30
  }
31
31
  }
32
32
 
33
- File.open(translation_value_duplicate.file_path, "w") do |fp|
34
- fp.write(YAML.dump(translation_yaml))
35
- end
33
+ File.write(translation_value_duplicate.file_path, YAML.dump(translation_yaml))
36
34
  end
37
35
 
38
36
  describe "#index" do
@@ -40,7 +38,7 @@ describe AwesomeTranslations::DuplicatesController do
40
38
  visit duplicates_path
41
39
 
42
40
  expect(page).to have_http_status(:success)
43
- expect(current_path).to eq duplicates_path
41
+ expect(page).to have_current_path duplicates_path, ignore_query: true
44
42
 
45
43
  find("input[type=checkbox][name='d[#{translation_value_duplicate.id}]']")
46
44
 
@@ -1,16 +1,16 @@
1
1
  require "spec_helper"
2
2
 
3
- describe AwesomeTranslations::MovalsController do
3
+ describe AwesomeTranslations::MovalsController do # rubocop:disable RSpec/MultipleMemoizedHelpers
4
4
  let!(:handler_translation) do
5
5
  create :handler_translation,
6
6
  translation_key: translation_key,
7
- dir: Rails.root.join("config", "locales", "some", "right", "path")
7
+ dir: Rails.root.join("config/locales/some/right/path")
8
8
  end
9
9
  let!(:translation_key) { create :translation_key, key: "some.key" }
10
10
  let!(:translation_value) do
11
11
  create :translation_value,
12
12
  translation_key: translation_key,
13
- file_path: Rails.root.join("config", "locales", "some", "wrong", "path", "en.yml")
13
+ file_path: Rails.root.join("config/locales/some/wrong/path/en.yml")
14
14
  end
15
15
 
16
16
  let!(:handler_translation_right_path) { create :handler_translation, translation_key: translation_key_right_path, dir: "/some/path" }
@@ -29,17 +29,15 @@ describe AwesomeTranslations::MovalsController do
29
29
  }
30
30
  }
31
31
 
32
- File.open(translation_value.file_path, "w") do |fp|
33
- fp.write(YAML.dump(translation_yaml))
34
- end
32
+ File.write(translation_value.file_path, YAML.dump(translation_yaml))
35
33
  end
36
34
 
37
- describe "#index" do
35
+ describe "#index" do # rubocop:disable RSpec/MultipleMemoizedHelpers
38
36
  it "renders the page and shows the correct results" do
39
37
  visit movals_path
40
38
 
41
39
  expect(page).to have_http_status(:success)
42
- expect(current_path).to eq movals_path
40
+ expect(page).to have_current_path movals_path, ignore_query: true
43
41
 
44
42
  find("input[type=checkbox][value='#{handler_translation.id}']") # Expect to find
45
43
 
@@ -49,14 +47,14 @@ describe AwesomeTranslations::MovalsController do
49
47
  end
50
48
  end
51
49
 
52
- describe "#create" do
50
+ describe "#create" do # rubocop:disable RSpec/MultipleMemoizedHelpers
53
51
  it "moves the checked translations to the right path" do
54
52
  visit movals_path
55
53
 
56
54
  find("input[type=submit]").click
57
55
  translation_value.reload
58
56
 
59
- expect(translation_value.file_path).to eq Rails.root.join("config", "locales", "some", "right", "path", "en.yml").to_s
57
+ expect(translation_value.file_path).to eq Rails.root.join("config/locales/some/right/path/en.yml").to_s
60
58
  end
61
59
  end
62
60
  end
@@ -3,7 +3,7 @@ require "spec_helper"
3
3
  describe AwesomeTranslations::Handlers::FileHandler do
4
4
  let(:handler) { AwesomeTranslations::Handlers::FileHandler.new }
5
5
 
6
- describe "erb stuff" do
6
+ describe "erb stuff" do # rubocop:disable RSpec/MultipleMemoizedHelpers
7
7
  let(:users_index_group) { handler.groups.find { |group| group.name == "app/views/users/index.html.haml" } }
8
8
  let(:users_index_translations) { users_index_group.translations }
9
9
  let(:users_partial_test_translations) { handler.groups.find { |group| group.name == "app/views/users/_partial_test.html.erb" }.translations }
@@ -36,11 +36,11 @@ describe AwesomeTranslations::Handlers::FileHandler do
36
36
 
37
37
  it "sets the correct translation path" do
38
38
  danish_translation = layout_translations.find { |t| t.key == "layouts.application.danish" }
39
- expect(danish_translation.dir).to eq "#{Rails.root}/config/locales/awesome_translations/layouts/application"
39
+ expect(danish_translation.dir).to eq Rails.root.join("config/locales/awesome_translations/layouts/application").to_s
40
40
  end
41
41
  end
42
42
 
43
- describe "library stuff" do
43
+ describe "library stuff" do # rubocop:disable RSpec/MultipleMemoizedHelpers
44
44
  let(:group) { handler.groups.find { |group| group.name == "app/models/role.rb" } }
45
45
  let(:mailer_group) { handler.groups.find { |group| group.name == "app/mailers/my_mailer.rb" } }
46
46
  let(:subject_translation) { mailer_group.translations.find { |translation| translation.key == "my_mailer.mailer_action.custom_subject" } }
@@ -51,7 +51,7 @@ describe AwesomeTranslations::Handlers::FileHandler do
51
51
  let(:update_saved_translation) { users_controller_handler.translations.find { |translation| translation.key == "users.user_was_updated" } }
52
52
 
53
53
  it "finds translations made with the t method" do
54
- expect(admin_translation).to_not eq nil
54
+ expect(admin_translation).not_to eq nil
55
55
  expect(admin_translation.key).to eq "models.role.administrator"
56
56
  expect(admin_translation.dir).to end_with "spec/dummy/config/locales/awesome_translations/models/role"
57
57
  end
@@ -64,8 +64,8 @@ describe AwesomeTranslations::Handlers::FileHandler do
64
64
  moderator_translation = group.translations.find { |translation| translation.key == "models.role.moderator" }
65
65
  user_translation = group.translations.find { |translation| translation.key == "models.role.user" }
66
66
 
67
- expect(moderator_translation).to_not eq nil
68
- expect(user_translation).to_not eq nil
67
+ expect(moderator_translation).not_to eq nil
68
+ expect(user_translation).not_to eq nil
69
69
  end
70
70
 
71
71
  it "finds helpers translations using helper_t" do
@@ -73,7 +73,7 @@ describe AwesomeTranslations::Handlers::FileHandler do
73
73
  end
74
74
 
75
75
  it "finds translations with the controller_t-method" do
76
- expect(update_saved_translation).to_not eq nil
76
+ expect(update_saved_translation).not_to eq nil
77
77
  expect(update_saved_translation.key).to eq "users.user_was_updated"
78
78
  expect(update_saved_translation.dir).to end_with "spec/dummy/config/locales/awesome_translations/users"
79
79
  end
@@ -93,7 +93,7 @@ describe AwesomeTranslations::Handlers::FileHandler do
93
93
  end
94
94
 
95
95
  it "sets the correct translation path" do
96
- expect(yes_translation.dir).to eq "#{Rails.root}/config/locales/awesome_translations"
96
+ expect(yes_translation.dir).to eq Rails.root.join("config/locales/awesome_translations").to_s
97
97
  end
98
98
 
99
99
  it "detects absolute existing direct translations" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe AwesomeTranslations::Handlers::ModelHandler do
3
+ describe AwesomeTranslations::Handlers::ModelHandler do # rubocop:disable RSpec/MultipleMemoizedHelpers
4
4
  let(:model_handler) { AwesomeTranslations::Handlers::ModelHandler.new }
5
5
  let(:groups) { model_handler.groups.to_a }
6
6
  let(:user_group) { model_handler.groups.detect { |group| group.name == "User" } }
@@ -9,11 +9,11 @@ describe AwesomeTranslations::Handlers::ModelHandler do
9
9
  let(:role_translation_keys) { role_group.translations.map(&:key).to_a }
10
10
 
11
11
  it "#groups" do
12
- expect(groups.length).to eq 4
12
+ expect(groups.length).to eq 5
13
13
  end
14
14
 
15
- describe "#translations_for_group" do
16
- it "should find the right number of translations" do
15
+ describe "#translations_for_group" do # rubocop:disable RSpec/MultipleMemoizedHelpers
16
+ it "finds the right number of translations" do
17
17
  expect(user_group.translations.to_a.length).to eq 7
18
18
  end
19
19
 
@@ -6,7 +6,7 @@ describe AwesomeTranslations::Handlers::ValidationsHandler do
6
6
  let(:blank_email_translation) { user_group.translations.find { |translation| translation.key.include? "email.blank" } }
7
7
 
8
8
  it "#groups" do
9
- expect(validations_handler.groups.to_a.length).to eq 4
9
+ expect(validations_handler.groups.to_a.length).to eq 5
10
10
  end
11
11
 
12
12
  describe "#translations_for_group" do
@@ -19,12 +19,12 @@ describe AwesomeTranslations::Handlers::ValidationsHandler do
19
19
  end
20
20
 
21
21
  it "finds the right directory" do
22
- expect(blank_email_translation.dir).to eq "#{Rails.root}/config/locales/awesome_translations/models/user"
22
+ expect(blank_email_translation.dir).to eq Rails.root.join("config/locales/awesome_translations/models/user").to_s
23
23
  end
24
24
 
25
25
  it "finds confirmation translations" do
26
26
  confirmation_translation = user_group.translations.find { |translation| translation.key.include? "email_confirmation" }
27
- expect(confirmation_translation).to_not be_blank
27
+ expect(confirmation_translation).not_to be_blank
28
28
  expect(confirmation_translation.key).to eq "activerecord.errors.models.user.attributes.email_confirmation.confirmation"
29
29
  end
30
30
  end
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
 
3
3
  describe AwesomeTranslations::Handlers do
4
- it "should not include base in list" do
4
+ it "does not include base in list" do
5
5
  AwesomeTranslations::Handlers.list.each do |handler|
6
6
  expect(handler.id.to_s.downcase.include?("base")).to eq false
7
7
  end
@@ -6,7 +6,7 @@ describe AwesomeTranslations::CacheDatabaseGenerator do
6
6
  let(:db) { cache_database_generator.db }
7
7
 
8
8
  before do
9
- locales_path = Rails.root.join("config", "locales")
9
+ locales_path = Rails.root.join("config/locales")
10
10
  FileUtils.rm_rf(locales_path)
11
11
  Dir.mkdir(locales_path)
12
12
 
@@ -25,7 +25,7 @@ describe AwesomeTranslations::CacheDatabaseGenerator do
25
25
  }
26
26
  }
27
27
 
28
- File.open(fake_path, "w") { |fp| fp.write(YAML.dump(translations)) }
28
+ File.write(fake_path, YAML.dump(translations))
29
29
  end
30
30
 
31
31
  it "#init_database" do
@@ -41,7 +41,7 @@ describe AwesomeTranslations::CacheDatabaseGenerator do
41
41
  .where(translation_keys: {key: "activerecord.attributes.user.id"})
42
42
  .first
43
43
 
44
- expect(translation).to_not eq nil
44
+ expect(translation).not_to eq nil
45
45
  end
46
46
 
47
47
  it "#cache_handler_translations" do
@@ -53,7 +53,7 @@ describe AwesomeTranslations::CacheDatabaseGenerator do
53
53
  .where(translation_keys: {key: "activerecord.attributes.user.id"})
54
54
  .first
55
55
 
56
- expect(translation).to_not eq nil
56
+ expect(translation).not_to eq nil
57
57
  end
58
58
  end
59
59
  end
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe AwesomeTranslations::ErbInspector::FileInspector do
3
+ describe AwesomeTranslations::ErbInspector::FileInspector do # rubocop:disable RSpec/MultipleMemoizedHelpers
4
4
  let(:erb_inspector) do
5
5
  AwesomeTranslations::ErbInspector.new(
6
6
  dirs: [Rails.root.to_s]
@@ -15,7 +15,7 @@ describe AwesomeTranslations::ErbInspector::FileInspector do
15
15
  let(:user_index_translations) { user_index_inspector.translations.to_a }
16
16
  let(:hello_world_translation) { user_index_translations.find { |translation| translation.key == ".hello_world" } }
17
17
 
18
- describe "#translations" do
18
+ describe "#translations" do # rubocop:disable RSpec/MultipleMemoizedHelpers
19
19
  it "finds the right number of translations" do
20
20
  expect(user_index_translations.length).to eq 3
21
21
  end
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe AwesomeTranslations::ErbInspector::TranslationInspector do
3
+ describe AwesomeTranslations::ErbInspector::TranslationInspector do # rubocop:disable RSpec/MultipleMemoizedHelpers
4
4
  let(:erb_inspector) do
5
5
  AwesomeTranslations::ErbInspector.new(
6
6
  dirs: [Rails.root.to_s]
@@ -24,7 +24,7 @@ describe AwesomeTranslations::ErbInspector::TranslationInspector do
24
24
  end
25
25
 
26
26
  it "#full_path" do
27
- expect(hello_world_translation.full_path).to eq Rails.root.join("app", "views", "users", "index.html.haml").to_s
27
+ expect(hello_world_translation.full_path).to eq Rails.root.join("app/views/users/index.html.haml").to_s
28
28
  end
29
29
 
30
30
  it "#dir" do
@@ -11,19 +11,19 @@ describe AwesomeTranslations::ErbInspector do
11
11
  let(:file_paths) { files.map(&:file_path) }
12
12
 
13
13
  describe "#files" do
14
- it "should find haml-files" do
15
- expect(files.length).to eq 32
14
+ it "finds the right amount of haml-files" do
15
+ expect(files.length).to eq 34
16
16
  end
17
17
 
18
- it "should find haml-files" do
18
+ it "finds haml-files" do
19
19
  expect(file_paths).to include "app/views/users/index.html.haml"
20
20
  end
21
21
 
22
- it "should find js-files" do
22
+ it "finds js-files" do
23
23
  expect(file_paths).to include "app/assets/javascripts/translations.js"
24
24
  end
25
25
 
26
- it "should find erb-files" do
26
+ it "finds erb-files" do
27
27
  expect(file_paths).to include "app/views/users/show.html.erb"
28
28
  end
29
29
  end
@@ -2,15 +2,15 @@ require "spec_helper"
2
2
 
3
3
  describe AwesomeTranslations::ModelInspector do
4
4
  let(:user_inspector) { AwesomeTranslations::ModelInspector.model_classes.find { |model_inspector| model_inspector.clazz == User } }
5
- let(:model_classes) { AwesomeTranslations::ModelInspector.model_classes.map(&:clazz).select { |clazz| !clazz.name.end_with?("::Translation") } }
5
+ let(:model_classes) { AwesomeTranslations::ModelInspector.model_classes.map(&:clazz).reject { |clazz| clazz.name.end_with?("::Translation") } }
6
6
 
7
7
  it "#model_classes" do
8
- expect(model_classes.to_a.sort { |class1, class2| class1.name <=> class2.name }).to eq [Role, User]
8
+ expect(model_classes.to_a.sort_by(&:name)).to eq [ApplicationRecord, Role, User]
9
9
  end
10
10
 
11
11
  it "#engines" do
12
12
  expected = [ActionView::Railtie, AwesomeTranslations::Engine, MoneyRails::Engine]
13
- expect(AwesomeTranslations::ModelInspector.engines.map(&:class).sort { |class1, class2| class1.name <=> class2.name }).to eq expected
13
+ expect(AwesomeTranslations::ModelInspector.engines.map(&:class).sort_by(&:name)).to eq expected
14
14
  end
15
15
 
16
16
  it "#class_key" do
@@ -34,6 +34,6 @@ describe AwesomeTranslations::ModelInspector do
34
34
  end
35
35
 
36
36
  it "#attributes" do
37
- expect(user_inspector.attributes.map(&:name).to_a).to eq %w(id email password age)
37
+ expect(user_inspector.attributes.map(&:name).to_a).to eq %w[id email password age]
38
38
  end
39
39
  end