trackster 0.1.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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +52 -0
- data/Rakefile +36 -0
- data/app/assets/config/trackster_manifest.js +2 -0
- data/app/assets/javascripts/trackster/application.js +13 -0
- data/app/assets/javascripts/trackster/pageviews.js +2 -0
- data/app/assets/stylesheets/trackster/application.css +15 -0
- data/app/assets/stylesheets/trackster/pageviews.css +4 -0
- data/app/controllers/trackster/pageviews_controller.rb +20 -0
- data/app/controllers/trackster/trackster_controller.rb +43 -0
- data/app/helpers/trackster/application_helper.rb +4 -0
- data/app/helpers/trackster/pageviews_helper.rb +2 -0
- data/app/jobs/trackster/application_job.rb +4 -0
- data/app/mailers/trackster/application_mailer.rb +6 -0
- data/app/models/application_record.rb +3 -0
- data/app/models/pageview.rb +15 -0
- data/app/models/trackster/application_record.rb +5 -0
- data/app/views/layouts/trackster/application.html.erb +14 -0
- data/app/views/trackster/pageviews/index.html.erb +24 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20171029023846_create_pageviews.rb +9 -0
- data/lib/tasks/trackster_tasks.rake +4 -0
- data/lib/trackster.rb +5 -0
- data/lib/trackster/engine.rb +35 -0
- data/lib/trackster/version.rb +3 -0
- data/spec/controllers/trackster/pageviews_controller_spec.rb +5 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/cable.js +13 -0
- data/spec/dummy/app/assets/javascripts/tests.js +2 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/tests.css +4 -0
- data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/tests_controller.rb +6 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/tests_helper.rb +2 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/app/views/tests/index.html.erb +1 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +38 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config.ru +5 -0
- data/spec/dummy/config/application.rb +18 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +54 -0
- data/spec/dummy/config/environments/production.rb +91 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/trackster.rb +6 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +33 -0
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/routes.rb +5 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/db/schema.rb +25 -0
- data/spec/dummy/log/RAILS_ENV=test.log +0 -0
- data/spec/dummy/log/development.log +3677 -0
- data/spec/dummy/log/test.log +212 -0
- data/spec/dummy/package.json +5 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/spec/controllers/tests_controller_spec.rb +5 -0
- data/spec/dummy/spec/helpers/tests_helper_spec.rb +15 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-7/-7_-0_UxtoxoUevRMc4pASOd3KJeOCjYtThaDHM0TVI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/00/00jXuiYXF3twcItTgcuTiqhEWEFZbRxE2jpHZpUYixU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/0T/0T3Xd6jfdEJWGUKGYBmehOeBGr8pHwkOexRXyYdsdxc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1g/1gVLloXKkJgVGBmLvWP1GkVBOmJ6VUI8fL_0rPXX3lo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1r/1rRr_gim3llVPTkwq-sMOANGMgeja38qTD33ZnhzRw8.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2M/2Mq4lJN74Pcv7oprubX9dC9wGbPJFXzKmn1YFzE-YQo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/2N/2Nxatq3gdOVGQ9dmXx-cu9MFj5GKCmaVX8UfR_nw3vA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/34/34_v9q7sGS7_xKFIxS4NkKoAeOV087Nz725yeIt4c1U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/37/373ePEjEzi1PvPi6RoLkmI5VjZYfvwnqDpKBmxyjyls.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3f/3fSb45d9m7hu5_6T4m4gfwbpO_f1HoqRYieKqBNmCOY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3i/3iBQyiVg7DTCeGgGpdgH4gl-gENIkUGkXcmjrdJ6GfU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/7J/7JREtleqnhMHs7YeUrpVpLZz-RCZarhBX0EaLVDnsG0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/8h/8hBW4wBlsaVvLqcXoFcOfrkpkQuyY-NieaXMP4-nxkQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ak/AkQIM6cp_TOns2gVVAn5fRhZlXEdKT4wgZwIXoKGWdQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/En/EnqJoaothKlDw6SXchjMPls0ecV38YBgcT13pZ8jCaA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Eq/EqTTxaD_YhmpBI3IkZG5USDqCtesOqVH5CueapguyB8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Gm/Gm7VFoIjroUmlZYrMrnoIhTPnswCDNG8ADjaCVHFHJQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/H-/H-vuGdDVL-8ZqCohT6LDyw_EnXbhViosaBEUnuuO4LE.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HC/HCDOUd7-S45aJ_PjVAC_Vmjyud3i1aQv4cE3t9_Z3Dw.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/IA/IAvCbXHcICaGZJ5aau49vT8cyLu2r8slVDBaSycGVA4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/IM/IMjcIq5czoEYQGrwEP__hlhuM_v17fXmdj8X1kRjnEA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Iu/IuPVZNQF5zAazaujPT5KxRPxdOjCF8WMUIijpCJlZxw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/JB/JBesAQJAUMOJrWTcTHTdbCGaGGRuosbcfEk8KgoSGuo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jf/Jf1lcVBkiQRnnNdS7ilDGixnWF4X2em4H1Og0GMaEzU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/L0/L0OdXZ59MaSY1ca73RjxMhCiEOV1lSDX8gTIK-7dKMo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NB/NB837FIVvSHYOY9W29yXP_cVzHQCImJWVO_5HIDFV-U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nk/Nk1_wzGwD-hiF6lnlhggQy14A73D1jnnH2qy6ylcRL0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmBfC4hUarE4_wkGLnXNLQ2Ba9pGu-7wqEsGPdfuviQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ol/Ol5IIgvqAdiq-vWOkktL0eZE3y8-l1i1ISTpsu36HzY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ql/Qlmei2YkHUjU-3c2spsRcCl4OiHs29rr46qB9nr4lIY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/R9/R9fjeLD5VEiAsQRiCD2jFK-4cTEzvW6NBsH3F2D5Gfk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Rz/RzosqOKee9psa83TuXasb50aYrZjKvyxLy2QNsevKUI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Sj/SjJkXiJwrX6h7C_rdWSQ9pgJMWIy-TBjfwigQhg8WuU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UV/UVK8XO5Fc3IRGeww9iEaa4XFyOwUBkO2CZbA5tSCd0c.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UV/UVQwM8Vsz7X1zgm6DNzPxo_hflDYb2H86cYMVLQlMEM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/UZ/UZFaJTLNuQrEftbCNzf0qeLGemChuwlrOFgHcsMDDn8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Vq/VqHiyE4E22i4j4tUnB8g3aoL78KUymXv25BCecFms6s.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XK/XK-NqRj2eHEFDd-ycDjvwHiWyVmGP_guPqaSIMdqlLA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Xi/Xim00VcbYL4Z0u4btJLgw4fAyZ5uqj_KMIlXIBqPbgY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YZ/YZMPEr5NrIHkrhZyPm5OUypZwSyHbTI88wp0mlB9xtc.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Z0/Z0ePXCewxxLEfSSst-mQNjj2-MuJlfCVJcz7glKzk1g.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ZX/ZX3ld-RGS0JsU03ukQdmeDVbKWoTk1YSYzWjtzrdrms.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_0/_02OBWtEsb56OLt5LrqUthl8oiHZMdXbNLL5u9bDvXc.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_Y/_YkhT-h1agHyyvHWeMAYZYXMkl-_18NM1j9aFxR7Z3s.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/a4/a4nlbt2gsLBQo1CJryJ0tX18awHbeSEvesq4hdMWr0U.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/a8/a862vapqA6CGV-NVVpdlNtTBdzPcdLGFDTcktd-kXN0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/aW/aWsDB-GlIDl8JU6Vv2Pxp7rMrhRnjHFhk3loAdVZvfw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ap/aphd4DV7NtskqkVd27OoTkrDjcwt3o8uYUWUKWJ0VIU.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/bA/bAUb-SbjaT3VH6kO9VvXXRcCxQ3CsnNRpjRCxC-2sXM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/b_/b_Itlk9QZZd7Rvf8kcA4yLP1R5Acu7jB-m1xQiSU0qE.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ca/caYLL230n6iw0Oz98b_UFwH30BUFlA87P0KPiRGl11o.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cd/cdGNJv0jStGhqnGgEqlyE_XTW726Opqj6KxVDRyEgbQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/co/cozDJ1pniEdNQdBzqEx-savMe5v3X-nhYelJibbMC5U.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/cu/cu4pbpy6KBePY7_IalPpgPuiyuRiIVptPKmiRVRgs0o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/d1/d1OVACnJJlM6BFWZt7jNuImEMy8ngKdT63ByMX7DRvY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/dP/dPRNNa_Apj-MsqE2rR5ZHrY6M5K4Ng3bNmiltpJ1Xls.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eE/eEvQw5SlNYhARDNJjsslxkhewpGgJvvzOJeihFOWB7k.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/et/eth9h9Tfce5dW0vlCxim__3N1fBO_a7Jbgn18HOO1Jk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/f-/f-5Rlcm757wgp7ho2XYT5pYMsx_9C9efgr9wuDZNY28.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/fU/fUKkXZT6PLxil8qycYtehj9fu_JwBApyWKzfwgrGDQs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gv/gvKg74UrF4PhFxXBhsZGoEI3m9H3Kprjqj8sklvHA_Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/i8/i8IKOMpsOF0jtJny4H95ru0vecGVHzdAteym-IjG1y0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lQ/lQx9WrF_lGWxmbPlS2Pf_D2fArgN03tOQQZFMR6s5xw.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/lk/lkqMw4IQfORvm4fxCQI_3UlJULEXxvwY15hKaKHr3yo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mJ/mJW4zrv3qUOGjwvqZwN8mIj0JA0XrkatJvHGGhsJwks.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mS/MsxiqxgVnHs3x8Mx3hySnpl6bn3G1Cgn-aTfHim18zM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mS/mSkk9ed2mbfGI6XBAOMtXiay1y90RqZDp42j1MQeVc0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mX/mX1nlsL_SWOB4y22W5FheRX0YEONKyOY7xUeIvRiHco.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/mm/mmNuv21El6X5scvzrW5Fp85RX5LOYtopQ_Tc22TKBqo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n7/n7Jx5WE-w81WEMungGMES29kBw-7zh45ZnBIzj6gPak.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nC/nCS6g9XpKX_L5rREWOONCyXW80wVf5lBrV9mpk5oMnQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nP/nPV05cCyjxQgmOseS4_QfS78e0LwjW5Hpkc9wkk2v3o.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/n_/n_xYqQYhwEMQknb3jFQnjlxxBE9TzMNHCdJ-bEyZFIw.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/nx/nxTv3sKVUQZADJyM3dPaVmUA78MIsMLD_K279yN_GsI.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oY/oYAbR4q-EIq5i1C-QXU9QVMMtayBgOfIWSYziRAYUfM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/or/orIR3Eqf1LUD406bX-BT4_5ftKPXfgABQQU3jLAAFQ4.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oz/ozK4IPJj2CBcsem3fLJx3wqcOl6mI6B91PkN0wVfkyk.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/py/pyp2Iyq4ucsjTmzaF2sPwW8Gn1yQ6n52IMVrjbOCTwk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qP/qPmv5snMrDw830S6hSICDcnIy7kVEWoFKXhGKT38lG4.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/qu/qupom2DQId18zrz92T9IpmlVrdZHdyzY1UnpixEozQ8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/rT/rT0FChS8dZuEWcYCyBbwsm07ghdjBKdp2qdEcB3jTvs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/sB/sBFUJviR7lC5TRd2vl60ET-oS7zETRHApIDL98a3WzA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/su/suEiGUxMhBC1m0pjRx6NT9iAnS_65IyN7hB6e3RFxCM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ty/tyE-Nkm5Ar99RY4r3yPbesyABvJ4yHcxGp1QdgMcY2I.cache +3 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/u-/u-O0PsYTqAJSlRgz7s8GX9LFKErsryYdlhs4wE99Onk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xG/xGAFcU9Rd1GHB-Kp9c3h5SEWcpus52I84WdUWyrstmI.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xH/xHIS7FhLnaGANLuWHVvhC7VtneWbK9Ykl8e2q5h-9NU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/xU/xUNe5FJhrElT1GYmkLmQQJSwYQ8KP6wE5R7FphunbXQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yj/yjhT29xy8f2zq_OCkoq-gzHzmiu7uKORvRGdZijjsZY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yv/yvIsQ7XTTJXEDd348qurANBgWdPmJXYbnfaO3x4mPE8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yv/yvvF-lk2vPEwuIxs1rDVmIB8iS2L4krZUQyYEDzhLqs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/zd/zdqC2_gtHXKxIHxzSt3atc-mmMcZzbRLNBWnGLANw58.cache +1 -0
- data/spec/helpers/trackster/pageviews_helper_spec.rb +15 -0
- data/spec/models/pageview_spec.rb +24 -0
- data/spec/spec_helper.rb +17 -0
- metadata +455 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 27cab2948a9443ac659685991ea801550f993e7c
|
|
4
|
+
data.tar.gz: ecb4ae9ac507e98e3eeb4d3a896276b15ce91a51
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a29654d4e609892bcbefba17bc2c8043705540af0ee4a46bc7f7abce87418522b9c7c8f9d3ccca5d279ead3cb398bf653ccebf66eda88b1832a51eaa1f02a334
|
|
7
|
+
data.tar.gz: e6194f5ecb2d699a5f1eca31b142a5638774ac370e6d61fb1df43081f8837a74b4740cf0a87ed3bfe03db7c6b8b9a588805f0dbd7aec8d2e92d670f8da9ce5d0
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2017 Rajbir Karan Singh
|
|
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.
|
data/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Trackster
|
|
2
|
+
A lightweight plugin to record visits to supplied URL.
|
|
3
|
+
This gem is written using Rails version 5.1.4 and Ruby version ruby 2.4.2p198.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
Add this line to your application's Gemfile:
|
|
7
|
+
|
|
8
|
+
```ruby
|
|
9
|
+
gem 'trackster'
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
And then execute:
|
|
13
|
+
```bash
|
|
14
|
+
$ bundle install
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
```bash
|
|
19
|
+
$ gem install trackster
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Generate the pageviews table
|
|
23
|
+
```bash
|
|
24
|
+
$ rake db:migrate
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Usage
|
|
28
|
+
|
|
29
|
+
1. Create trackster.rb as follwing:
|
|
30
|
+
```ruby
|
|
31
|
+
Trackster::Engine.setup do |config|
|
|
32
|
+
config.trackable_regex = ["/a+", "/a[a-z]+"] # Regular Expression match
|
|
33
|
+
config.trackable_urls = ["/tests"] # Full URL match
|
|
34
|
+
config.results_page_username = "hello" # Username for pageview list page
|
|
35
|
+
config.results_page_password = "world" # Password for pageview list page
|
|
36
|
+
end
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Add following to you routes.rb
|
|
40
|
+
```ruby
|
|
41
|
+
mount Trackster::Engine => "/trackster"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
3. To enable Trackster to count pageview, add following to your ApplicationController:
|
|
45
|
+
```ruby
|
|
46
|
+
trackster
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
4. The url for pageview list page is "/trackster/pageviews"
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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 = 'Trackster'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
|
18
|
+
load 'rails/tasks/engine.rake'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
load 'rails/tasks/statistics.rake'
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
require 'bundler/gem_tasks'
|
|
26
|
+
|
|
27
|
+
require 'rake/testtask'
|
|
28
|
+
|
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
|
30
|
+
t.libs << 'test'
|
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
|
32
|
+
t.verbose = false
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
task default: :test
|
|
@@ -0,0 +1,13 @@
|
|
|
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_tree .
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
class Trackster::PageviewsController < ApplicationController
|
|
2
|
+
before_action :authenticate
|
|
3
|
+
|
|
4
|
+
def index
|
|
5
|
+
@pageviews = Pageview.select("url, count(*) as visits, visit_date").group(:url, :visit_date).order(:visit_date)
|
|
6
|
+
respond_to do |format|
|
|
7
|
+
format.html
|
|
8
|
+
format.csv { send_data @pageviews.to_csv }
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
protected
|
|
13
|
+
|
|
14
|
+
def authenticate
|
|
15
|
+
authenticate_or_request_with_http_basic do |username, password|
|
|
16
|
+
username == Trackster::Engine.results_page_username && password == Trackster::Engine.results_page_password
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
module Trackster
|
|
2
|
+
module TracksterController
|
|
3
|
+
|
|
4
|
+
module ClassMethods
|
|
5
|
+
def trackster
|
|
6
|
+
before_action :trackster_count_visit
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
module InstanceMethods
|
|
11
|
+
def trackster_count_visit
|
|
12
|
+
begin
|
|
13
|
+
is_matched = false
|
|
14
|
+
request_path = request.path
|
|
15
|
+
trackable_urls = Trackster::Engine.trackable_urls
|
|
16
|
+
trackable_regex = Trackster::Engine.trackable_regex
|
|
17
|
+
|
|
18
|
+
trackable_regex.each do |url|
|
|
19
|
+
url_as_regex = /#{url}/
|
|
20
|
+
if url_as_regex.match(request_path)
|
|
21
|
+
pageview = Pageview.create!(url: url, visit_date: Date.today)
|
|
22
|
+
is_matched = true
|
|
23
|
+
break
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
if !is_matched
|
|
28
|
+
trackable_urls.each do |url|
|
|
29
|
+
if url == request_path
|
|
30
|
+
pageview = Pageview.create!(url: url, visit_date: Date.today)
|
|
31
|
+
break
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
rescue Exception => ex
|
|
37
|
+
puts ex.message
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Pageview < ApplicationRecord
|
|
2
|
+
require 'csv'
|
|
3
|
+
validates_presence_of :url, :visit_date
|
|
4
|
+
|
|
5
|
+
def self.to_csv(options = {})
|
|
6
|
+
CSV.generate(options) do |csv|
|
|
7
|
+
csv << ["url", "visit counts", "date"]
|
|
8
|
+
all.each do |pageview|
|
|
9
|
+
csv << pageview.attributes.values_at("url", "visits", "visit_date")
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Trackster</title>
|
|
5
|
+
<%= stylesheet_link_tag "trackster/application", media: "all" %>
|
|
6
|
+
<%= javascript_include_tag "trackster/application" %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<%= yield %>
|
|
12
|
+
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
table, th, td {
|
|
3
|
+
border: 1px solid black;
|
|
4
|
+
width: 400px;
|
|
5
|
+
border-collapse: collapse;
|
|
6
|
+
}
|
|
7
|
+
</style>
|
|
8
|
+
<table>
|
|
9
|
+
<tr>
|
|
10
|
+
<th>url</th>
|
|
11
|
+
<th>visit counts</th>
|
|
12
|
+
<th>date</th>
|
|
13
|
+
</tr>
|
|
14
|
+
<%@pageviews.each do |pageview|%>
|
|
15
|
+
<tr>
|
|
16
|
+
<td><%=pageview.url%></td>
|
|
17
|
+
<td><%=pageview.visits%></td>
|
|
18
|
+
<td><%=pageview.visit_date%></td>
|
|
19
|
+
</tr>
|
|
20
|
+
<%end%>
|
|
21
|
+
</table>
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
<%= link_to "Download as CSV", "/trackster/pageviews.csv" %>
|
data/config/routes.rb
ADDED
data/lib/trackster.rb
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Trackster
|
|
2
|
+
class Engine < ::Rails::Engine
|
|
3
|
+
#isolate_namespace Trackster
|
|
4
|
+
|
|
5
|
+
initializer 'trackster.controller' do
|
|
6
|
+
|
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
|
8
|
+
include TracksterController::InstanceMethods
|
|
9
|
+
extend TracksterController::ClassMethods
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
initializer :append_migrations do |app|
|
|
14
|
+
unless app.root.to_s.match root.to_s
|
|
15
|
+
config.paths["db/migrate"].expanded.each do |expanded_path|
|
|
16
|
+
app.config.paths["db/migrate"] << expanded_path
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
class << self
|
|
22
|
+
mattr_accessor :results_page_username, :results_page_password, :trackable_urls, :trackable_regex
|
|
23
|
+
self.results_page_username = "admin"
|
|
24
|
+
self.results_page_password = "password"
|
|
25
|
+
self.trackable_urls = ["/"]
|
|
26
|
+
self.trackable_regex = []
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# this function maps the vars from app into engine
|
|
30
|
+
def self.setup
|
|
31
|
+
yield self
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
end
|
data/spec/dummy/Rakefile
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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_tree .
|
|
@@ -0,0 +1,13 @@
|
|
|
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);
|