hubstats 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +8 -8
  2. data/app/assets/javascripts/hubstats/application.js +8 -3
  3. data/app/assets/javascripts/hubstats/pull_requests.js +159 -0
  4. data/app/assets/stylesheets/hubstats/application.css +47 -0
  5. data/app/assets/stylesheets/hubstats/pull_requests.css +3 -0
  6. data/app/controllers/hubstats/pull_requests_controller.rb +19 -2
  7. data/app/controllers/hubstats/repos_controller.rb +27 -10
  8. data/app/controllers/hubstats/users_controller.rb +12 -1
  9. data/app/models/hubstats/label.rb +15 -0
  10. data/app/models/hubstats/pull_request.rb +36 -14
  11. data/app/views/hubstats/metrics/_comments_table.html.erb +9 -6
  12. data/app/views/hubstats/metrics/_pulls_table.html.erb +1 -1
  13. data/app/views/hubstats/partials/_comment.html.erb +13 -0
  14. data/app/views/hubstats/partials/_header.html.erb +28 -10
  15. data/app/views/hubstats/partials/_pull.html.erb +24 -0
  16. data/app/views/hubstats/pull_requests/index.html.erb +52 -5
  17. data/app/views/hubstats/pull_requests/repo_index.html.erb +8 -0
  18. data/app/views/hubstats/pull_requests/show.html.erb +5 -9
  19. data/app/views/hubstats/repos/dashboard.html.erb +21 -0
  20. data/app/views/hubstats/repos/index.html.erb +2 -10
  21. data/app/views/hubstats/users/show.html.erb +9 -3
  22. data/config/routes.rb +6 -3
  23. data/db/migrate/20140604130339_create_hubstats_pull_requests.rb +12 -12
  24. data/db/migrate/20140604130457_create_hubstats_users.rb +4 -3
  25. data/db/migrate/20140604130504_create_hubstats_comments.rb +12 -9
  26. data/db/migrate/20140604130550_create_hubstats_repos.rb +15 -15
  27. data/db/migrate/20140703173123_create_hubstats_labels.rb +9 -0
  28. data/db/migrate/20140703200752_create_hubstats_labels_pull_requests.rb +8 -0
  29. data/lib/hubstats/events_handler.rb +4 -6
  30. data/lib/hubstats/github_api.rb +21 -0
  31. data/lib/hubstats/version.rb +1 -1
  32. data/lib/tasks/populate_task.rake +22 -3
  33. data/test/dummy/db/migrate/{20140702234357_create_hubstats_pull_requests.hubstats.rb → 20140703201046_create_hubstats_pull_requests.hubstats.rb} +12 -12
  34. data/test/dummy/db/migrate/{20140702234358_create_hubstats_users.hubstats.rb → 20140703201047_create_hubstats_users.hubstats.rb} +4 -3
  35. data/test/dummy/db/migrate/{20140702234359_create_hubstats_comments.hubstats.rb → 20140703201048_create_hubstats_comments.hubstats.rb} +12 -9
  36. data/test/dummy/db/migrate/{20140702234360_create_hubstats_repos.hubstats.rb → 20140703201049_create_hubstats_repos.hubstats.rb} +15 -15
  37. data/test/dummy/db/migrate/20140703201050_create_hubstats_labels.hubstats.rb +10 -0
  38. data/test/dummy/db/migrate/20140703201051_create_hubstats_labels_pull_requests.hubstats.rb +9 -0
  39. data/test/dummy/db/schema.rb +68 -57
  40. data/test/dummy/log/development.log +0 -0
  41. data/test/dummy/log/production.log +3 -0
  42. data/test/dummy/log/test.log +6688 -0
  43. data/test/dummy/tmp/cache/assets/C6A/070/sprockets%2F722061c11245ef57a10b2a8b249536a6 +0 -0
  44. data/test/dummy/tmp/cache/assets/C80/780/sprockets%2Fc1cf9f40564205993336f5119dc8301d +0 -0
  45. data/test/dummy/tmp/cache/assets/C97/B60/sprockets%2Faec576e1f9385471867ed31d55077188 +0 -0
  46. data/test/dummy/tmp/cache/assets/CA0/2B0/sprockets%2F00310502bf37155c1d795a84d46e1fa7 +0 -0
  47. data/test/dummy/tmp/cache/assets/CA2/FC0/sprockets%2Fc0a86d68e0c4a2374484370da89d1000 +0 -0
  48. data/test/dummy/tmp/cache/assets/CAC/770/sprockets%2F6f6eca43ba817098511ce082222681e7 +0 -0
  49. data/test/dummy/tmp/cache/assets/CAD/3D0/sprockets%2F781852b612e12270af6602bdb8f985a4 +0 -0
  50. data/test/dummy/tmp/cache/assets/CBC/4C0/sprockets%2F43796510bea9e088167ff07f3d0a8484 +0 -0
  51. data/test/dummy/tmp/cache/assets/CD1/790/sprockets%2F825aafb951c27a7ca74309144540cc51 +0 -0
  52. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  53. data/test/dummy/tmp/cache/assets/CDA/040/sprockets%2Fb4d91e72711bf28f408e6501a40539bf +0 -0
  54. data/test/dummy/tmp/cache/assets/{CDC/260/sprockets%2F3e779895354a0eb2c14e0a37a9b143f3 → CDB/3F0/sprockets%2Fe3dd42740d72fd4147cc2bc430554858} +0 -0
  55. data/test/dummy/tmp/cache/assets/CE3/FF0/sprockets%2Fcef2250ca879df25864e46743811b34a +0 -0
  56. data/test/dummy/tmp/cache/assets/CE5/950/sprockets%2F6011591ca606d6465ffe00aa59798f4f +0 -0
  57. data/test/dummy/tmp/cache/assets/CED/160/sprockets%2Fd17778dcc64ba05d748e9596851b42b2 +0 -0
  58. data/test/dummy/tmp/cache/assets/D00/000/sprockets%2Fca55ed2e244f0ae2454363027cae0865 +0 -0
  59. data/test/dummy/tmp/cache/assets/D1E/160/sprockets%2F6b06e88c694fe253732afa662e4b83d8 +0 -0
  60. data/test/dummy/tmp/cache/assets/D1E/690/sprockets%2F87b902b589445ed855fa47700d19ddcd +0 -0
  61. data/test/dummy/tmp/cache/assets/D20/FF0/sprockets%2F941bab9382328e98fd569386d1ec0af5 +0 -0
  62. data/test/dummy/tmp/cache/assets/D21/C00/sprockets%2F8d98ccfd866c7b6d27c557031ed18173 +0 -0
  63. data/test/dummy/tmp/cache/assets/D29/830/sprockets%2Fd625d52591e79dd7ea694da983763e1f +0 -0
  64. data/test/dummy/tmp/cache/assets/D2F/DC0/sprockets%2Fdb2533855a0541d30ee3fb4c952a9ab3 +0 -0
  65. data/test/dummy/tmp/cache/assets/D32/070/sprockets%2F7e8b1f51c452335eaa6dc3ac440332f9 +0 -0
  66. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  67. data/test/dummy/tmp/cache/assets/D38/CB0/sprockets%2F29c1b9d8419784ce13da2b3f174ac2d1 +0 -0
  68. data/test/dummy/tmp/cache/assets/D3A/D50/sprockets%2Ff40159b97cbd42cd120ab6db69d67182 +0 -0
  69. data/test/dummy/tmp/cache/assets/D3D/470/sprockets%2Ff6740e85131eb3c5c3836792c5db0ccd +0 -0
  70. data/test/dummy/tmp/cache/assets/D45/FE0/sprockets%2F71e7d22428abdfaf957abc097437178b +0 -0
  71. data/test/dummy/tmp/cache/assets/D46/F70/sprockets%2Ff8b0242cb6b63299e67b9356ed34e3bc +0 -0
  72. data/test/dummy/tmp/cache/assets/D47/F60/sprockets%2F275572ae8865ec1ffa9a17b4c658b0b6 +0 -0
  73. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  74. data/test/dummy/tmp/cache/assets/D51/7F0/sprockets%2Fe483e54cab3b78e5959d5bc422692ff5 +0 -0
  75. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  76. data/test/dummy/tmp/cache/assets/D5D/880/sprockets%2F49469a907bfe2696eb66b3d69d69cc6b +0 -0
  77. data/test/dummy/tmp/cache/assets/D62/F50/sprockets%2Fe4fa88230ba5d4b30cd36d170c2f57a8 +0 -0
  78. data/test/dummy/tmp/cache/assets/D68/7C0/sprockets%2F53c50d8f33708cb75b09c0d4c7d3caf3 +0 -0
  79. data/test/dummy/tmp/cache/assets/D6B/570/sprockets%2F70c5d0418ce288f30ad3d949fd31a0ef +0 -0
  80. data/test/dummy/tmp/cache/assets/D7E/2C0/sprockets%2Fe11fb7d12e6f167b56f4b939b65c97fb +0 -0
  81. data/test/dummy/tmp/cache/assets/D7F/5B0/sprockets%2F842879ad233dad55dc6c3f23eed939f6 +0 -0
  82. data/test/dummy/tmp/cache/assets/D85/310/sprockets%2F5bfbaf42e04878ffee659890736e5ac4 +0 -0
  83. data/test/dummy/tmp/cache/assets/D95/E70/sprockets%2F71e192cc81e15e41babc78da4a549b5b +0 -0
  84. data/test/dummy/tmp/cache/assets/D9A/300/sprockets%2F044ebd5e75412ceead3574d6d3eed550 +0 -0
  85. data/test/dummy/tmp/cache/assets/D9E/0F0/sprockets%2Fddaeeb8234f096140f35c06ff538bbe6 +0 -0
  86. data/test/dummy/tmp/cache/assets/DAA/D80/sprockets%2Fe7bd68eb95e047454adfc49e5f0b8e11 +0 -0
  87. data/test/dummy/tmp/cache/assets/DC7/5C0/sprockets%2F4af3c5fb39b4b93a7fc1c5db2c05c583 +0 -0
  88. data/test/dummy/tmp/cache/assets/DD8/5A0/sprockets%2Fdc77251d6c233eeecb693ff083f35eee +0 -0
  89. data/test/dummy/tmp/cache/assets/{BF9/050/sprockets%2F15110619558921cc177344f4d898707b → DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994} +0 -0
  90. data/test/dummy/tmp/cache/assets/{CE0/3F0/sprockets%2F2172471af487ddf3277bc0cf35e45175 → DDD/E60/sprockets%2Fe81c794a9e4d16cb9e35c8b8ee5b6b2c} +0 -0
  91. data/test/dummy/tmp/cache/assets/DDE/160/sprockets%2Fad7ae04f67dc2e97b7956ea219e4bc8f +0 -0
  92. data/test/dummy/tmp/cache/assets/DDF/3E0/sprockets%2F59b0fb9e71148d95cf2e9e90c29cfacd +0 -0
  93. data/test/dummy/tmp/cache/assets/DF9/4E0/sprockets%2F79fba73941daca3fad36e2d68bf243aa +0 -0
  94. data/test/dummy/tmp/cache/assets/{C8E/170/sprockets%2F0f711299ca198f9725c1db4935d47446 → E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af} +0 -0
  95. data/test/dummy/tmp/cache/assets/E06/450/sprockets%2Ffcd574cdf1957cd4acd029f0de961dd5 +0 -0
  96. data/test/dummy/tmp/cache/assets/E0B/7F0/sprockets%2Fec7ca66fae22eb868a78c2d97dd5c27a +0 -0
  97. data/test/dummy/tmp/cache/assets/E0F/CE0/sprockets%2F5c479ac6683cdd3e7ed01defd75e7be6 +0 -0
  98. data/test/dummy/tmp/cache/assets/E10/920/sprockets%2Fe2793fe8a9f6773e8d2d5bececb01b7f +0 -0
  99. data/test/dummy/tmp/cache/assets/E30/D10/sprockets%2F5be1e5ad45bde1dbd7fb9f8d720277ea +0 -0
  100. data/test/dummy/tmp/cache/assets/E41/A20/sprockets%2F23cef5db9fa9d95cf84a2c688b5fe6ab +0 -0
  101. data/test/dummy/tmp/pids/server.pid +1 -0
  102. metadata +129 -246
  103. data/test/dummy/tmp/cache/assets/C31/590/sprockets%2Ff47655ec02a789734a9457367270951a +0 -0
  104. data/test/dummy/tmp/cache/assets/C3F/980/sprockets%2F4425b71da600554d5351206534749bcb +0 -0
  105. data/test/dummy/tmp/cache/assets/C52/560/sprockets%2F0c760b641530192770a8ea78b428c976 +0 -0
  106. data/test/dummy/tmp/cache/assets/C61/2A0/sprockets%2F3594884c048946898cddd41122bd5571 +0 -0
  107. data/test/dummy/tmp/cache/assets/C6B/B30/sprockets%2F47b8c8579e50463c994bf7194a626518 +0 -0
  108. data/test/dummy/tmp/cache/assets/C72/0E0/sprockets%2F8e8f8a05374b7958964ee35121985d67 +0 -0
  109. data/test/dummy/tmp/cache/assets/C74/0F0/sprockets%2Fd2956e2971f0efb507249795868727f7 +0 -0
  110. data/test/dummy/tmp/cache/assets/C7D/DB0/sprockets%2F7582164669b0032164c4fc37fe0826bb +0 -0
  111. data/test/dummy/tmp/cache/assets/C85/1D0/sprockets%2F7e242c866f942351653c1676c91dc11e +0 -0
  112. data/test/dummy/tmp/cache/assets/C85/7B0/sprockets%2Feb946492dd699986b5694488d45e6298 +0 -0
  113. data/test/dummy/tmp/cache/assets/C86/5A0/sprockets%2F429945133e54f0e28c43bf5ca3395916 +0 -0
  114. data/test/dummy/tmp/cache/assets/C9D/840/sprockets%2F1d8ae17d505b1eb5051eb25077134816 +0 -0
  115. data/test/dummy/tmp/cache/assets/CAE/790/sprockets%2Fe77520c0e7472601dc58113e9b6d09c6 +0 -0
  116. data/test/dummy/tmp/cache/assets/CAF/1C0/sprockets%2F3c35dc6950a910a9df728095550c7c50 +0 -0
  117. data/test/dummy/tmp/cache/assets/CC3/1D0/sprockets%2F75475825e4cd042e377882e60991ecec +0 -0
  118. data/test/dummy/tmp/cache/assets/CC7/920/sprockets%2F9559c6b85ec6d794191fb0f51d643656 +0 -0
  119. data/test/dummy/tmp/cache/assets/CC8/5C0/sprockets%2F611f6be949d97f1cd071f8474966716a +0 -0
  120. data/test/dummy/tmp/cache/assets/CCE/2E0/sprockets%2Ff9cb57cb6014c1432cb221419f44d803 +0 -0
  121. data/test/dummy/tmp/cache/assets/CCF/2A0/sprockets%2F52350a36ad30e5c57d3241d9e216fd06 +0 -0
  122. data/test/dummy/tmp/cache/assets/CD0/150/sprockets%2Fd29250c44b3ce63c844744aa1b61a545 +0 -0
  123. data/test/dummy/tmp/cache/assets/CD2/400/sprockets%2Fef5170f25214b824208d19c1d4cc1b58 +0 -0
  124. data/test/dummy/tmp/cache/assets/CD6/820/sprockets%2F6b25810492b76c71eac09c720c5a2d75 +0 -0
  125. data/test/dummy/tmp/cache/assets/CDD/720/sprockets%2F1229cde58b70f53701f34b3e85a8b822 +0 -0
  126. data/test/dummy/tmp/cache/assets/CE8/F60/sprockets%2F4f90c6089a97e1b09e1d05ae306d5589 +0 -0
  127. data/test/dummy/tmp/cache/assets/CE9/AF0/sprockets%2Ffe8a227c3a37660537ef955f27353ac6 +0 -0
  128. data/test/dummy/tmp/cache/assets/CED/340/sprockets%2F56beb0aa20b4b0180e2cf409309731c1 +0 -0
  129. data/test/dummy/tmp/cache/assets/CF3/F10/sprockets%2F49d462fdbf815da37e08664853c7c980 +0 -0
  130. data/test/dummy/tmp/cache/assets/D02/4E0/sprockets%2Faa7feb4a2859275206a4a3830c53fa25 +0 -0
  131. data/test/dummy/tmp/cache/assets/D02/5B0/sprockets%2Fccd3c5176523034e06a08f2bce1468c6 +0 -0
  132. data/test/dummy/tmp/cache/assets/D0D/860/sprockets%2F50fd288c9613092dd975ba2067ba42cd +0 -0
  133. data/test/dummy/tmp/cache/assets/D0E/470/sprockets%2Fa3ce5b5a0016444e9cd58e6b19b15759 +0 -0
  134. data/test/dummy/tmp/cache/assets/D13/150/sprockets%2F134903ad1d71e9b5d9055f76f7e070ed +0 -0
  135. data/test/dummy/tmp/cache/assets/D13/2D0/sprockets%2F9a9e2a3c4c3d7d4083c55991e19fa170 +0 -0
  136. data/test/dummy/tmp/cache/assets/D13/A90/sprockets%2F43bdaff41d76c03d404a6e541c788966 +0 -0
  137. data/test/dummy/tmp/cache/assets/D15/570/sprockets%2F2a83b24fd5c03c9b568ce98f017d3276 +0 -0
  138. data/test/dummy/tmp/cache/assets/D16/B40/sprockets%2F2f42a66eb4e9c3c46c19767e3c2b5950 +0 -0
  139. data/test/dummy/tmp/cache/assets/D17/D80/sprockets%2F7fb4dca0599ec86773142a87e2123ee4 +0 -0
  140. data/test/dummy/tmp/cache/assets/D19/2D0/sprockets%2Fb45a7b27824f7ec1ba4b89d3579462d5 +0 -0
  141. data/test/dummy/tmp/cache/assets/D1A/2B0/sprockets%2Fa198485c386ab897195c4ef12057acdc +0 -0
  142. data/test/dummy/tmp/cache/assets/D1A/F80/sprockets%2F3e61358128047c3fd738bb87f19e5dae +0 -0
  143. data/test/dummy/tmp/cache/assets/D20/A00/sprockets%2F8808c57306ee605a6a96aa5e7ec5c669 +0 -0
  144. data/test/dummy/tmp/cache/assets/D24/CF0/sprockets%2F69b4859d5fed395dfc00c47a28c47628 +0 -0
  145. data/test/dummy/tmp/cache/assets/D25/C60/sprockets%2F3f4d4f83ad9bde876a4964e606f85243 +0 -0
  146. data/test/dummy/tmp/cache/assets/D25/E10/sprockets%2F0633679c3d8859a3ecc9e058915fb8cc +0 -0
  147. data/test/dummy/tmp/cache/assets/D29/B30/sprockets%2F086d8d112d3fae3aa1442b0668c5ad14 +0 -0
  148. data/test/dummy/tmp/cache/assets/D2C/CE0/sprockets%2F41c51f756c28e2efb4df0f7993958d87 +0 -0
  149. data/test/dummy/tmp/cache/assets/D2F/C20/sprockets%2F048e618c1c32dba37a5ea17ce438d502 +0 -0
  150. data/test/dummy/tmp/cache/assets/D2F/E00/sprockets%2Ff58c01a5a367f623272bea14cb55ce05 +0 -0
  151. data/test/dummy/tmp/cache/assets/D32/0B0/sprockets%2Ff352d64df6333e4ec0a71a7e21a61a66 +0 -0
  152. data/test/dummy/tmp/cache/assets/D36/E60/sprockets%2F04b984b0c912e63e92b0fc5c7d03ea81 +0 -0
  153. data/test/dummy/tmp/cache/assets/D3E/040/sprockets%2F6f2e123d26b1b36e664bcf3b2a6d6788 +0 -0
  154. data/test/dummy/tmp/cache/assets/D48/7E0/sprockets%2F788b2cc322aa0075179f5fe78bfe418f +0 -0
  155. data/test/dummy/tmp/cache/assets/D48/810/sprockets%2F2f886557ed89d407ea37bc42104a8edb +0 -0
  156. data/test/dummy/tmp/cache/assets/D4D/240/sprockets%2Fb8cfde7355a79523ed7498afbb151582 +0 -0
  157. data/test/dummy/tmp/cache/assets/D4E/770/sprockets%2F6f6fe0f4324f4edbd88f5a42623857d4 +0 -0
  158. data/test/dummy/tmp/cache/assets/D50/D00/sprockets%2F9b429fbca0ec669480440da7f9b49f58 +0 -0
  159. data/test/dummy/tmp/cache/assets/D51/8E0/sprockets%2F4eb588bf3b79d16661ddc1e82e19b785 +0 -0
  160. data/test/dummy/tmp/cache/assets/D58/A40/sprockets%2F1d4622f3a01c22f38abe6b16dd9b108c +0 -0
  161. data/test/dummy/tmp/cache/assets/D5E/9F0/sprockets%2F849e6398b6fef78228d4ae1476bbb68f +0 -0
  162. data/test/dummy/tmp/cache/assets/D5E/C40/sprockets%2F14a66c4429db00da5def52acb9553b24 +0 -0
  163. data/test/dummy/tmp/cache/assets/D60/530/sprockets%2F04148b8efa6507aab7e1c173d058cd2b +0 -0
  164. data/test/dummy/tmp/cache/assets/D66/1E0/sprockets%2F5436c5d00d9dbdb3f41c5934ac44dc28 +0 -0
  165. data/test/dummy/tmp/cache/assets/D68/690/sprockets%2Fad268c7a74b2827a1e39edd0c380a1d8 +0 -0
  166. data/test/dummy/tmp/cache/assets/D6F/3A0/sprockets%2F8eafb8f640b3fd1248b24ef9b395123b +0 -0
  167. data/test/dummy/tmp/cache/assets/D72/660/sprockets%2F5ab609853f2a56bfb77d91355f25cafa +0 -0
  168. data/test/dummy/tmp/cache/assets/D78/990/sprockets%2Fa03ef9a10faeef89a7553f42a56c6965 +0 -0
  169. data/test/dummy/tmp/cache/assets/D80/F70/sprockets%2Fee35c867a29403cfa596b66dae1e679e +0 -0
  170. data/test/dummy/tmp/cache/assets/D82/610/sprockets%2F2b7e0cb14ca5c5ba0af646a9a8212a62 +0 -0
  171. data/test/dummy/tmp/cache/assets/D84/2E0/sprockets%2F146ff2ff372fc6d9b99e85470dcb55b5 +0 -0
  172. data/test/dummy/tmp/cache/assets/D88/FD0/sprockets%2Fee9831bc4a19cc559d86fb59f3685ed3 +0 -0
  173. data/test/dummy/tmp/cache/assets/D89/2A0/sprockets%2F2701d66b84b6bd30870704bdbbcb3bdb +0 -0
  174. data/test/dummy/tmp/cache/assets/D89/FF0/sprockets%2F03603debeca1897d1df91a20a3bf04d4 +0 -0
  175. data/test/dummy/tmp/cache/assets/D92/A80/sprockets%2F18e700ec4beb52a7fbe3116acc81a587 +0 -0
  176. data/test/dummy/tmp/cache/assets/D96/3F0/sprockets%2Fd1dce00a1972457f8ab4cf4f80d1fa45 +0 -0
  177. data/test/dummy/tmp/cache/assets/D96/550/sprockets%2Fbe7c643b64ef13054ecbe92a4b49dd11 +0 -0
  178. data/test/dummy/tmp/cache/assets/D9B/FA0/sprockets%2F5f7d1fc42b1acc5ae00697e230ffc696 +0 -0
  179. data/test/dummy/tmp/cache/assets/D9C/D70/sprockets%2F05844ad9eb63fbd5b6b137dc36262ffa +0 -0
  180. data/test/dummy/tmp/cache/assets/D9D/540/sprockets%2Fc30d051cb4860b1be974cfebe6859d4c +0 -0
  181. data/test/dummy/tmp/cache/assets/D9E/F30/sprockets%2F7eb77a3cb0efd479c51aefc89e120063 +0 -0
  182. data/test/dummy/tmp/cache/assets/DA1/420/sprockets%2F2b2da3a86dabda8c701d709cb8758e96 +0 -0
  183. data/test/dummy/tmp/cache/assets/DA1/AC0/sprockets%2F8b88acb932b78e361cc6bd4c9d12ad54 +0 -0
  184. data/test/dummy/tmp/cache/assets/DA6/C10/sprockets%2Fc6a9fd3b81208eb5f88e0a57ccc7516e +0 -0
  185. data/test/dummy/tmp/cache/assets/DA7/220/sprockets%2F34f088fa6eec36f9074b9276b6c2cdba +0 -0
  186. data/test/dummy/tmp/cache/assets/DAF/0B0/sprockets%2F9ea457b3e62d559817eae1e1ec8fe1d9 +0 -0
  187. data/test/dummy/tmp/cache/assets/DB7/C10/sprockets%2Fb1cf68baf96448e9a2786bfddd6991e1 +0 -0
  188. data/test/dummy/tmp/cache/assets/DC8/720/sprockets%2Fbd6ffe7cca1ad4e420ca180c8184389c +0 -0
  189. data/test/dummy/tmp/cache/assets/DC8/C50/sprockets%2Ffe71f1c24f254c4deba3b8cedf104476 +0 -0
  190. data/test/dummy/tmp/cache/assets/DCB/2C0/sprockets%2F87fba1d32639cad1f2c4f8ea6b6a3f16 +0 -0
  191. data/test/dummy/tmp/cache/assets/DCF/7E0/sprockets%2F8f0f7d00b6add6cd869ca70ebf0d0982 +0 -0
  192. data/test/dummy/tmp/cache/assets/DDB/C20/sprockets%2F35ac8aeba03982a1ef7683d5fd8e7cf7 +0 -0
  193. data/test/dummy/tmp/cache/assets/DDF/750/sprockets%2F32ca08b9de9e9cdf19ae55458e8b42ee +0 -0
  194. data/test/dummy/tmp/cache/assets/DE5/3A0/sprockets%2Fe0ad18dbe1b892a31daa0c3a554d5d4d +0 -0
  195. data/test/dummy/tmp/cache/assets/E05/CA0/sprockets%2F0acaa4b251e9ee599e992fac3ff03fd7 +0 -0
  196. data/test/dummy/tmp/cache/assets/E07/510/sprockets%2F4da80e01edc5e7d06bf71ec9efe7c972 +0 -0
  197. data/test/dummy/tmp/cache/assets/E08/3C0/sprockets%2Fbe3ccf8c09dfcb94940bef68f50bc455 +0 -0
  198. data/test/dummy/tmp/cache/assets/E14/800/sprockets%2F8b99fef92144f5d13ff03b7ac6ffcfd9 +0 -0
  199. data/test/dummy/tmp/cache/assets/E1B/A70/sprockets%2F2c1ea98c0b1a8d2a08bd15f4ce8c3bdb +0 -0
  200. data/test/dummy/tmp/cache/assets/E1D/C00/sprockets%2Fa5c45a8a2adfd3de166440b053dfbfdc +0 -0
  201. data/test/dummy/tmp/cache/assets/E23/920/sprockets%2Feead0deffe21f3ccbe75290a0d16d293 +0 -0
  202. data/test/dummy/tmp/cache/assets/E24/550/sprockets%2Fa3e9ee903f73cbb1bfba82bf31a87ac3 +0 -0
  203. data/test/dummy/tmp/cache/assets/E25/410/sprockets%2F1dbf8e97f3ef6f4e5f89ae46d9b99a6b +0 -0
  204. data/test/dummy/tmp/cache/assets/E2B/AF0/sprockets%2Fd3d5b6ac573ee7e6ca20ed8c70ebfc16 +0 -0
  205. data/test/dummy/tmp/cache/assets/E2E/290/sprockets%2Fe5debdd1442851bacf83c3a5f1b98ffc +0 -0
  206. data/test/dummy/tmp/cache/assets/E32/4B0/sprockets%2F7998a29caeedcd612e6eb5baa3f4a5b7 +0 -0
  207. data/test/dummy/tmp/cache/assets/E33/210/sprockets%2F12b848beb52cbb5e9dedfd521d9a6c9e +0 -0
  208. data/test/dummy/tmp/cache/assets/E37/920/sprockets%2Fdecfac8e297916ee0fd0b3ac3ec9b478 +0 -0
  209. data/test/dummy/tmp/cache/assets/E47/EB0/sprockets%2F76ebce7bcd98e7b75ef79eec62bb9c31 +0 -0
  210. data/test/dummy/tmp/cache/assets/E56/230/sprockets%2F58da9342a714fbced3dd9cab5dae22bf +0 -0
@@ -0,0 +1,8 @@
1
+ class CreateHubstatsLabelsPullRequests < ActiveRecord::Migration
2
+ def change
3
+ create_table :hubstats_labels_pull_requests do |t|
4
+ t.belongs_to :pull_request
5
+ t.belongs_to :label
6
+ end
7
+ end
8
+ end
@@ -2,15 +2,14 @@ module Hubstats
2
2
  class EventsHandler
3
3
 
4
4
  def route(payload, type)
5
- puts
6
5
  case type
7
- when "issue_comment" || "IssueCommentEvent"
6
+ when "issue_comment", "IssueCommentEvent"
8
7
  comment_processor(payload,"Issue")
9
- when "commit_comment" || "CommitCommentEvent"
8
+ when "commit_comment", "CommitCommentEvent"
10
9
  comment_processor(payload,"Commit")
11
- when "pull_request" || "PullRequestEvent"
10
+ when "pull_request", "PullRequestEvent"
12
11
  pull_processor(payload)
13
- when "pull_request_review_comment" || "PullRequestReviewCommentEvent"
12
+ when "pull_request_review_comment", "PullRequestReviewCommentEvent"
14
13
  comment_processor(payload,"PullRequest")
15
14
  end
16
15
  end
@@ -31,7 +30,6 @@ module Hubstats
31
30
  Hubstats::Comment.create_or_update(comment)
32
31
  end
33
32
 
34
-
35
33
  #grabs the number off of anyone of the various places it can be
36
34
  def get_pull_number(payload)
37
35
  if payload[:pull_request]
@@ -82,6 +82,21 @@ module Hubstats
82
82
  end
83
83
  end
84
84
 
85
+ def self.update_labels
86
+ puts "Adding labels to pull requests"
87
+ Hubstats::Repo.all.each do |repo|
88
+ Hubstats::GithubAPI.client({:auto_paginate => true}).labels(repo.full_name).each do |label|
89
+ label_hash = label.to_h if label.respond_to? :to_h
90
+ label_data = label_hash.slice(*Hubstats::Label.column_names.map(&:to_sym))
91
+ label = Hubstats::Label.where(:name => label_data[:name]).first_or_create(label_data)
92
+ end
93
+
94
+ Hubstats::Label.all.each do |label|
95
+ inline(repo.full_name,'issues', labels: label.name, state: 'closed')
96
+ inline(repo.full_name,'issues', labels: label.name, state: 'open')
97
+ end
98
+ end
99
+ end
85
100
 
86
101
  def self.wait_limit(grab_size,rate_limit)
87
102
  if rate_limit.remaining < grab_size
@@ -102,6 +117,12 @@ module Hubstats
102
117
  Hubstats::Comment.create_or_update(HubHelper.comment_setup(object,repo.id,"Commit"))
103
118
  elsif kind == "pulls"
104
119
  Hubstats::PullRequest.create_or_update(HubHelper.pull_setup(object))
120
+ elsif kind == "issues"
121
+ if object[:pull_request]
122
+ repo = Hubstats::Repo.where(full_name: repo_name).first
123
+ pull_request = Hubstats::PullRequest.where(repo_id: repo.id).where(number: object[:number]).first
124
+ pull_request.add_labels(object[:labels])
125
+ end
105
126
  end
106
127
  end
107
128
  end
@@ -1,3 +1,3 @@
1
1
  module Hubstats
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -29,25 +29,44 @@ namespace :hubstats do
29
29
  pull_requests = Hubstats::GithubAPI.inline(repo.full_name,'pulls', :state => "all")
30
30
  end
31
31
 
32
+ desc "Pull labels from Github saves in database"
33
+ task :labels, [:repo] => :environment do |t, args|
34
+ repo = repo_checker(args[:repo])
35
+ puts "Adding labels for to " + repo.full_name
36
+
37
+ Hubstats::GithubAPI.client({:auto_paginate => true}).labels(repo.full_name).each do |label|
38
+
39
+ label_hash = label.to_h if label.respond_to? :to_h
40
+ label_data = label_hash.slice(*Hubstats::Label.column_names.map(&:to_sym))
41
+ label = Hubstats::Label.where(:name => label_data[:name]).first_or_create(label_data)
42
+ end
43
+ end
44
+
32
45
  desc "Pull repos from Github save to database"
33
46
  task :all => :environment do
34
47
  get_repos.each do |repo|
35
48
  repo = Hubstats::Repo.create_or_update(repo)
36
49
  Hubstats::GithubAPI.create_hook(repo)
37
-
50
+
38
51
  Rake::Task["hubstats:populate:users"].execute({repo: repo})
39
52
  Rake::Task["hubstats:populate:pulls"].execute({repo: repo})
40
53
  Rake::Task["hubstats:populate:comments"].execute({repo: repo})
41
54
  end
42
55
  puts "Finished with initial population, grabing extra info for pull requests"
43
- Rake::Task["hubstats:populate:update"].execute
56
+ Rake::Task["hubstats:populate:update_labels"].execute
57
+ Rake::Task["hubstats:populate:update_pulls"].execute
44
58
  end
45
59
 
46
60
  desc "indivdually gets and updates pull requests"
47
- task :update => :environment do
61
+ task :update_pulls => :environment do
48
62
  Hubstats::GithubAPI.update_pulls
49
63
  end
50
64
 
65
+ desc "sets labels for pull_requests"
66
+ task :update_labels => :environment do
67
+ Hubstats::GithubAPI.update_labels
68
+ end
69
+
51
70
  def repo_checker(args)
52
71
  raise ArgumentError, "Must be called with repo argument. [:org/:repo]" if args.nil?
53
72
  if args.is_a? String
@@ -3,6 +3,18 @@ class CreateHubstatsPullRequests < ActiveRecord::Migration
3
3
  def change
4
4
  create_table :hubstats_pull_requests do |t|
5
5
  t.integer :id
6
+ t.integer :number
7
+ t.belongs_to :user
8
+ t.belongs_to :repo
9
+ t.datetime :created_at
10
+ t.datetime :updated_at
11
+ t.datetime :closed_at
12
+ t.integer :additions
13
+ t.integer :deletions
14
+ t.integer :comments
15
+ t.integer :commits
16
+ t.integer :changed_files
17
+
6
18
  t.string :url
7
19
  t.string :html_url
8
20
  t.string :diff_url
@@ -13,25 +25,13 @@ class CreateHubstatsPullRequests < ActiveRecord::Migration
13
25
  t.string :review_comment_url
14
26
  t.string :comments_url
15
27
  t.string :statuses_url
16
- t.integer :number
17
28
  t.string :state
18
29
  t.string :title
19
30
  t.string :body
20
- t.string :created_at
21
- t.string :updated_at
22
- t.string :closed_at
23
31
  t.string :merged_at
24
32
  t.string :merge_commit_sha
25
33
  t.string :merged
26
34
  t.string :mergeable
27
- t.integer :comments
28
- t.integer :commits
29
- t.integer :additions
30
- t.integer :deletions
31
- t.integer :changed_files
32
- t.belongs_to :user
33
- t.belongs_to :repo
34
- t.timestamps
35
35
  end
36
36
 
37
37
  add_index :hubstats_pull_requests, :user_id
@@ -4,6 +4,10 @@ class CreateHubstatsUsers < ActiveRecord::Migration
4
4
  create_table :hubstats_users do |t|
5
5
  t.string :login
6
6
  t.integer :id
7
+ t.string :role
8
+ t.boolean :site_admin
9
+ t.timestamps
10
+
7
11
  t.string :avatar_url
8
12
  t.string :gravatar_id
9
13
  t.string :url
@@ -17,9 +21,6 @@ class CreateHubstatsUsers < ActiveRecord::Migration
17
21
  t.string :repos_url
18
22
  t.string :events_url
19
23
  t.string :received_events_url
20
- t.string :role
21
- t.boolean :site_admin
22
- t.timestamps
23
24
  end
24
25
  end
25
26
  end
@@ -3,9 +3,14 @@ class CreateHubstatsComments < ActiveRecord::Migration
3
3
  def change
4
4
  create_table :hubstats_comments do |t|
5
5
  t.integer :id
6
- t.string :html_url
7
- t.string :url
8
- t.string :pull_request_url
6
+ t.string :kind
7
+ t.belongs_to :user
8
+ t.belongs_to :pull_request
9
+ t.belongs_to :repo
10
+ t.datetime :created_at
11
+ t.datetime :updated_at
12
+ t.string :body
13
+
9
14
  t.string :diff_hunk
10
15
  t.integer :path
11
16
  t.integer :position
@@ -13,12 +18,10 @@ class CreateHubstatsComments < ActiveRecord::Migration
13
18
  t.string :line
14
19
  t.string :commit_id
15
20
  t.string :original_commit_id
16
- t.string :body
17
- t.string :kind
18
- t.belongs_to :user
19
- t.belongs_to :pull_request
20
- t.belongs_to :repo
21
- t.timestamps
21
+
22
+ t.string :html_url
23
+ t.string :url
24
+ t.string :pull_request_url
22
25
  end
23
26
 
24
27
  add_index :hubstats_comments, :user_id
@@ -3,10 +3,25 @@ class CreateHubstatsRepos < ActiveRecord::Migration
3
3
  def change
4
4
  create_table :hubstats_repos do |t|
5
5
  t.integer :id
6
+ t.belongs_to :owner
6
7
  t.string :name
7
8
  t.string :full_name
9
+ t.datetime :pushed_at
10
+ t.datetime :created_at
11
+ t.datetime :updated_at
12
+
8
13
  t.string :homepage
9
14
  t.string :language
15
+ t.integer :forks_count
16
+ t.integer :stargazers_count
17
+ t.integer :watches_count
18
+ t.integer :size
19
+ t.integer :open_issues_count
20
+ t.boolean :has_issues
21
+ t.boolean :has_wiki
22
+ t.boolean :has_downloads
23
+ t.boolean :private
24
+ t.boolean :fork
10
25
  t.string :description
11
26
  t.string :default_branch
12
27
  t.string :url
@@ -26,21 +41,6 @@ class CreateHubstatsRepos < ActiveRecord::Migration
26
41
  t.string :issues_url
27
42
  t.string :pulls_url
28
43
  t.string :labels_url
29
- t.integer :forks_count
30
- t.integer :stargazers_count
31
- t.integer :watches_count
32
- t.integer :size
33
- t.integer :open_issues_count
34
- t.boolean :has_issues
35
- t.boolean :has_wiki
36
- t.boolean :has_downloads
37
- t.boolean :private
38
- t.boolean :fork
39
- t.datetime :pushed_at
40
- t.datetime :created_at
41
- t.datetime :updated_at
42
- t.belongs_to :owner
43
- t.timestamps
44
44
  end
45
45
 
46
46
  add_index :hubstats_repos, :owner_id
@@ -0,0 +1,10 @@
1
+ # This migration comes from hubstats (originally 20140703173123)
2
+ class CreateHubstatsLabels < ActiveRecord::Migration
3
+ def change
4
+ create_table :hubstats_labels do |t|
5
+ t.string :name
6
+ t.string :color
7
+ t.string :url
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # This migration comes from hubstats (originally 20140703200752)
2
+ class CreateHubstatsLabelsPullRequests < ActiveRecord::Migration
3
+ def change
4
+ create_table :hubstats_labels_pull_requests do |t|
5
+ t.belongs_to :pull_request
6
+ t.belongs_to :label
7
+ end
8
+ end
9
+ end
@@ -11,12 +11,16 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20140702234360) do
14
+ ActiveRecord::Schema.define(:version => 20140703201051) do
15
15
 
16
16
  create_table "hubstats_comments", :force => true do |t|
17
- t.string "html_url"
18
- t.string "url"
19
- t.string "pull_request_url"
17
+ t.string "kind"
18
+ t.integer "user_id"
19
+ t.integer "pull_request_id"
20
+ t.integer "repo_id"
21
+ t.datetime "created_at"
22
+ t.datetime "updated_at"
23
+ t.string "body"
20
24
  t.string "diff_hunk"
21
25
  t.integer "path"
22
26
  t.integer "position"
@@ -24,57 +28,78 @@ ActiveRecord::Schema.define(:version => 20140702234360) do
24
28
  t.string "line"
25
29
  t.string "commit_id"
26
30
  t.string "original_commit_id"
27
- t.string "body"
28
- t.string "kind"
29
- t.integer "user_id"
30
- t.integer "pull_request_id"
31
- t.integer "repo_id"
32
- t.datetime "created_at", :null => false
33
- t.datetime "updated_at", :null => false
31
+ t.string "html_url"
32
+ t.string "url"
33
+ t.string "pull_request_url"
34
34
  end
35
35
 
36
36
  add_index "hubstats_comments", ["pull_request_id"], :name => "index_hubstats_comments_on_pull_request_id"
37
37
  add_index "hubstats_comments", ["user_id"], :name => "index_hubstats_comments_on_user_id"
38
38
 
39
+ create_table "hubstats_labels", :force => true do |t|
40
+ t.string "name"
41
+ t.string "color"
42
+ t.string "url"
43
+ end
44
+
45
+ create_table "hubstats_labels_pull_requests", :force => true do |t|
46
+ t.integer "pull_request_id"
47
+ t.integer "label_id"
48
+ end
49
+
39
50
  create_table "hubstats_pull_requests", :force => true do |t|
40
- t.string "url"
41
- t.string "html_url"
42
- t.string "diff_url"
43
- t.string "patch_url"
44
- t.string "issue_url"
45
- t.string "commits_url"
46
- t.string "review_comments_url"
47
- t.string "review_comment_url"
48
- t.string "comments_url"
49
- t.string "statuses_url"
50
- t.integer "number"
51
- t.string "state"
52
- t.string "title"
53
- t.string "body"
54
- t.string "created_at", :null => false
55
- t.string "updated_at", :null => false
56
- t.string "closed_at"
57
- t.string "merged_at"
58
- t.string "merge_commit_sha"
59
- t.string "merged"
60
- t.string "mergeable"
61
- t.integer "comments"
62
- t.integer "commits"
63
- t.integer "additions"
64
- t.integer "deletions"
65
- t.integer "changed_files"
66
- t.integer "user_id"
67
- t.integer "repo_id"
51
+ t.integer "number"
52
+ t.integer "user_id"
53
+ t.integer "repo_id"
54
+ t.datetime "created_at"
55
+ t.datetime "updated_at"
56
+ t.datetime "closed_at"
57
+ t.integer "additions"
58
+ t.integer "deletions"
59
+ t.integer "comments"
60
+ t.integer "commits"
61
+ t.integer "changed_files"
62
+ t.string "url"
63
+ t.string "html_url"
64
+ t.string "diff_url"
65
+ t.string "patch_url"
66
+ t.string "issue_url"
67
+ t.string "commits_url"
68
+ t.string "review_comments_url"
69
+ t.string "review_comment_url"
70
+ t.string "comments_url"
71
+ t.string "statuses_url"
72
+ t.string "state"
73
+ t.string "title"
74
+ t.string "body"
75
+ t.string "merged_at"
76
+ t.string "merge_commit_sha"
77
+ t.string "merged"
78
+ t.string "mergeable"
68
79
  end
69
80
 
70
81
  add_index "hubstats_pull_requests", ["repo_id"], :name => "index_hubstats_pull_requests_on_repo_id"
71
82
  add_index "hubstats_pull_requests", ["user_id"], :name => "index_hubstats_pull_requests_on_user_id"
72
83
 
73
84
  create_table "hubstats_repos", :force => true do |t|
85
+ t.integer "owner_id"
74
86
  t.string "name"
75
87
  t.string "full_name"
88
+ t.datetime "pushed_at"
89
+ t.datetime "created_at"
90
+ t.datetime "updated_at"
76
91
  t.string "homepage"
77
92
  t.string "language"
93
+ t.integer "forks_count"
94
+ t.integer "stargazers_count"
95
+ t.integer "watches_count"
96
+ t.integer "size"
97
+ t.integer "open_issues_count"
98
+ t.boolean "has_issues"
99
+ t.boolean "has_wiki"
100
+ t.boolean "has_downloads"
101
+ t.boolean "private"
102
+ t.boolean "fork"
78
103
  t.string "description"
79
104
  t.string "default_branch"
80
105
  t.string "url"
@@ -94,26 +119,16 @@ ActiveRecord::Schema.define(:version => 20140702234360) do
94
119
  t.string "issues_url"
95
120
  t.string "pulls_url"
96
121
  t.string "labels_url"
97
- t.integer "forks_count"
98
- t.integer "stargazers_count"
99
- t.integer "watches_count"
100
- t.integer "size"
101
- t.integer "open_issues_count"
102
- t.boolean "has_issues"
103
- t.boolean "has_wiki"
104
- t.boolean "has_downloads"
105
- t.boolean "private"
106
- t.boolean "fork"
107
- t.datetime "pushed_at"
108
- t.datetime "created_at", :null => false
109
- t.datetime "updated_at", :null => false
110
- t.integer "owner_id"
111
122
  end
112
123
 
113
124
  add_index "hubstats_repos", ["owner_id"], :name => "index_hubstats_repos_on_owner_id"
114
125
 
115
126
  create_table "hubstats_users", :force => true do |t|
116
127
  t.string "login"
128
+ t.string "role"
129
+ t.boolean "site_admin"
130
+ t.datetime "created_at", :null => false
131
+ t.datetime "updated_at", :null => false
117
132
  t.string "avatar_url"
118
133
  t.string "gravatar_id"
119
134
  t.string "url"
@@ -127,10 +142,6 @@ ActiveRecord::Schema.define(:version => 20140702234360) do
127
142
  t.string "repos_url"
128
143
  t.string "events_url"
129
144
  t.string "received_events_url"
130
- t.string "role"
131
- t.boolean "site_admin"
132
- t.datetime "created_at", :null => false
133
- t.datetime "updated_at", :null => false
134
145
  end
135
146
 
136
147
  end