any_login 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +27 -0
  4. data/Rakefile +37 -0
  5. data/app/assets/images/any_login/person.png +0 -0
  6. data/app/controllers/any_login/application_controller.rb +11 -0
  7. data/app/helpers/any_login/application_helper.rb +58 -0
  8. data/app/views/any_login/_any_login.html.erb +123 -0
  9. data/config/routes.rb +7 -0
  10. data/lib/any_login.rb +99 -0
  11. data/lib/any_login/engine.rb +26 -0
  12. data/lib/any_login/routes.rb +7 -0
  13. data/lib/any_login/strategy/devise.rb +19 -0
  14. data/lib/any_login/version.rb +3 -0
  15. data/lib/generators/any_login/USAGE +8 -0
  16. data/lib/generators/any_login/any_login_generator.rb +6 -0
  17. data/lib/generators/any_login/templates/any_login.rb +13 -0
  18. data/test/any_login_test.rb +7 -0
  19. data/test/dummy/README.rdoc +28 -0
  20. data/test/dummy/Rakefile +6 -0
  21. data/test/dummy/app/assets/fonts/glyphicons-halflings-regular.eot +0 -0
  22. data/test/dummy/app/assets/fonts/glyphicons-halflings-regular.svg +288 -0
  23. data/test/dummy/app/assets/fonts/glyphicons-halflings-regular.ttf +0 -0
  24. data/test/dummy/app/assets/fonts/glyphicons-halflings-regular.woff +0 -0
  25. data/test/dummy/app/assets/fonts/glyphicons-halflings-regular.woff2 +0 -0
  26. data/test/dummy/app/assets/javascripts/application.js +15 -0
  27. data/test/dummy/app/assets/javascripts/bootstrap.min.js +7 -0
  28. data/test/dummy/app/assets/javascripts/home.js +2 -0
  29. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  30. data/test/dummy/app/assets/stylesheets/bootstrap-theme.min.css +5 -0
  31. data/test/dummy/app/assets/stylesheets/bootstrap.min.css +5 -0
  32. data/test/dummy/app/assets/stylesheets/home.css +4 -0
  33. data/test/dummy/app/controllers/application_controller.rb +5 -0
  34. data/test/dummy/app/controllers/home_controller.rb +9 -0
  35. data/test/dummy/app/helpers/application_helper.rb +2 -0
  36. data/test/dummy/app/helpers/home_helper.rb +2 -0
  37. data/test/dummy/app/models/user.rb +10 -0
  38. data/test/dummy/app/views/home/about.html.erb +2 -0
  39. data/test/dummy/app/views/home/index.html.erb +530 -0
  40. data/test/dummy/app/views/layouts/application.html.erb +22 -0
  41. data/test/dummy/app/views/shared/_footer.html.erb +16 -0
  42. data/test/dummy/app/views/shared/_header.html.erb +33 -0
  43. data/test/dummy/bin/bundle +3 -0
  44. data/test/dummy/bin/rails +4 -0
  45. data/test/dummy/bin/rake +4 -0
  46. data/test/dummy/bin/setup +29 -0
  47. data/test/dummy/config.ru +4 -0
  48. data/test/dummy/config/application.rb +26 -0
  49. data/test/dummy/config/boot.rb +5 -0
  50. data/test/dummy/config/database.yml +25 -0
  51. data/test/dummy/config/environment.rb +5 -0
  52. data/test/dummy/config/environments/development.rb +42 -0
  53. data/test/dummy/config/environments/production.rb +79 -0
  54. data/test/dummy/config/environments/test.rb +42 -0
  55. data/test/dummy/config/initializers/any_login.rb +5 -0
  56. data/test/dummy/config/initializers/assets.rb +11 -0
  57. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  58. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  59. data/test/dummy/config/initializers/devise.rb +262 -0
  60. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  61. data/test/dummy/config/initializers/inflections.rb +16 -0
  62. data/test/dummy/config/initializers/mime_types.rb +4 -0
  63. data/test/dummy/config/initializers/session_store.rb +3 -0
  64. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  65. data/test/dummy/config/locales/devise.en.yml +60 -0
  66. data/test/dummy/config/locales/en.yml +23 -0
  67. data/test/dummy/config/routes.rb +6 -0
  68. data/test/dummy/config/secrets.yml +22 -0
  69. data/test/dummy/db/development.sqlite3 +0 -0
  70. data/test/dummy/db/migrate/20150907190739_create_users.rb +9 -0
  71. data/test/dummy/db/migrate/20150907190846_add_devise_to_users.rb +49 -0
  72. data/test/dummy/db/migrate/20150909210357_populate_test_users.rb +21 -0
  73. data/test/dummy/db/schema.rb +37 -0
  74. data/test/dummy/db/test.sqlite3 +0 -0
  75. data/test/dummy/log/development.log +1128 -0
  76. data/test/dummy/log/test.log +373 -0
  77. data/test/dummy/public/404.html +67 -0
  78. data/test/dummy/public/422.html +67 -0
  79. data/test/dummy/public/500.html +66 -0
  80. data/test/dummy/public/favicon.ico +0 -0
  81. data/test/dummy/test/controllers/home_controller_test.rb +15 -0
  82. data/test/dummy/test/fixtures/users.yml +11 -0
  83. data/test/dummy/test/models/user_test.rb +7 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/0mUCX5MiuPurvwMDJN1viKrLiNvvFTZc-L6ZBrckEic.cache +1 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/2SYNbjkqPSMfgHiWdLtg7nuZalOIPjaNfQttqkDHHss.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/3Q9PpN59Iw3R8NFQfW4EE4gsPONlCYSdvAD3JsCbGIA.cache +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7iLZhCRqomVffwv-AVwkHFYCcmPKLrrk7qQChfRapi0.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/7ur7VUze24s0VKgJKWpnUo96FYlWHEmE8HNVJZZMNTE.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/8zb9xKJcvuzFNLl5eXm8-rMWpJcFxk8hMEmnWwSkMMQ.cache +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/AtSjVjN-l74fcYePzHnq_C7uDbKLzJtTnFyqpQfFU_4.cache +1 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/BmgZIlC4dPPN5_-UVlbtqC4gTJIdxEs0RdshJXE6MrE.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/CC1ihO7XYNMibY_amTWKI8YUE-hQGPYSpCaqmNg-Jjk.cache +1 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/C_5kL4_NWLeARMnjY-tAZ1QL-YK0CZVidwahgGIsFzE.cache +1 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/DGFPj1WMU5MK9HUz3l69cYrktq0pxG73ZYroFiWFf1Q.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/EI5LzNFYz6ZfxNyOoS1ZOx8cjFegSaBzfB3-qRCE8Uw.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/FAQZN9Offj6Ralh8lPOcWnqsujeCnr7kRDG35KPXIFg.cache +1 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/FEs8uokP_fREF7aomsryzRXjitBkvS9tWXmjSCB81_s.cache +2 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Fa6FU_PRuF2wp96Xm5R5izWdsog-W7-Fl8Ka6LvWWk0.cache +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/GAdJwtpszZDaIVjZ1vy_hhrduwyRVZ-UVvY1VWHC1F8.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/IccPPvFDyMMsygLAgf1nuZlbJFhWotiFNmcybOaFSro.cache +1 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/IlGSUvskziqqa652wnpgtDgid_Xny41bFG0ewd4lB7M.cache +4 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/J_8z3vJer-T2RbrrfOrrS-aanW_S2qbPaLmPgcAUTCM.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Ji0-C9rfE9nAgyKe3RRhYhog0GEaVgtWkXSOchJdJYM.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/K_jYNiV8wzkrkscwTARjB-fUFotRIGgDroMQRWsZoxE.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LFqrFvIrFTK4bxXknLWn2XqLAtiVYCxLng_CGNJ4SVo.cache +1 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/LsWw_Wu-4ficFT-ML0ZSsHOfPYWu1V3d5-MikqnX8Fc.cache +1 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/NEqiXLuP2oYe7BUdje_GmZ-W8tpK1aeaYF4gjJqv0RM.cache +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OrM4D1znaRp8zJBOHxDL6-QpEUTx98mqOthiNDmtv_Y.cache +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/OrR4h_6kjDqtTFVQuXjcgs0o7CxiOP63AEj_AGSAjtU.cache +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Owlced5DGUDsMwIsBZyIwvGxfm8ACWU3ay2phFkvSjM.cache +1 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/P6GmfkMYDKAH537GCnftfOOraEeXWHUBfh10dnmy4Gg.cache +1 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PF8peKtDrqGmgwiVlyi6IUk5qvykD3NPmuzKyA1PhP0.cache +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/PGAZI7MHK6aEYaV0hHeITwxJ5N03rsEaTwLqMw62t9U.cache +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Q3vUnsRezfxvQTLmfEUUbhKNB54P4eFotkxcswSF834.cache +1 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QBPpZbLf8M4F3nLK9viHM6W4N_JryJWPspRElgi6pJw.cache +1 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/QtG2mQIAsmnEypY91SLARNSWyyllU43Tf-29a5Q7IjA.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RICxiF1Y7tRr1144F7mHmJPW-mEKzj8mvHddAM2tiiM.cache +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/RkSvs4z6bXZCiOGZNxmI6QNJYKG-MS6FTQpKQAyDJc0.cache +1 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/SG1bNzk0fDOmjTY_MTvIDm0zXIIdNqTI6qkD0H9woOA.cache +0 -0
  122. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/TXOhutpNU8EMOUm5epQFgsJYCvqIc1TlLWbW5lo0uEs.cache +1 -0
  123. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/UM0weT-qqb6-BXbyenqRwt6ixDB_eb2faZeK1mvPZoY.cache +1 -0
  124. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/VeLENRGeiTBRwGJzFiViJTsWIBxrBd108tWE6VKn4Ek.cache +1 -0
  125. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/WtSTBHPqPJS6POv28C9Su9x2mW16It1Kfzn-iIGM44Q.cache +1 -0
  126. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/Wv2ZrYmoB1mW6LcyH4gmxG-CXkmL3XiMp8kC2gZMZJE.cache +2 -0
  127. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/YNjflxhjoc6hSFX1xoeS63gOYFKaBsmE-aEg7L9TaHA.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/aV2lHHL_bMOztNki30IWE4anPdMWzXAkfg_dPingc8Y.cache +1 -0
  129. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/bQoUeMoyVPAXgwui9DzMeA6I9dU19Q-ke1Xu3LC9dk4.cache +1 -0
  130. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/dvqnGzqP5nqsTc5Vkke-cprFBa45eFo2QNPspkN-qOQ.cache +1 -0
  131. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gPbb-C0stzrkDgjCLG6a6J1AGYNk4_X0kFvyGLRvSCc.cache +1 -0
  132. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gadB5x8m3Dg9LDdVonhWppxUv7J7zACwl_2FtL-WS2g.cache +1 -0
  133. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/gdEO0xoQMaFCyk0bLTL9puO0bSGNWg0PFKY2xlDW9HM.cache +1 -0
  134. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/hSDEcApI55-JVsyaRJw-W-DA0hrLo2fBsSRtizuEDBI.cache +0 -0
  135. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kO8N46uvJsIIglg5jaI0YRzqZxxVG7iyvUDwRjlCiFg.cache +1 -0
  136. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/kXF0ywhnFoQlc9Q4DYuleE1sNExOUZJlt24sV_8Nzfs.cache +1 -0
  137. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/l6JtVxklW8nQn3WaiBLRs2UU_cVrm9thr8FWrSQFnFE.cache +1 -0
  138. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/myQlTWBqjEV7aXVwBtOaHIt42To2MmC_zlFFqkPxjmw.cache +0 -0
  139. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/o2X38ta6JWjELW3lhNfN7_KowXHcyJu6vPjRv_xUZ28.cache +1 -0
  140. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pIVqc5tXAaLDSQbx4dvcFawX1iRPdcw_JTjDIE6Y0eM.cache +2 -0
  141. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/pnW3u_1AN48ig6ngefI89y96xoSlvnJurx-e3J-leoE.cache +0 -0
  142. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/qcN-H5ioVjPEIjojelEQsfdYHJLnVkRXiMfS7fMsOKM.cache +0 -0
  143. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/sGvDE_1KVdF5NOorceoKmEPLP3D8OF6yAs2B2UReguU.cache +0 -0
  144. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/sYqD_6_DLhWbWmBm4ZOKDNI8bKtF7czThI6GXwmFlMU.cache +2 -0
  145. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/sgALL3J-9VpCWqd6Gt4edjNFRDJCegUnBj_k4Hg1Lk0.cache +1 -0
  146. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/sh4xTbeFOQvmDNCWNG_o_rxwgbie1P7BovzPLTpYtg0.cache +1 -0
  147. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/ssS2x0Wl67rwXHaVHsh6CO7ayn9fQ5saIwATKN6O-nI.cache +0 -0
  148. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/th8j6zWSaTIS6jxJKJVLFy3P2LC9wdiuQ4C1xWcnhUM.cache +0 -0
  149. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/tuEq0SXuQh3A3UWa1dGXRLlKGMt6evB5YqwFJRyPvIE.cache +2 -0
  150. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uOsJ4RbOhb9nvMwhf9lzUHRpwpiRFNexQoQX3IoMafE.cache +1 -0
  151. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/urVojGa6d1SRmE17SmNPfvygicsNO0rKkv5O3sF4quE.cache +0 -0
  152. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/uugggZv5gxeHU2FxmV1B-bNg7quJtLpNiQUQBY8hEu4.cache +0 -0
  153. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/vC87Ti4dfYY3jCaPO6OPoRAuMfUMJ2p5tMjYAKtqUw4.cache +0 -0
  154. data/test/dummy/tmp/cache/assets/development/sprockets/v3.0/wSKFcgQC7KKgyXwKQKaMK6Ztjmt3kapkfDjS77n-W3I.cache +3 -0
  155. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2fnIYpMuQIhuY4fuSr391k1N56QWkitsT2boe8qTaMc.cache +1 -0
  156. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5LGawpUDypkb6KrQy14PHBOBvguN9iBvxEHH4FtD82Q.cache +0 -0
  157. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  158. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5v04KhtOaN4Y_Jr6jsIEZhn52V5A4l0w3CazUVzKjPU.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5x5QyKbF3AyeyEB4IM113P7-rE5Hy6bz2QwHeMrd7nA.cache +1 -0
  160. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7ur7VUze24s0VKgJKWpnUo96FYlWHEmE8HNVJZZMNTE.cache +0 -0
  161. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ASS8gmPSY4-jnkui14zqivm3x-lCN4eZklzKmn8Szg0.cache +0 -0
  162. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/AtSjVjN-l74fcYePzHnq_C7uDbKLzJtTnFyqpQfFU_4.cache +1 -0
  163. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/CRAJhzElqj5oh-wxyOrJ6HQwszHJvcya6hlcczfEtY4.cache +0 -0
  164. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/C_5kL4_NWLeARMnjY-tAZ1QL-YK0CZVidwahgGIsFzE.cache +1 -0
  165. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/CmKITYh3oVk9z51_l8Xi6Vn54j3utI0AWvWb19mJxK8.cache +0 -0
  166. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FAQZN9Offj6Ralh8lPOcWnqsujeCnr7kRDG35KPXIFg.cache +1 -0
  167. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FEs8uokP_fREF7aomsryzRXjitBkvS9tWXmjSCB81_s.cache +2 -0
  168. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Fv0q14URpEElr8JckQRM5nO4NmDRe_b0NrxveKXuu4s.cache +0 -0
  169. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GAdJwtpszZDaIVjZ1vy_hhrduwyRVZ-UVvY1VWHC1F8.cache +0 -0
  170. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/L1nRpuovk9hLaarXKukmEFFIlRHS-hp_ibkGxAVPcEE.cache +0 -0
  171. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/L7xpCtaByAnRRGFY2-UQGsMjrXfkqQeHO87Mibe3QhE.cache +0 -0
  172. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/O0KKUhoSmd2Q948y61hBrhm4UgbSJVgEqdLgsNbvoQU.cache +0 -0
  173. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  174. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OJ8Xn4kiILBc5N1iHDL2PuB3GOTLNLx66TJ-o9kiFb0.cache +1 -0
  175. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Owlced5DGUDsMwIsBZyIwvGxfm8ACWU3ay2phFkvSjM.cache +1 -0
  176. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OzZFerjHbWGTsFx92c-JF36NNjyMkzh6Zqqt0PjgAac.cache +1 -0
  177. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/P6GmfkMYDKAH537GCnftfOOraEeXWHUBfh10dnmy4Gg.cache +1 -0
  178. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/PBhQkLPfcMr8AauDPTSUphnFi9StIDWj0WBdaIIZFos.cache +1 -0
  179. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Q3vUnsRezfxvQTLmfEUUbhKNB54P4eFotkxcswSF834.cache +1 -0
  180. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RICxiF1Y7tRr1144F7mHmJPW-mEKzj8mvHddAM2tiiM.cache +0 -0
  181. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RXWAeuDhMtHr2vLlWWFw1oSqIiRFJcmY__w54DicQ58.cache +1 -0
  182. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RbEnVrLsa7hWrkBIGqV5ZdMPD-ehXmD7q4MS5aOIHU8.cache +0 -0
  183. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/RkSvs4z6bXZCiOGZNxmI6QNJYKG-MS6FTQpKQAyDJc0.cache +1 -0
  184. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UXd7yvTDXrekr6CX2dWbBYv9B3hTw2cZ4t2TuUiCLTc.cache +1 -0
  185. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VeLENRGeiTBRwGJzFiViJTsWIBxrBd108tWE6VKn4Ek.cache +1 -0
  186. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/W33KM6utzxdKHyRwJSe3vYO1aU2EntAXxZoSgZ1uUac.cache +1 -0
  187. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WUcaxhpxfHk3tsqG1JXQy6iBRK9eQ0pkHzxk2NGj3Ps.cache +1 -0
  188. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WtSTBHPqPJS6POv28C9Su9x2mW16It1Kfzn-iIGM44Q.cache +1 -0
  189. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Wv2ZrYmoB1mW6LcyH4gmxG-CXkmL3XiMp8kC2gZMZJE.cache +2 -0
  190. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XGM9it7b5UYdpWGq7Ce_s9bxIk2Dp2trc0ub0-WdTzs.cache +1 -0
  191. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Xtu0577MttfVSmKOiG5xJxvBam7MSF_GhOZynZsSeuc.cache +1 -0
  192. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Yi6XqUaOMhrVQYbOFDszEGKgq7eFdGgEiGtN1Dtjoco.cache +1 -0
  193. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YmhO31KbA_R395b8Sjeb065uOdHxZ2vrXDL36L3W7kE.cache +1 -0
  194. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_B5Bdp4aDeD-uSuI8DWuy-PpHM3v5eD3Gdi2zN3Mooc.cache +0 -0
  195. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bQoUeMoyVPAXgwui9DzMeA6I9dU19Q-ke1Xu3LC9dk4.cache +1 -0
  196. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/cWzqklKCwgjz3ySepSZKDQxCepO0xZSkCdZaTBTZVsQ.cache +1 -0
  197. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/egNsAXN2kaHymEOx3NU5BOnPhU_XYYlcSWUUvLMTdcA.cache +0 -0
  198. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gYomMdsiFcr9v9Gt3-xBlwggze8THA7rgwiaq-8IHrw.cache +1 -0
  199. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/gdEO0xoQMaFCyk0bLTL9puO0bSGNWg0PFKY2xlDW9HM.cache +1 -0
  200. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hIlbDHmRe1X_zVDANRw4wrHjnaasIGIu3SoUc5vH8O4.cache +1 -0
  201. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hSDEcApI55-JVsyaRJw-W-DA0hrLo2fBsSRtizuEDBI.cache +0 -0
  202. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hUmUEhmK7ztoXFpmikcwZMwk9h8tQnWyJjYfq0GPAKI.cache +0 -0
  203. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hqR9m0i5bhK0cfl3QGM_w2M_3Uk_IEqKjp-suKM_18Y.cache +0 -0
  204. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jagno3A0Rv2nweFB6787uBwRLs_i_u18XBCxLCV1-kk.cache +1 -0
  205. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kAeDHz-o0hn5oO-cwy0_Unre93ExAa4El8SSO23VgrA.cache +3 -0
  206. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kGyXKeXcBntxtFoWUtKtVa8aa1iGkF7jcYxHYjYnB2c.cache +0 -0
  207. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kNqvUZsqp7pXX8G6WPH1ix1zD50S9vdf4Ye-4SrbMWI.cache +0 -0
  208. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kO8N46uvJsIIglg5jaI0YRzqZxxVG7iyvUDwRjlCiFg.cache +1 -0
  209. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/m0IpB0R9vr_NP0tPSe2uoTDCa9E9dgHRELPwVhDBj-M.cache +1 -0
  210. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/myQlTWBqjEV7aXVwBtOaHIt42To2MmC_zlFFqkPxjmw.cache +0 -0
  211. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/o2X38ta6JWjELW3lhNfN7_KowXHcyJu6vPjRv_xUZ28.cache +1 -0
  212. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pIVqc5tXAaLDSQbx4dvcFawX1iRPdcw_JTjDIE6Y0eM.cache +2 -0
  213. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pnW3u_1AN48ig6ngefI89y96xoSlvnJurx-e3J-leoE.cache +0 -0
  214. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/sYqD_6_DLhWbWmBm4ZOKDNI8bKtF7czThI6GXwmFlMU.cache +2 -0
  215. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ssS2x0Wl67rwXHaVHsh6CO7ayn9fQ5saIwATKN6O-nI.cache +0 -0
  216. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tuEq0SXuQh3A3UWa1dGXRLlKGMt6evB5YqwFJRyPvIE.cache +2 -0
  217. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/u9XYz1n7lju0ZiAPZuUgGPBP-3FGlLYNGALaTpPBgU4.cache +0 -0
  218. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uOsJ4RbOhb9nvMwhf9lzUHRpwpiRFNexQoQX3IoMafE.cache +1 -0
  219. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uugggZv5gxeHU2FxmV1B-bNg7quJtLpNiQUQBY8hEu4.cache +0 -0
  220. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uzGDr56Ry0XUNOvcVav44pqVfhES2aLqDlo3PWGG2V4.cache +1 -0
  221. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/va_iem9gJRtQZFSf8UZZP07dwlVPWwBB_oQi535l87I.cache +1 -0
  222. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/wk5FwYB-2sMDpzX3UK3g269m9zybwAc6VhDwuc-GkG0.cache +0 -0
  223. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x1vgLKvr2zQdjUkf2BuMehFadl87MfEvMpinBRI6xIs.cache +0 -0
  224. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ykPzTe9EiclkiGrh4-oYIDrCebAtGq-gVA_pg2OnBUQ.cache +3 -0
  225. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zjW1WJXfQevh5kt1q_h1SZliBXs_CVzA7hq9cQPwVk8.cache +1 -0
  226. data/test/integration/navigation_test.rb +8 -0
  227. data/test/test_helper.rb +25 -0
  228. metadata +580 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8b605c6cf28c3b77fc9c919711ae19413c57a0c5
4
+ data.tar.gz: 97f57ec7dc774220f78711b9e87201f31141cee6
5
+ SHA512:
6
+ metadata.gz: f4caa97491d95fe009067878e10dbc98736d5bff4cc06178e9cc3c14965ecddf3fd49817766755e3bab1a513e2e1fef02df6dde674791b1276b43b59f790eb7a
7
+ data.tar.gz: 57d04699803fa58453fea583a2ecf11dd42f6be732e5533df4ae340b1e562aad9eb7e008fafe47bcd2d96a3d74a5817eef1c130bc4c3774750287716f77ab184
@@ -0,0 +1,20 @@
1
+ Copyright 2015 Igor Kasyanchuk
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,27 @@
1
+ = AnyLogin
2
+ {<img src="https://travis-ci.org/igorkasyanchuk/any_login.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/igorkasyanchuk/any_login]
3
+ {<img src="https://codeclimate.com/github/igorkasyanchuk/any_login/badges/gpa.svg" />}[https://codeclimate.com/github/igorkasyanchuk/any_login]
4
+
5
+ == Description
6
+ AnyLogin is created to speedup development process and allow developer's quickly login as any user in DB.
7
+
8
+ == Requirements
9
+ Ruby: 1.9.3, 2.X, Rails: >= 4.0. Right now works only in pair with Devise gem.
10
+
11
+ == Installation
12
+ *1* - Add to your Gemfile:
13
+ gem 'any_login'
14
+ *2* - Execute in console:
15
+ bundle install
16
+ *3* - In application layout (for example app/views/layouts/application.html.erb) add in the bottom of the page:
17
+ <%= any_login_here %>
18
+ *4* - Open your app and on the bottom left corner you will see semi-transparent user icon. Click on it and now you can select any user to login without password.
19
+
20
+ == Customization
21
+ If you want to customize gem run in console:
22
+ rails g any_login initializer
23
+ If will create file config/initializers/any_login.rb.
24
+
25
+ == Future Plans
26
+ 1. Add more tests.
27
+ 2. Add support for more authentication gems like Devise.
@@ -0,0 +1,37 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'AnyLogin'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+
37
+ task default: :test
@@ -0,0 +1,11 @@
1
+ module AnyLogin
2
+ class ApplicationController < ActionController::Base
3
+
4
+ if AnyLogin.enabled
5
+ def any_login
6
+ AnyLogin.strategy::Controller.instance_method(:any_login_sign_in).bind(self).call
7
+ end
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,58 @@
1
+ module AnyLogin
2
+ module ApplicationHelper
3
+ extend ActiveSupport::Concern
4
+
5
+ if AnyLogin.enabled
6
+
7
+ def any_login_here
8
+ if AnyLogin.enabled
9
+ render 'any_login/any_login'
10
+ end
11
+ end
12
+
13
+ def any_login_id_input
14
+ text_field_tag :id, '', :placeholder => "ID", :id => 'any_login_id_input'
15
+ end
16
+
17
+ def any_login_submit
18
+ submit_tag AnyLogin.login_button_label
19
+ end
20
+
21
+ def any_login_select
22
+ collection = AnyLogin.collection
23
+ select_options =
24
+ if AnyLogin.grouped?
25
+ grouped_options_for_select(collection)
26
+ else
27
+ options_for_select(collection)
28
+ end
29
+ select_tag :selected_id, select_options, select_html_options
30
+ end
31
+
32
+ def select_html_options
33
+ options = {}
34
+ #options = { :include_blank => true }
35
+ options[:onchange] = 'AnyLogin.on_select_change();' if AnyLogin.login_on == :both
36
+ options[:prompt] = AnyLogin.select_prompt
37
+ options
38
+ end
39
+
40
+ def any_login_klasses
41
+ klasses = []
42
+ klasses << "any_login_#{AnyLogin.position || 'bottom_left'}"
43
+ klasses << 'any_login_auto_show' if AnyLogin.auto_show
44
+ klasses.join(' ')
45
+ end
46
+
47
+ def current_user_information
48
+ if respond_to?(AnyLogin.current_user_method) && user = send(AnyLogin.current_user_method)
49
+ content_tag :span, :class => 'any_login_user_information' do
50
+ raw("Current #{AnyLogin.klass_name}: #{h(AnyLogin.format(user))} &mdash; ID: #{user.id}")
51
+ end
52
+ end
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+ end
@@ -0,0 +1,123 @@
1
+ <div id='any_login' class='<%= any_login_klasses %>'>
2
+ <%= form_tag any_login.sign_in_path, :method => :post, :id => 'any_login_form' do %>
3
+ <%= image_tag image_path('any_login/person.png'), :alt => AnyLogin.klass, :onclick => "AnyLogin.on_image_click();" %>
4
+ <span id='any_login_box' class='hidden_box'>
5
+ <%= any_login_select %>
6
+ or by
7
+ <%= any_login_id_input %>
8
+ <%= any_login_submit %>
9
+ <span id='current_user_information'><%= current_user_information %></span>
10
+ </span>
11
+ <% end %>
12
+ </div>
13
+
14
+ <script type="text/javascript" charset="utf-8">
15
+ Element.prototype.hasClass = function (className) {
16
+ return new RegExp(' ' + className + ' ').test(' ' + this.className + ' ');
17
+ };
18
+
19
+ Element.prototype.addClass = function (className) {
20
+ if (!this.hasClass(className)) {
21
+ this.className += ' ' + className;
22
+ }
23
+ };
24
+
25
+ Element.prototype.removeClass = function (className) {
26
+ var newClass = ' ' + this.className.replace(/[\t\r\n]/g, ' ') + ' '
27
+ if (this.hasClass(className)) {
28
+ while (newClass.indexOf( ' ' + className + ' ') >= 0) {
29
+ newClass = newClass.replace(' ' + className + ' ', ' ');
30
+ }
31
+ this.className = newClass.replace(/^\s+|\s+$/g, ' ');
32
+ }
33
+ };
34
+ Element.prototype.toggleClass = function (className) {
35
+ var newClass = ' ' + this.className.replace(/[\t\r\n]/g, " ") + ' ';
36
+ if (this.hasClass(className)) {
37
+ while (newClass.indexOf(" " + className + " ") >= 0) {
38
+ newClass = newClass.replace(" " + className + " ", " ");
39
+ }
40
+ this.className = newClass.replace(/^\s+|\s+$/g, ' ');
41
+ } else {
42
+ this.className += ' ' + className;
43
+ }
44
+ };
45
+
46
+ var AnyLogin = {};
47
+ AnyLogin.on_image_click = function() {
48
+ var elem = document.getElementById('any_login_box');
49
+ elem.toggleClass("hidden_box");
50
+ elem.toggleClass("visible_box");
51
+ };
52
+ AnyLogin.on_select_change = function() {
53
+ document.getElementById('any_login_form').submit();
54
+ };
55
+ </script>
56
+
57
+ <style type="text/css" media="screen">
58
+ #any_login {
59
+ position: fixed;
60
+ opacity: 0.5;
61
+ background: #5c4383;
62
+ color: white;
63
+ font-size: 16px;
64
+ line-height: 20px;
65
+ }
66
+ #any_login input, #any_login select {
67
+ color: black;
68
+ }
69
+ #any_login .hidden_box {
70
+ display: none;
71
+ }
72
+ #any_login .visible_box {
73
+ display: inline;
74
+ }
75
+ #any_login.any_login_top_left {
76
+ top: 0;
77
+ left: 0;
78
+ }
79
+ #any_login.any_login_top_right {
80
+ top: 0;
81
+ right: 0;
82
+ }
83
+ #any_login.any_login_bottom_left {
84
+ bottom: 0;
85
+ left: 0;
86
+ }
87
+ #any_login.any_login_bottom_right {
88
+ bottom: 0;
89
+ right: 0;
90
+ }
91
+ #any_login.any_login_visible {
92
+ opacity: 1;
93
+ }
94
+ #any_login img {
95
+ cursor: pointer;
96
+ vertical-align: middle;
97
+ }
98
+ #any_login:hover {
99
+ opacity: 1;
100
+ }
101
+ #any_login form {
102
+ padding: 4px 6px;
103
+ }
104
+ #any_login span {
105
+ display: none;
106
+ vertical-align: middle;
107
+ }
108
+ #any_login.any_login_auto_show span {
109
+ display: inline;
110
+ }
111
+ #any_login .any_login_user_information {
112
+ padding-left: 10px;
113
+ }
114
+ #any_login #any_login_id_input {
115
+ width: 30px;
116
+ }
117
+ #any_login span#current_user_information {
118
+ display: inline;
119
+ }
120
+ #any_login span#current_user_information span {
121
+ display: inline;
122
+ }
123
+ </style>
@@ -0,0 +1,7 @@
1
+ AnyLogin::Engine.routes.draw do
2
+ post '/any_login/sign_in' => 'application#any_login', as: :sign_in
3
+ end
4
+
5
+ Rails.application.routes.draw do
6
+ mount_routes
7
+ end
@@ -0,0 +1,99 @@
1
+ require 'any_login/engine'
2
+
3
+ module AnyLogin
4
+
5
+ module Strategy
6
+ autoload :Devise, 'any_login/strategy/devise'
7
+ end
8
+
9
+ mattr_accessor :enabled
10
+ @@enabled = true
11
+
12
+ mattr_accessor :strategy # current strategy, depends on auth gem
13
+ @@strategy = nil
14
+
15
+ mattr_accessor :assets # assets which we need to build for production
16
+ @@assets = nil
17
+
18
+ mattr_accessor :klass_name # Account, User, Person, etc
19
+ @@klass_name = 'User'
20
+
21
+ # .all, .active, .admins, .groped_collection, etc ... need to return an array (or hash with arrays) of users
22
+ mattr_accessor :collection_method
23
+ @@collection_method = :all
24
+
25
+ mattr_accessor :name_method # to format user name in dropdown list
26
+ @@name_method = proc { |e| [format(e), e.id] }
27
+
28
+ mattr_accessor :redirect_path_after_login # after logging in redirect user to path
29
+ @@redirect_path_after_login = :root_path
30
+
31
+ mattr_accessor :login_on # login on select change event OR click on button, or BOTH
32
+ @@login_on = :both
33
+
34
+ mattr_accessor :position
35
+ @@position = :bottom_left # position of any_login box top_left, top_right, bottom_left, bottom_right
36
+
37
+ mattr_accessor :login_button_label
38
+ @@login_button_label = 'Login' # label on Login button
39
+
40
+ mattr_accessor :select_prompt
41
+ @@select_prompt = "Select #{AnyLogin.klass_name}" # prompt message in select
42
+
43
+ mattr_accessor :current_user_method
44
+ @@current_user_method = :current_user # method to return current_user logged in
45
+
46
+ mattr_accessor :auto_show # show any_login box by default
47
+ @@auto_show = false
48
+
49
+ def self.setup
50
+ yield(self)
51
+ end
52
+
53
+ def self.grouped?
54
+ collection_type == :grouped
55
+ end
56
+
57
+ def self.collection
58
+ collection_raw.collect do |e|
59
+ if grouped?
60
+ [e[0], e[1].collect(&name_method)]
61
+ else
62
+ name_method.call(e)
63
+ end
64
+ end
65
+ end
66
+
67
+ def self.klass
68
+ @@klass ||= AnyLogin.klass_name.constantize
69
+ end
70
+
71
+ def self.assets
72
+ @@assets ||= ['any_login/person.png']
73
+ end
74
+
75
+ def self.format(user)
76
+ user.email
77
+ end
78
+
79
+ private
80
+
81
+ def self.collection_raw
82
+ @@collection_raw ||= AnyLogin.klass.send(AnyLogin.collection_method).to_a
83
+ end
84
+
85
+ def self.collection_type
86
+ @@collection_type ||=
87
+ if collection_raw[1].is_a?(Array)
88
+ :grouped
89
+ else
90
+ :single
91
+ end
92
+ @@collection_type
93
+ end
94
+
95
+ end
96
+
97
+ require 'any_login/engine'
98
+ require 'any_login/routes'
99
+ require 'any_login/version'
@@ -0,0 +1,26 @@
1
+ module AnyLogin
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace AnyLogin
4
+
5
+ initializer 'any_login.assets_precompile', :group => :all do |app|
6
+ app.config.assets.precompile += AnyLogin.assets
7
+ end
8
+
9
+ initializer 'any_login.helpers' do
10
+ if Object.const_defined?('Devise')
11
+ require 'any_login/strategy/devise'
12
+ else
13
+ throw 'Please use this gem with Devise.'
14
+ end
15
+
16
+ ActiveSupport.on_load :action_controller do
17
+ AnyLogin::ApplicationController.send :include, AnyLogin.strategy::Controller
18
+ end
19
+
20
+ ActiveSupport.on_load :action_view do
21
+ ActionView::Base.send :include, AnyLogin::ApplicationHelper
22
+ end
23
+ end
24
+
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ module ActionDispatch::Routing
2
+ class Mapper
3
+ def mount_routes(options = {})
4
+ mount AnyLogin::Engine => '/any_login', :as => options[:as] || 'any_login'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,19 @@
1
+ module AnyLogin
2
+ module Strategy
3
+ module Devise
4
+
5
+ module Controller
6
+
7
+ def any_login_sign_in
8
+ @loginable = AnyLogin.klass.find(params[:selected_id].presence || params[:id])
9
+ sign_in AnyLogin.klass.to_s.underscore.to_sym, @loginable
10
+ redirect_to main_app.send(AnyLogin.redirect_path_after_login)
11
+ end
12
+
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+
19
+ AnyLogin.strategy = AnyLogin::Strategy::Devise