prosperity 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +31 -0
  4. data/app/assets/javascripts/prosperity/application.js.coffee +42 -0
  5. data/app/assets/stylesheets/prosperity/application.css.scss +19 -0
  6. data/app/controllers/prosperity/application_controller.rb +4 -0
  7. data/app/controllers/prosperity/metrics_controller.rb +9 -0
  8. data/app/helpers/prosperity/application_helper.rb +7 -0
  9. data/app/helpers/prosperity/metrics_helper.rb +11 -0
  10. data/app/views/layouts/prosperity/application.html.haml +37 -0
  11. data/app/views/prosperity/metrics/index.html.haml +7 -0
  12. data/config/routes.rb +5 -0
  13. data/db/migrate/20131026214127_test.rb +4 -0
  14. data/lib/prosperity/engine.rb +9 -0
  15. data/lib/prosperity/exception.rb +11 -0
  16. data/lib/prosperity/extractors/base.rb +11 -0
  17. data/lib/prosperity/extractors/count.rb +18 -0
  18. data/lib/prosperity/extractors/group.rb +23 -0
  19. data/lib/prosperity/metric.rb +48 -0
  20. data/lib/prosperity/metric_finder.rb +14 -0
  21. data/lib/prosperity/metrics/option.rb +9 -0
  22. data/lib/prosperity/metrics.rb +5 -0
  23. data/lib/prosperity/period.rb +11 -0
  24. data/lib/prosperity/periods.rb +6 -0
  25. data/lib/prosperity/version.rb +3 -0
  26. data/lib/prosperity.rb +4 -0
  27. data/lib/tasks/prosperity_tasks.rake +4 -0
  28. data/spec/controllers/prosperity/metrics_controller_spec.rb +14 -0
  29. data/spec/dummy/README.rdoc +28 -0
  30. data/spec/dummy/Rakefile +8 -0
  31. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  32. data/spec/dummy/app/assets/javascripts/users.js +2 -0
  33. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  34. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  35. data/spec/dummy/app/assets/stylesheets/users.css +4 -0
  36. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  37. data/spec/dummy/app/controllers/users_controller.rb +58 -0
  38. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  39. data/spec/dummy/app/helpers/users_helper.rb +2 -0
  40. data/spec/dummy/app/models/user.rb +2 -0
  41. data/spec/dummy/app/prosperity/users_metric.rb +3 -0
  42. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  43. data/spec/dummy/app/views/users/_form.html.erb +25 -0
  44. data/spec/dummy/app/views/users/edit.html.erb +6 -0
  45. data/spec/dummy/app/views/users/index.html.erb +29 -0
  46. data/spec/dummy/app/views/users/new.html.erb +5 -0
  47. data/spec/dummy/app/views/users/show.html.erb +14 -0
  48. data/spec/dummy/bin/bundle +3 -0
  49. data/spec/dummy/bin/rails +4 -0
  50. data/spec/dummy/bin/rake +4 -0
  51. data/spec/dummy/config/application.rb +23 -0
  52. data/spec/dummy/config/boot.rb +5 -0
  53. data/spec/dummy/config/database.yml +24 -0
  54. data/spec/dummy/config/environment.rb +5 -0
  55. data/spec/dummy/config/environments/development.rb +29 -0
  56. data/spec/dummy/config/environments/production.rb +80 -0
  57. data/spec/dummy/config/environments/test.rb +36 -0
  58. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  59. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  60. data/spec/dummy/config/initializers/inflections.rb +16 -0
  61. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  62. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  63. data/spec/dummy/config/initializers/session_store.rb +3 -0
  64. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  65. data/spec/dummy/config/locales/en.yml +23 -0
  66. data/spec/dummy/config/routes.rb +6 -0
  67. data/spec/dummy/config.ru +4 -0
  68. data/spec/dummy/db/development.sqlite3 +0 -0
  69. data/spec/dummy/db/migrate/20131026214807_create_users.rb +10 -0
  70. data/spec/dummy/db/schema.rb +26 -0
  71. data/spec/dummy/db/seeds.rb +7 -0
  72. data/spec/dummy/db/test.sqlite3 +0 -0
  73. data/spec/dummy/log/development.log +18945 -0
  74. data/spec/dummy/log/test.log +1992 -0
  75. data/spec/dummy/public/404.html +58 -0
  76. data/spec/dummy/public/422.html +58 -0
  77. data/spec/dummy/public/500.html +57 -0
  78. data/spec/dummy/public/favicon.ico +0 -0
  79. data/spec/dummy/tmp/cache/assets/development/sass/34a577735054231563e7022ea73e1468db9203ba/application.css.scssc +0 -0
  80. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_alerts.scssc +0 -0
  81. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_badges.scssc +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_bootstrap.scssc +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_breadcrumbs.scssc +0 -0
  84. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_button-groups.scssc +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_buttons.scssc +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_carousel.scssc +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_close.scssc +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_code.scssc +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_component-animations.scssc +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_dropdowns.scssc +0 -0
  91. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_forms.scssc +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_glyphicons.scssc +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_grid.scssc +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_input-groups.scssc +0 -0
  95. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_jumbotron.scssc +0 -0
  96. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_labels.scssc +0 -0
  97. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_list-group.scssc +0 -0
  98. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_media.scssc +0 -0
  99. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_mixins.scssc +0 -0
  100. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_modals.scssc +0 -0
  101. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_navbar.scssc +0 -0
  102. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_navs.scssc +0 -0
  103. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_normalize.scssc +0 -0
  104. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_pager.scssc +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_pagination.scssc +0 -0
  106. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_panels.scssc +0 -0
  107. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_popovers.scssc +0 -0
  108. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_print.scssc +0 -0
  109. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_progress-bars.scssc +0 -0
  110. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_responsive-utilities.scssc +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_scaffolding.scssc +0 -0
  112. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_tables.scssc +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_thumbnails.scssc +0 -0
  114. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_tooltip.scssc +0 -0
  115. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_type.scssc +0 -0
  116. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_utilities.scssc +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_variables.scssc +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sass/994e9de37e7f58fef085c22ad997b3c9ce2a4b39/_wells.scssc +0 -0
  119. data/spec/dummy/tmp/cache/assets/development/sass/be34d2a735e9e523a3c8b9414be4508380964813/bootstrap.scssc +0 -0
  120. data/spec/dummy/tmp/cache/assets/development/sprockets/043337ddb7f545a88004b2eb2a069b4d +0 -0
  121. data/spec/dummy/tmp/cache/assets/development/sprockets/05ee6e5d8777628542d4ed27eab34c5a +0 -0
  122. data/spec/dummy/tmp/cache/assets/development/sprockets/07080bfb6d1d7b60d61990c547c0f47a +0 -0
  123. data/spec/dummy/tmp/cache/assets/development/sprockets/073948f1a0c619142ecfcb14a5806302 +0 -0
  124. data/spec/dummy/tmp/cache/assets/development/sprockets/07e8fb2db7d85e29590a6b05160ca825 +0 -0
  125. data/spec/dummy/tmp/cache/assets/development/sprockets/0800f54ee19cf3cee10b956fa9786799 +0 -0
  126. data/spec/dummy/tmp/cache/assets/development/sprockets/12eb9637e2c654371ecf7033d5a5cb36 +0 -0
  127. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  128. data/spec/dummy/tmp/cache/assets/development/sprockets/1502b34f91cda1f4222490f78c0fea39 +0 -0
  129. data/spec/dummy/tmp/cache/assets/development/sprockets/1533bcf4a8f5a745dfda80cebd88d217 +0 -0
  130. data/spec/dummy/tmp/cache/assets/development/sprockets/177ca1f3e92db4f8a8f6e7ad9786ebfc +0 -0
  131. data/spec/dummy/tmp/cache/assets/development/sprockets/18d7d771937643bc7e9210b1a80e5763 +0 -0
  132. data/spec/dummy/tmp/cache/assets/development/sprockets/197492ed379339e17a0f5d01d3b01b8c +0 -0
  133. data/spec/dummy/tmp/cache/assets/development/sprockets/1c55cf24465f311353197ce336df0178 +0 -0
  134. data/spec/dummy/tmp/cache/assets/development/sprockets/1cb94582c835e73b3fd3c276f9a7de56 +0 -0
  135. data/spec/dummy/tmp/cache/assets/development/sprockets/203047a4141cf08162077e7290421bbb +0 -0
  136. data/spec/dummy/tmp/cache/assets/development/sprockets/210050da208fb75a75b701bfa4e8470f +0 -0
  137. data/spec/dummy/tmp/cache/assets/development/sprockets/29a6c93aeb91d07a5533b3adba7697d0 +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sprockets/29ac2be474969468157245a7f8737fa4 +0 -0
  139. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  140. data/spec/dummy/tmp/cache/assets/development/sprockets/314e44d29ecc7449c9ca3b754329c245 +0 -0
  141. data/spec/dummy/tmp/cache/assets/development/sprockets/3162d1398d6940ee5e933b7ab4d2273d +0 -0
  142. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  144. data/spec/dummy/tmp/cache/assets/development/sprockets/3d80e2a5faaf2bd987d804c17aead745 +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sprockets/4050a4e5062ab95c9f32e9b6940821ea +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sprockets/4155a156cc6ffb880b56dbc34346fbc0 +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sprockets/4166fe47cddf4ba18c53b843d69b4c5f +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sprockets/4432a4b71ce9551df8d4b3860f4b9be3 +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sprockets/5479c7b4fba9179d4d1dc59ae64964c1 +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sprockets/5a3ab9afd151c265cf11c621c0ddbe00 +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sprockets/5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sprockets/647038c58f26163a9217646e1e5f09ae +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sprockets/64e0150fafbd9aaa3822efa1abb0211d +0 -0
  155. data/spec/dummy/tmp/cache/assets/development/sprockets/6536a3eb4b5d05368d260a46f2485ead +0 -0
  156. data/spec/dummy/tmp/cache/assets/development/sprockets/65c2d908dbca1bc833ae0b552f6c27fa +0 -0
  157. data/spec/dummy/tmp/cache/assets/development/sprockets/6882b260ae69f1594eff540d803e5ac3 +0 -0
  158. data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  159. data/spec/dummy/tmp/cache/assets/development/sprockets/726d3f6850549a59954f0bf5584cfd9f +0 -0
  160. data/spec/dummy/tmp/cache/assets/development/sprockets/75f2f1e32219e0b89c069e43b49e0e49 +0 -0
  161. data/spec/dummy/tmp/cache/assets/development/sprockets/7ab9ac7cc2529219a4c68fd7854d5c0f +0 -0
  162. data/spec/dummy/tmp/cache/assets/development/sprockets/7abbc975e6786a54d660e0cf19aab1f0 +0 -0
  163. data/spec/dummy/tmp/cache/assets/development/sprockets/7bac3aca131c870ad5b07d8ccdc86e06 +0 -0
  164. data/spec/dummy/tmp/cache/assets/development/sprockets/7ffb7c821c008cd2a390dc7aba74361f +0 -0
  165. data/spec/dummy/tmp/cache/assets/development/sprockets/80392355fc6e00cf69b2cd46978ebcbe +0 -0
  166. data/spec/dummy/tmp/cache/assets/development/sprockets/8084620ce7f95d2b2aeb65c977c62af1 +0 -0
  167. data/spec/dummy/tmp/cache/assets/development/sprockets/874b42463fefbb0bce47775722ebb4ae +0 -0
  168. data/spec/dummy/tmp/cache/assets/development/sprockets/87b209c0c9da28094a8d5581a21262c6 +0 -0
  169. data/spec/dummy/tmp/cache/assets/development/sprockets/87ef8ddd2847d19f22a16d726b88b433 +0 -0
  170. data/spec/dummy/tmp/cache/assets/development/sprockets/91ae0bd43f98b4f1f111e0bdc178302c +0 -0
  171. data/spec/dummy/tmp/cache/assets/development/sprockets/9a7970620504bfe92af14fd57ee08365 +0 -0
  172. data/spec/dummy/tmp/cache/assets/development/sprockets/9c8440c4efec99d4a380eeda42f089c7 +0 -0
  173. data/spec/dummy/tmp/cache/assets/development/sprockets/9e4cf41800946fd32bcfa3591b304eb6 +0 -0
  174. data/spec/dummy/tmp/cache/assets/development/sprockets/a2b14d5c46db32da9183354fb3fcd0bf +0 -0
  175. data/spec/dummy/tmp/cache/assets/development/sprockets/a6d6196cfd275dea0718553a95f997a5 +0 -0
  176. data/spec/dummy/tmp/cache/assets/development/sprockets/a7a8652a3fb42ef81fac3ab77949f82d +0 -0
  177. data/spec/dummy/tmp/cache/assets/development/sprockets/a9d839f632f9ce73fc221b79b39b0924 +0 -0
  178. data/spec/dummy/tmp/cache/assets/development/sprockets/bae0ea1201e2ec9420712ff54b3254aa +0 -0
  179. data/spec/dummy/tmp/cache/assets/development/sprockets/c05c4a514cf0b61ad7b223ee732cd6df +0 -0
  180. data/spec/dummy/tmp/cache/assets/development/sprockets/c29c465933e7e86d6f6224f5e78c5baf +0 -0
  181. data/spec/dummy/tmp/cache/assets/development/sprockets/c975834a35907ecd2d314bbd6844ee88 +0 -0
  182. data/spec/dummy/tmp/cache/assets/development/sprockets/cebc6db0bbb8120f430da3970b173d2f +0 -0
  183. data/spec/dummy/tmp/cache/assets/development/sprockets/cf4affc50c6303e717d6514380d1f417 +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sprockets/d0194b0fba4290072cfff0be06b348fd +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  187. data/spec/dummy/tmp/cache/assets/development/sprockets/d8487b3a1dc72a1361b96fbbc93255c6 +0 -0
  188. data/spec/dummy/tmp/cache/assets/development/sprockets/d8b357d5741711da2dd710af0e15d268 +0 -0
  189. data/spec/dummy/tmp/cache/assets/development/sprockets/e02b5049cf477b43a72b4a00e2fceb46 +0 -0
  190. data/spec/dummy/tmp/cache/assets/development/sprockets/e0be9bf6ab486a790bda60b51224b404 +0 -0
  191. data/spec/dummy/tmp/cache/assets/development/sprockets/e22a1b318499e7f06ea9274e18ab004f +0 -0
  192. data/spec/dummy/tmp/cache/assets/development/sprockets/e298cc3a8203ab1fb6978a90254f8926 +0 -0
  193. data/spec/dummy/tmp/cache/assets/development/sprockets/e2a9bdd87a2d19256837fce6544a122c +0 -0
  194. data/spec/dummy/tmp/cache/assets/development/sprockets/e868f358fe87542c483951a2d9f532b6 +0 -0
  195. data/spec/dummy/tmp/cache/assets/development/sprockets/e8a6adf580ebd1942f4aabe6738678c2 +0 -0
  196. data/spec/dummy/tmp/cache/assets/development/sprockets/ea081ed20ad78a3e8f41a529b6baa2e1 +0 -0
  197. data/spec/dummy/tmp/cache/assets/development/sprockets/ec956e1f28c818063bb61958fe5ae855 +0 -0
  198. data/spec/dummy/tmp/cache/assets/development/sprockets/ed71f99e0a9653296abd5d6f501dd898 +0 -0
  199. data/spec/dummy/tmp/cache/assets/development/sprockets/eee3cb53f216eaa12dd927f144640d0d +0 -0
  200. data/spec/dummy/tmp/cache/assets/development/sprockets/efe6f2d16d3a1819817efb8734daf8af +0 -0
  201. data/spec/dummy/tmp/cache/assets/development/sprockets/f03e99bdb4159ae3485ca2858716e19b +0 -0
  202. data/spec/dummy/tmp/cache/assets/development/sprockets/f29bc513eb7c7d4b79d53d51363f7f1f +0 -0
  203. data/spec/dummy/tmp/cache/assets/development/sprockets/f56253b5f374fff1a33fbbc9881c9124 +0 -0
  204. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  205. data/spec/dummy/tmp/cache/assets/development/sprockets/fc2c22310cbb7abb26ae64d4aafa37cb +0 -0
  206. data/spec/dummy/tmp/restart.txt +0 -0
  207. data/spec/helpers/prosperity/metrics_helper_spec.rb +6 -0
  208. data/spec/lib/prosperity/extractors/base_spec.rb +8 -0
  209. data/spec/lib/prosperity/extractors/count_spec.rb +35 -0
  210. data/spec/lib/prosperity/extractors/group_spec.rb +34 -0
  211. data/spec/lib/prosperity/metric_finder_spec.rb +20 -0
  212. data/spec/lib/prosperity/metric_spec.rb +49 -0
  213. data/spec/lib/prosperity/metrics/option_spec.rb +7 -0
  214. data/spec/lib/prosperity/period_spec.rb +7 -0
  215. data/spec/lib/prosperity/periods_spec.rb +7 -0
  216. data/spec/spec_helper.rb +17 -0
  217. data/spec/support/test_database.rb +18 -0
  218. data/spec/test_files/metrics/users_metric.rb +4 -0
  219. data/vendor/assets/javascripts/chart.js +1426 -0
  220. data/vendor/assets/stylesheets/bootstrap-theme.min.css +9 -0
  221. data/vendor/assets/stylesheets/bootstrap.min.css +9 -0
  222. metadata +526 -0
@@ -0,0 +1,25 @@
1
+ <%= form_for(@user) do |f| %>
2
+ <% if @user.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :email %><br>
16
+ <%= f.text_field :email %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :name %><br>
20
+ <%= f.text_field :name %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @user %> |
6
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,29 @@
1
+ <h1>Listing users</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Email</th>
7
+ <th>Name</th>
8
+ <th></th>
9
+ <th></th>
10
+ <th></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @users.each do |user| %>
16
+ <tr>
17
+ <td><%= user.email %></td>
18
+ <td><%= user.name %></td>
19
+ <td><%= link_to 'Show', user %></td>
20
+ <td><%= link_to 'Edit', edit_user_path(user) %></td>
21
+ <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New User', new_user_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,14 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Email:</strong>
5
+ <%= @user.email %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Name:</strong>
10
+ <%= @user.name %>
11
+ </p>
12
+
13
+ <%= link_to 'Edit', edit_user_path(@user) %> |
14
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,23 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require "prosperity"
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ end
22
+ end
23
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,24 @@
1
+ # SQLite version 3.x
2
+ # gem install postgresql
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'postgresql'
6
+ development:
7
+ adapter: postgresql
8
+ encoding: unicode
9
+ database: properity_dummy_development
10
+ pool: 5
11
+ username: postgres
12
+ password:
13
+
14
+ # Warning: The database defined as "test" will be erased and
15
+ # re-generated from your development database when you run "rake".
16
+ # Do not set this db to the same as development or production.
17
+ test:
18
+ adapter: postgresql
19
+ encoding: unicode
20
+ database: properity_dummy_test
21
+ pool: 5
22
+ username: postgres
23
+ password:
24
+
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Dummy::Application.initialize!
@@ -0,0 +1,29 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+ end
@@ -0,0 +1,80 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both thread web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
23
+ config.serve_static_assets = false
24
+
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
28
+
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
30
+ config.assets.compile = false
31
+
32
+ # Generate digests for assets URLs.
33
+ config.assets.digest = true
34
+
35
+ # Version of your assets, change this if you want to expire all your assets.
36
+ config.assets.version = '1.0'
37
+
38
+ # Specifies the header that your server uses for sending files.
39
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
40
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
41
+
42
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
43
+ # config.force_ssl = true
44
+
45
+ # Set to :debug to see everything in the log.
46
+ config.log_level = :info
47
+
48
+ # Prepend all log lines with the following tags.
49
+ # config.log_tags = [ :subdomain, :uuid ]
50
+
51
+ # Use a different logger for distributed setups.
52
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
53
+
54
+ # Use a different cache store in production.
55
+ # config.cache_store = :mem_cache_store
56
+
57
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
58
+ # config.action_controller.asset_host = "http://assets.example.com"
59
+
60
+ # Precompile additional assets.
61
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
62
+ # config.assets.precompile += %w( search.js )
63
+
64
+ # Ignore bad email addresses and do not raise email delivery errors.
65
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
66
+ # config.action_mailer.raise_delivery_errors = false
67
+
68
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
69
+ # the I18n.default_locale when a translation can not be found).
70
+ config.i18n.fallbacks = true
71
+
72
+ # Send deprecation notices to registered listeners.
73
+ config.active_support.deprecation = :notify
74
+
75
+ # Disable automatic flushing of the log to improve performance.
76
+ # config.autoflush_log = false
77
+
78
+ # Use default logging formatter so that PID and timestamp are not suppressed.
79
+ config.log_formatter = ::Logger::Formatter.new
80
+ end
@@ -0,0 +1,36 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = "public, max-age=3600"
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Print deprecation notices to the stderr.
35
+ config.active_support.deprecation = :stderr
36
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,12 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure your secret_key_base is kept private
11
+ # if you're sharing your code publicly.
12
+ Dummy::Application.config.secret_key_base = 'f6810acf34af5c1468ca11805cffe6eff5d60001d054de399683efcf7521a173a2b9589a711271bd721b6eb70e3547bf8b402b1d74d30f52990fbfb680a5e35b'
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,6 @@
1
+ Rails.application.routes.draw do
2
+ resources :users
3
+ mount Prosperity::Engine => "/prosperity"
4
+
5
+ root to: redirect("/prosperity")
6
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
Binary file
@@ -0,0 +1,10 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :email
5
+ t.string :name
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,26 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20131026214807) do
15
+
16
+ # These are extensions that must be enabled in order to support this database
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "users", force: true do |t|
20
+ t.string "email"
21
+ t.string "name"
22
+ t.datetime "created_at"
23
+ t.datetime "updated_at"
24
+ end
25
+
26
+ end
@@ -0,0 +1,7 @@
1
+ 1000.times do |i|
2
+ t = (1.year.ago + rand(1.year.to_i))
3
+ User.create name: "User #{i}",
4
+ email: "user+#{i}@example.org",
5
+ created_at: t,
6
+ updated_at: t
7
+ end
Binary file