muck-raker 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (292) hide show
  1. data/Rakefile +27 -8
  2. data/VERSION +1 -1
  3. data/app/controllers/recommender/entries_controller.rb +13 -12
  4. data/app/controllers/recommender/feeds_controller.rb +64 -0
  5. data/app/controllers/recommender/recommendations_controller.rb +1 -1
  6. data/app/helpers/muck_raker_feeds_helper.rb +3 -0
  7. data/app/helpers/muck_raker_helper.rb +27 -4
  8. data/app/models/entry.rb +5 -4
  9. data/app/models/feed.rb +1 -0
  10. data/app/models/tag_cloud.rb +3 -3
  11. data/app/views/entries/_result_status.html.erb +8 -1
  12. data/app/views/entries/_tag_cloud.html.erb +2 -2
  13. data/app/views/entries/browse_by_tags.html.erb +1 -1
  14. data/app/views/entries/details.html.erb +4 -4
  15. data/app/views/entries/search.html.erb +1 -1
  16. data/app/views/recommendations/index.xml.builder +5 -3
  17. data/config/muck_raker_routes.rb +1 -0
  18. data/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +9 -0
  19. data/db/migrate/20090717173900_add_contributor_to_feeds.rb +9 -0
  20. data/db/migrate/20090717175825_normalize_entries_subjects.rb +17 -0
  21. data/lib/muck_raker/tasks.rb +21 -3
  22. data/locales/en.yml +11 -4
  23. data/muck-raker.gemspec +320 -10
  24. data/raker/lib/aggregatord.jar +0 -0
  25. data/raker/lib/recommenderd.jar +0 -0
  26. data/test/rails_root/.gitignore +8 -0
  27. data/test/rails_root/.rake_tasks +103 -0
  28. data/test/rails_root/Capfile +3 -0
  29. data/test/rails_root/Rakefile +15 -0
  30. data/test/rails_root/app/controllers/application_controller.rb +21 -0
  31. data/test/rails_root/app/controllers/default_controller.rb +7 -0
  32. data/test/rails_root/app/helpers/application_helper.rb +3 -0
  33. data/test/rails_root/app/models/.keep +0 -0
  34. data/test/rails_root/app/models/user.rb +6 -0
  35. data/test/rails_root/app/models/user_session.rb +2 -0
  36. data/test/rails_root/app/views/default/index.html.erb +0 -0
  37. data/test/rails_root/app/views/layouts/default.html.erb +26 -0
  38. data/test/rails_root/config/amazon_s3.yml +14 -0
  39. data/test/rails_root/config/boot.rb +109 -0
  40. data/test/rails_root/config/database.yml +14 -0
  41. data/test/rails_root/config/environment.rb +29 -0
  42. data/test/rails_root/config/environments/development.rb +19 -0
  43. data/test/rails_root/config/environments/production.rb +1 -0
  44. data/test/rails_root/config/environments/test.rb +34 -0
  45. data/test/rails_root/config/global_config.yml +77 -0
  46. data/test/rails_root/config/initializers/inflections.rb +10 -0
  47. data/test/rails_root/config/initializers/mime_types.rb +5 -0
  48. data/test/rails_root/config/initializers/requires.rb +13 -0
  49. data/test/rails_root/config/initializers/session_store.rb +8 -0
  50. data/test/rails_root/config/routes.rb +3 -0
  51. data/test/rails_root/config/solr/README.txt +0 -0
  52. data/test/rails_root/config/solr/cores/de/conf/protwords.txt +21 -0
  53. data/test/rails_root/config/solr/cores/de/conf/schema.xml +81 -0
  54. data/test/rails_root/config/solr/cores/de/conf/solrconfig.xml +304 -0
  55. data/test/rails_root/config/solr/cores/de/conf/stopwords.txt +341 -0
  56. data/test/rails_root/config/solr/cores/de/conf/synonyms.txt +31 -0
  57. data/test/rails_root/config/solr/cores/en/conf/protwords.txt +21 -0
  58. data/test/rails_root/config/solr/cores/en/conf/schema.xml +83 -0
  59. data/test/rails_root/config/solr/cores/en/conf/solrconfig.xml +304 -0
  60. data/test/rails_root/config/solr/cores/en/conf/stopwords.txt +341 -0
  61. data/test/rails_root/config/solr/cores/en/conf/synonyms.txt +31 -0
  62. data/test/rails_root/config/solr/cores/es/conf/protwords.txt +21 -0
  63. data/test/rails_root/config/solr/cores/es/conf/schema.xml +81 -0
  64. data/test/rails_root/config/solr/cores/es/conf/solrconfig.xml +304 -0
  65. data/test/rails_root/config/solr/cores/es/conf/stopwords.txt +206 -0
  66. data/test/rails_root/config/solr/cores/es/conf/synonyms.txt +31 -0
  67. data/test/rails_root/config/solr/cores/fr/conf/protwords.txt +21 -0
  68. data/test/rails_root/config/solr/cores/fr/conf/schema.xml +82 -0
  69. data/test/rails_root/config/solr/cores/fr/conf/solrconfig.xml +304 -0
  70. data/test/rails_root/config/solr/cores/fr/conf/stopwords.txt +57 -0
  71. data/test/rails_root/config/solr/cores/fr/conf/synonyms.txt +31 -0
  72. data/test/rails_root/config/solr/cores/ja/conf/protwords.txt +21 -0
  73. data/test/rails_root/config/solr/cores/ja/conf/schema.xml +69 -0
  74. data/test/rails_root/config/solr/cores/ja/conf/solrconfig.xml +304 -0
  75. data/test/rails_root/config/solr/cores/ja/conf/stopwords.txt +341 -0
  76. data/test/rails_root/config/solr/cores/ja/conf/synonyms.txt +31 -0
  77. data/test/rails_root/config/solr/cores/nl/conf/protwords.txt +21 -0
  78. data/test/rails_root/config/solr/cores/nl/conf/schema.xml +78 -0
  79. data/test/rails_root/config/solr/cores/nl/conf/solrconfig.xml +304 -0
  80. data/test/rails_root/config/solr/cores/nl/conf/stopwords.txt +45691 -0
  81. data/test/rails_root/config/solr/cores/nl/conf/synonyms.txt +31 -0
  82. data/test/rails_root/config/solr/cores/ru/conf/protwords.txt +21 -0
  83. data/test/rails_root/config/solr/cores/ru/conf/schema.xml +78 -0
  84. data/test/rails_root/config/solr/cores/ru/conf/solrconfig.xml +304 -0
  85. data/test/rails_root/config/solr/cores/ru/conf/stopwords.txt +341 -0
  86. data/test/rails_root/config/solr/cores/ru/conf/synonyms.txt +31 -0
  87. data/test/rails_root/config/solr/cores/zh/conf/protwords.txt +21 -0
  88. data/test/rails_root/config/solr/cores/zh/conf/schema.xml +72 -0
  89. data/test/rails_root/config/solr/cores/zh/conf/solrconfig.xml +304 -0
  90. data/test/rails_root/config/solr/cores/zh/conf/stopwords.txt +341 -0
  91. data/test/rails_root/config/solr/cores/zh/conf/synonyms.txt +31 -0
  92. data/test/rails_root/config/solr/solr.xml +50 -0
  93. data/test/rails_root/db/.keep +0 -0
  94. data/test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +16 -0
  95. data/test/rails_root/db/migrate/20090602041838_create_users.rb +39 -0
  96. data/test/rails_root/db/migrate/20090704220055_create_slugs.rb +18 -0
  97. data/test/rails_root/db/migrate/20090704220120_acts_as_taggable_on_migration.rb +29 -0
  98. data/test/rails_root/db/migrate/20090717173900_add_contributor_to_feeds.rb +9 -0
  99. data/test/rails_root/db/schema.rb +166 -0
  100. data/test/rails_root/features/step_definitions/webrat_steps.rb +99 -0
  101. data/test/rails_root/features/support/env.rb +14 -0
  102. data/test/rails_root/migrate/20090602191243_create_muck_raker.rb +307 -0
  103. data/test/rails_root/migrate/20090619211125_create_tag_clouds.rb +19 -0
  104. data/test/rails_root/migrate/20090623181458_add_grain_size_to_entries.rb +16 -0
  105. data/test/rails_root/migrate/20090703175825_denormalize_entries_subjects.rb +16 -0
  106. data/test/rails_root/public/.htaccess +40 -0
  107. data/test/rails_root/public/404.html +30 -0
  108. data/test/rails_root/public/422.html +30 -0
  109. data/test/rails_root/public/500.html +30 -0
  110. data/test/rails_root/public/dispatch.rb +10 -0
  111. data/test/rails_root/public/favicon.ico +0 -0
  112. data/test/rails_root/public/images/arrow_left.gif +0 -0
  113. data/test/rails_root/public/images/arrow_right.gif +0 -0
  114. data/test/rails_root/public/images/blue/preview.gif +0 -0
  115. data/test/rails_root/public/images/icons/accept.png +0 -0
  116. data/test/rails_root/public/images/icons/add.png +0 -0
  117. data/test/rails_root/public/images/icons/delete.png +0 -0
  118. data/test/rails_root/public/images/icons/vote.png +0 -0
  119. data/test/rails_root/public/images/loading.gif +0 -0
  120. data/test/rails_root/public/images/profile_default.jpg +0 -0
  121. data/test/rails_root/public/images/rails.png +0 -0
  122. data/test/rails_root/public/images/red/preview.gif +0 -0
  123. data/test/rails_root/public/images/spinner.gif +0 -0
  124. data/test/rails_root/public/images/sprites.png +0 -0
  125. data/test/rails_root/public/javascripts/application.js +2 -0
  126. data/test/rails_root/public/javascripts/builder.js +136 -0
  127. data/test/rails_root/public/javascripts/controls.js +963 -0
  128. data/test/rails_root/public/javascripts/dragdrop.js +972 -0
  129. data/test/rails_root/public/javascripts/effects.js +1120 -0
  130. data/test/rails_root/public/javascripts/fancyzoom.min.js +1 -0
  131. data/test/rails_root/public/javascripts/jquery/jquery-ui.js +273 -0
  132. data/test/rails_root/public/javascripts/jquery/jquery.form.js +637 -0
  133. data/test/rails_root/public/javascripts/jquery/jquery.jgrowl.js +2 -0
  134. data/test/rails_root/public/javascripts/jquery/jquery.js +19 -0
  135. data/test/rails_root/public/javascripts/jquery/jquery.tips.js +69 -0
  136. data/test/rails_root/public/javascripts/muck.js +76 -0
  137. data/test/rails_root/public/javascripts/muck_activities.js +108 -0
  138. data/test/rails_root/public/javascripts/prototype.js +4225 -0
  139. data/test/rails_root/public/javascripts/scriptaculous.js +58 -0
  140. data/test/rails_root/public/javascripts/slider.js +277 -0
  141. data/test/rails_root/public/javascripts/sound.js +60 -0
  142. data/test/rails_root/public/robots.txt +1 -0
  143. data/test/rails_root/public/stylesheets/.keep +0 -0
  144. data/test/rails_root/public/stylesheets/admin.css +12 -0
  145. data/test/rails_root/public/stylesheets/blueprint/ie.css +26 -0
  146. data/test/rails_root/public/stylesheets/blueprint/liquid_screen.css +203 -0
  147. data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/cross.png +0 -0
  148. data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/key.png +0 -0
  149. data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/tick.png +0 -0
  150. data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/readme.txt +32 -0
  151. data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/screen.css +97 -0
  152. data/test/rails_root/public/stylesheets/blueprint/plugins/fancy-type/readme.txt +14 -0
  153. data/test/rails_root/public/stylesheets/blueprint/plugins/fancy-type/screen.css +71 -0
  154. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/doc.png +0 -0
  155. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/email.png +0 -0
  156. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/external.png +0 -0
  157. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/feed.png +0 -0
  158. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/im.png +0 -0
  159. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png +0 -0
  160. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/visited.png +0 -0
  161. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/xls.png +0 -0
  162. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/readme.txt +18 -0
  163. data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/screen.css +40 -0
  164. data/test/rails_root/public/stylesheets/blueprint/plugins/liquid/liquid.css +134 -0
  165. data/test/rails_root/public/stylesheets/blueprint/plugins/liquid/src/liquid.css +197 -0
  166. data/test/rails_root/public/stylesheets/blueprint/plugins/rtl/readme.txt +10 -0
  167. data/test/rails_root/public/stylesheets/blueprint/plugins/rtl/screen.css +109 -0
  168. data/test/rails_root/public/stylesheets/blueprint/print.css +30 -0
  169. data/test/rails_root/public/stylesheets/blueprint/screen.css +251 -0
  170. data/test/rails_root/public/stylesheets/blueprint/sprite.css +1 -0
  171. data/test/rails_root/public/stylesheets/blueprint/src/forms.css +49 -0
  172. data/test/rails_root/public/stylesheets/blueprint/src/grid.css +213 -0
  173. data/test/rails_root/public/stylesheets/blueprint/src/grid.png +0 -0
  174. data/test/rails_root/public/stylesheets/blueprint/src/ie.css +59 -0
  175. data/test/rails_root/public/stylesheets/blueprint/src/print.css +85 -0
  176. data/test/rails_root/public/stylesheets/blueprint/src/reset.css +38 -0
  177. data/test/rails_root/public/stylesheets/blueprint/src/typography.css +105 -0
  178. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
  179. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
  180. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_100_f0f0f0_1x400.png +0 -0
  181. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_50_99c2ff_1x400.png +0 -0
  182. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
  183. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_80_e6e6e6_1x400.png +0 -0
  184. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  185. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
  186. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-soft_100_e7eef3_1x100.png +0 -0
  187. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_222222_256x240.png +0 -0
  188. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
  189. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
  190. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
  191. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_888888_256x240.png +0 -0
  192. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_cd0a0a_256x240.png +0 -0
  193. data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
  194. data/test/rails_root/public/stylesheets/jquery/cupertino/jquery-ui-1.7.1.custom.css +404 -0
  195. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  196. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  197. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  198. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  199. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  200. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  201. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  202. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  203. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_217bc0_256x240.png +0 -0
  204. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
  205. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_469bdd_256x240.png +0 -0
  206. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
  207. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
  208. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
  209. data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
  210. data/test/rails_root/public/stylesheets/jquery/redmond/jquery-ui-1.7.1.custom.css +404 -0
  211. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  212. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  213. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  214. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  215. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
  216. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  217. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  218. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  219. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_222222_256x240.png +0 -0
  220. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
  221. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_454545_256x240.png +0 -0
  222. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_888888_256x240.png +0 -0
  223. data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
  224. data/test/rails_root/public/stylesheets/jquery/smoothness/jquery-ui-1.7.1.custom.css +404 -0
  225. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  226. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  227. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  228. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  229. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  230. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  231. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  232. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  233. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  234. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  235. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  236. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  237. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  238. data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  239. data/test/rails_root/public/stylesheets/jquery/ui-lightness/jquery-ui-1.7.1.custom.css +404 -0
  240. data/test/rails_root/public/stylesheets/reset.css +0 -0
  241. data/test/rails_root/public/stylesheets/styles.css +79 -0
  242. data/test/rails_root/public/stylesheets/themes/blue/styles.css +1 -0
  243. data/test/rails_root/public/stylesheets/themes/red/styles.css +1 -0
  244. data/test/rails_root/script/about +3 -0
  245. data/test/rails_root/script/breakpointer +3 -0
  246. data/test/rails_root/script/console +3 -0
  247. data/test/rails_root/script/create_project.rb +52 -0
  248. data/test/rails_root/script/cucumber +7 -0
  249. data/test/rails_root/script/dbconsole +3 -0
  250. data/test/rails_root/script/destroy +3 -0
  251. data/test/rails_root/script/generate +3 -0
  252. data/test/rails_root/script/performance/benchmarker +3 -0
  253. data/test/rails_root/script/performance/profiler +3 -0
  254. data/test/rails_root/script/performance/request +3 -0
  255. data/test/rails_root/script/plugin +3 -0
  256. data/test/rails_root/script/process/inspector +3 -0
  257. data/test/rails_root/script/process/reaper +3 -0
  258. data/test/rails_root/script/process/spawner +3 -0
  259. data/test/rails_root/script/runner +3 -0
  260. data/test/rails_root/script/server +3 -0
  261. data/test/rails_root/test/factories.rb +96 -0
  262. data/test/rails_root/test/functional/.keep +0 -0
  263. data/test/rails_root/test/functional/feeds_controller_test.rb +14 -0
  264. data/test/rails_root/test/integration/.keep +0 -0
  265. data/test/rails_root/test/mocks/development/.keep +0 -0
  266. data/test/rails_root/test/mocks/test/.keep +0 -0
  267. data/test/rails_root/test/shoulda_macros/controller.rb +45 -0
  268. data/test/rails_root/test/shoulda_macros/forms.rb +32 -0
  269. data/test/rails_root/test/shoulda_macros/models.rb +50 -0
  270. data/test/rails_root/test/shoulda_macros/pagination.rb +53 -0
  271. data/test/rails_root/test/shoulda_macros/plugins.rb +34 -0
  272. data/test/rails_root/test/test_helper.rb +46 -0
  273. data/test/rails_root/test/unit/.keep +0 -0
  274. data/test/rails_root/test/unit/entry_test.rb +13 -0
  275. data/test/rails_root/test/unit/feed_test.rb +16 -0
  276. data/test/rails_root/test/unit/tag_cloud_test.rb +35 -0
  277. data/test/rails_root/vendor/plugins/ssl_requirement/README +43 -0
  278. data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +62 -0
  279. data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +132 -0
  280. data/test/rails_root/vendor/plugins/validation_reflection/CHANGELOG +24 -0
  281. data/test/rails_root/vendor/plugins/validation_reflection/LICENSE +20 -0
  282. data/test/rails_root/vendor/plugins/validation_reflection/README +64 -0
  283. data/test/rails_root/vendor/plugins/validation_reflection/Rakefile +22 -0
  284. data/test/rails_root/vendor/plugins/validation_reflection/about.yml +7 -0
  285. data/test/rails_root/vendor/plugins/validation_reflection/init.rb +8 -0
  286. data/test/rails_root/vendor/plugins/validation_reflection/lib/boiler_plate/validation_reflection.rb +129 -0
  287. data/test/rails_root/vendor/plugins/validation_reflection/test/test_helper.rb +36 -0
  288. data/test/rails_root/vendor/plugins/validation_reflection/test/validation_reflection_test.rb +126 -0
  289. metadata +315 -7
  290. data/app/models/user.rb +0 -36
  291. data/test/recommender_test.rb +0 -8
  292. data/test/test_helper.rb +0 -20
data/Rakefile CHANGED
@@ -5,20 +5,39 @@ require 'rake/rdoctask'
5
5
  desc 'Default: run unit tests.'
6
6
  task :default => :test
7
7
 
8
- desc 'Translate this gem'
9
- task :translate do
10
- file = File.join(File.dirname(__FILE__), 'locales', 'en.yml')
11
- system("babelphish -o -y #{file}")
12
- end
8
+ desc 'Default: run unit tests.'
9
+ task :default => :test
13
10
 
14
- desc 'Test the recommender plugin.'
11
+ desc 'Test muck-raker.'
15
12
  Rake::TestTask.new(:test) do |t|
16
13
  t.libs << 'lib'
17
- t.libs << 'test'
18
- t.pattern = 'test/**/*_test.rb'
14
+ t.libs << 'test/rails_root/test'
15
+ t.pattern = 'test/rails_root/test/**/*_test.rb'
19
16
  t.verbose = true
20
17
  end
21
18
 
19
+ begin
20
+ require 'rcov/rcovtask'
21
+ Rcov::RcovTask.new do |t|
22
+ #t.libs << 'lib'
23
+ t.libs << 'test/rails_root/lib'
24
+ t.pattern = 'test/rails_root/test/**/*_test.rb'
25
+ t.verbose = true
26
+ t.output_dir = 'coverage'
27
+ t.rcov_opts << '--exclude "gems/*"'
28
+ end
29
+ rescue LoadError
30
+ task :rcov do
31
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
32
+ end
33
+ end
34
+
35
+ desc 'Translate this gem'
36
+ task :translate do
37
+ file = File.join(File.dirname(__FILE__), 'locales', 'en.yml')
38
+ system("babelphish -o -y #{file}")
39
+ end
40
+
22
41
  desc 'Generate documentation for the recommender plugin.'
23
42
  Rake::RDocTask.new(:rdoc) do |rdoc|
24
43
  rdoc.rdoc_dir = 'rdoc'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.13
1
+ 0.1.14
@@ -5,28 +5,29 @@ class Recommender::EntriesController < ApplicationController
5
5
  end
6
6
 
7
7
  def index
8
- @tag_cloud = TagCloud.language_tags(Language.locale_id) unless fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id})
9
- @refresh_results = true
8
+ @grain_size = params[:grain_size] || 'all'
9
+ @tag_cloud = TagCloud.language_tags(Language.locale_id, @grain_size) unless fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id})
10
10
  respond_to do |format|
11
11
  format.html { render :template => 'entries/index' }
12
12
  end
13
13
  end
14
14
 
15
15
  def browse_by_tags
16
- @refresh_results = true
17
16
  @tag_filter = params[:tags]
18
- @search = @tag_filter.join(' ') if (!@tag_filter.nil? && !@tag_filter.empty?)
19
- @tag_filter = @tag_filter.join('/')
20
- @tag_cloud = TagCloud.language_tags(Language.locale_id, @tag_filter) unless fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id, :filter => @tag_filter})
21
- _search(:and)
17
+ @grain_size = params[:grain_size] || 'all'
18
+ if !fragment_exist?({:controller => 'entries', :action => 'index', :language => Language.locale_id, :filter => @tag_filter, :grain_size => @grain_size})
19
+ @search = @tag_filter.split('/').join(' AND ') if !@tag_filter.empty?
20
+ @tag_cloud = TagCloud.language_tags(Language.locale_id, @grain_size, @tag_filter)
21
+ _search(:and)
22
+ end
22
23
  respond_to do |format|
23
24
  format.html { render :template => 'entries/browse_by_tags' }
24
25
  end
25
26
  end
26
27
 
27
28
  def search
28
- @refresh_results = true
29
29
  @search = params[:q]
30
+ @grain_size = params[:grain_size] || 'all'
30
31
  _search
31
32
  respond_to do |format|
32
33
  format.html { render :template => 'entries/search' }
@@ -76,11 +77,11 @@ class Recommender::EntriesController < ApplicationController
76
77
  @offset = @page*@per_page
77
78
  if !@search.nil?
78
79
  @term_list = URI.escape(@search)
79
- results = Entry.search(@search, I18n.locale.to_s, @per_page, @offset, operator)
80
+ results = Entry.search(@search, @grain_size, I18n.locale.to_s, @per_page, @offset, operator)
80
81
  @hit_count = results.total
81
82
  @results = results.results
82
83
  @paginated_results = @results.paginate(:page => @page+1, :per_page => @per_page, :total_entries => @hit_count)
83
- log_query(current_user.id, @tag_filter.nil? ? 'search' : 'browse', Language.locale_id, @search, @hit_count)
84
+ log_query(current_user.nil? ? request.remote_addr : current_user.id, Language.locale_id, @tag_filter.nil? ? 'search' : 'browse', @search, @grain_size, @hit_count)
84
85
  end
85
86
  end
86
87
 
@@ -88,7 +89,7 @@ class Recommender::EntriesController < ApplicationController
88
89
  @@query_logger ||= Logger.new("#{RAILS_ROOT}/log/queries_#{Date.today}.log")
89
90
  end
90
91
 
91
- def log_query(user_id, search_type, locale, query, hits)
92
- query_logger.info "#{Time.new.to_i},#{user_id},#{search_type},#{locale},\"#{query.gsub(/"/, '\\\\"')}\",#{hits}"
92
+ def log_query(user_id, locale, search_type, query, grain_size, hits)
93
+ query_logger.info "#{Time.new.to_i},#{user_id},#{locale},#{search_type},\"#{query.gsub(/"/, '\\\\"')}\",#{grain_size},#{hits}"
93
94
  end
94
95
  end
@@ -0,0 +1,64 @@
1
+ class Recommender::FeedsController < ApplicationController
2
+
3
+ def create
4
+ @feed = Feed.new(params[:feed])
5
+ @feed.harvested_from_display_uri = @feed.display_uri
6
+ @feed.entries_count = 0
7
+ @feed.last_requested_at = Time.now - 2592000
8
+ @feed.last_harvested_at = Time.now - 2592000
9
+
10
+ respond_to do |format|
11
+ if @feed.save
12
+ flash[:notice] = 'Feed was successfully created.'
13
+
14
+ # email the admin to let them know a feed has been added
15
+ # notification_feed_added(@feed)
16
+
17
+ # redirect to a page letting them know the feed has been created
18
+ #format.html { redirect_to entries_path(@feed) + "?new_feed=true" }
19
+ format.html { redirect_to "/feeds/" }
20
+ format.xml { head :created, :location => feed_url(@feed) }
21
+ else
22
+ format.html { render :action => "new" }
23
+ format.xml { render :xml => @feed.errors.to_xml }
24
+ end
25
+ end
26
+ end
27
+
28
+ # PUT /feeds/1
29
+ # PUT /feeds/1.xml
30
+ def update
31
+ @feed = Feed.find(params[:id])
32
+
33
+ # force a harvest now
34
+ # harvest_now
35
+
36
+ respond_to do |format|
37
+ if @feed.update_attributes(params[:feed])
38
+ # notification_feed_updated(@feed)
39
+ flash[:notice] = 'Feed was successfully updated.'
40
+ format.html {
41
+ redirect_to "/feeds/"
42
+ return
43
+ }
44
+ format.xml { head :ok }
45
+ else
46
+ format.html { render :action => "edit" }
47
+ format.xml { render :xml => @feed.errors.to_xml }
48
+ end
49
+ end
50
+ end
51
+
52
+ # DELETE /feeds/1
53
+ # DELETE /feeds/1.xml
54
+ def destroy
55
+ @feed = Feed.find(params[:id])
56
+ @feed.destroy
57
+
58
+ respond_to do |format|
59
+ format.html { redirect_to feeds_url }
60
+ format.xml { head :ok }
61
+ end
62
+ end
63
+
64
+ end
@@ -16,7 +16,7 @@ class Recommender::RecommendationsController < ApplicationController
16
16
 
17
17
  Entry.track_time_on_page(session, @uri)
18
18
  @document = Entry.recommender_entry(@uri)
19
- I18n.locale = @document.language[0..1] if !@document.nil?
19
+ # I18n.locale = @document.language[0..1] if !@document.nil?
20
20
 
21
21
  @limit = params[:limit] ? params[:limit].to_i : 5
22
22
  @limit = 25 if @limit > 25
@@ -0,0 +1,3 @@
1
+ module MuckRakerFeedsHelper
2
+
3
+ end
@@ -9,25 +9,47 @@ module MuckRakerHelper
9
9
  atags.each_slice(2){|tag,index| yield tag, classes[((index.to_i - min)*scale).to_i]}
10
10
  end
11
11
 
12
- def tag_link(tag, filter, css_class)
13
- link_to h(tag), "/resources/tags/#{filter.nil? ? '' : filter + '/'}#{tag}", :class => css_class
12
+ def tag_link(tag, css_class, grain_size)
13
+ link_to h(tag), "/resources/tags/#{tag}?grain_size=#{grain_size}", :class => css_class
14
+ end
15
+
16
+ def filtered_tag_link(tag, filter, css_class, grain_size)
17
+ link_to h(tag), "/resources/tags/#{filter}/#{tag}?grain_size=#{grain_size}", :class => css_class
14
18
  end
15
19
 
16
20
  def results_status
17
21
  if @tag_filter.nil?
18
- t('muck.raker.search_results_status',
22
+ if (@grain_size == 'course')
23
+ t('muck.raker.course_search_results',
24
+ :first => @offset+1,
25
+ :last => (@offset + @per_page) < @hit_count ? (@offset + @per_page) : @hit_count,
26
+ :total => @hit_count,
27
+ :filter => @tag_filter,
28
+ :terms => URI.unescape(@term_list))
29
+ else
30
+ t('muck.raker.resource_search_results',
19
31
  :first => @offset+1,
20
32
  :last => (@offset + @per_page) < @hit_count ? (@offset + @per_page) : @hit_count,
21
33
  :total => @hit_count,
22
34
  :filter => @tag_filter,
23
35
  :terms => URI.unescape(@term_list))
36
+ end
24
37
  else
25
- t('muck.raker.browse_results_status',
38
+ if (@grain_size == 'course')
39
+ t('muck.raker.course_tag_results',
26
40
  :first => @offset+1,
27
41
  :last => (@offset + @per_page) < @hit_count ? (@offset + @per_page) : @hit_count,
28
42
  :total => @hit_count,
29
43
  :filter => @tag_filter,
30
44
  :terms => @tag_filter.split('/').join('</b>, <b>'))
45
+ else
46
+ t('muck.raker.resource_tag_results',
47
+ :first => @offset+1,
48
+ :last => (@offset + @per_page) < @hit_count ? (@offset + @per_page) : @hit_count,
49
+ :total => @hit_count,
50
+ :filter => @tag_filter,
51
+ :terms => @tag_filter.split('/').join('</b>, <b>'))
52
+ end
31
53
  end
32
54
  end
33
55
 
@@ -53,4 +75,5 @@ module MuckRakerHelper
53
75
  def feed_query_uri(feed)
54
76
  "/search/results?terms=feed_id:" + feed.id.to_s + "&locale=en"
55
77
  end
78
+
56
79
  end
data/app/models/entry.rb CHANGED
@@ -5,14 +5,15 @@ class Entry < ActiveRecord::Base
5
5
 
6
6
  @@default_time_on_page = 60.0
7
7
 
8
- acts_as_solr({:if => false, :fields => [{:feed_id => :integer}]}, {:type_field => :type_s})
8
+ acts_as_solr({:if => false, :fields => [{:feed_id => :integer}, {:grain_size => :string}]}, {:type_field => :type_s})
9
9
 
10
10
  def self.top_tags(tags = nil)
11
11
 
12
12
  end
13
13
 
14
- def self.search(search_terms, language = "en", limit = 10, offset = 0, operator = :or)
15
- return find_by_solr(search_terms, :limit => limit, :offset => offset, :scores => true, :select => "entries.id, entries.title, entries.permalink, entries.direct_link, entries.published_at, entries.description, entries.feed_id, feeds.short_title AS collection", :joins => "INNER JOIN feeds ON feeds.id = entries.feed_id", :core => language, :operator => operator)
14
+ def self.search(search_terms, grain_size = nil, language = "en", limit = 10, offset = 0, operator = :or)
15
+ query = (!grain_size.nil? && grain_size != 'all') ? (search_terms + ") AND (grain_size:#{grain_size}") : search_terms
16
+ return find_by_solr(query, :limit => limit, :offset => offset, :scores => true, :select => "entries.id, entries.title, entries.permalink, entries.direct_link, entries.published_at, entries.description, entries.feed_id, feeds.short_title AS collection", :joins => "INNER JOIN feeds ON feeds.id = entries.feed_id", :core => language, :operator => operator)
16
17
  end
17
18
 
18
19
  def self.normalized_uri(uri)
@@ -26,7 +27,7 @@ class Entry < ActiveRecord::Base
26
27
  end
27
28
 
28
29
  def recommendations(limit = 20, order = "relevance", details = false, omit_feeds = nil)
29
- sql = "SELECT recommendations.id AS recommendation_id, dest_entry_id AS id, permalink, entries.title, relevance_calculated_at, relevance, clicks, avg_time_at_dest AS avg_time_on_target, direct_link, feeds.short_title AS collection "
30
+ sql = "SELECT recommendations.id, dest_entry_id, permalink, entries.title, relevance_calculated_at, relevance, clicks, avg_time_at_dest AS avg_time_on_target, direct_link, feeds.short_title AS collection "
30
31
  sql << ", entries.description, author, published_at " if details == true
31
32
  sql << "FROM recommendations "
32
33
  sql << "INNER JOIN entries ON recommendations.dest_entry_id = entries.id "
data/app/models/feed.rb CHANGED
@@ -6,6 +6,7 @@ class Feed < ActiveRecord::Base
6
6
  # format :xml
7
7
 
8
8
  has_many :entries
9
+ belongs_to :contributor, :class_name => 'User', :foreign_key => 'contributor_id'
9
10
 
10
11
  # named_scope :ready_to_harvest, lambda { |*args| { :conditions => [ "feeds.last_harvested_at < ?", args.first || 1.day.ago.end_of_day ] } }
11
12
 
@@ -1,8 +1,8 @@
1
1
  class TagCloud < ActiveRecord::Base
2
2
 
3
- def self.language_tags language_id = 38, filter = ''
4
- results = TagCloud.find(:all, :conditions => ["language_id = ? AND filter = ?", language_id, filter])
5
- results.empty? ? '' : results[0].tag_list
3
+ def self.language_tags language_id = 38, grain_size = 'all', filter = ''
4
+ cloud = TagCloud.find(:first, :conditions => ["language_id = ? AND grain_size = ? AND filter = ? ", language_id, grain_size, filter.sort.join('/')])
5
+ cloud.nil? ? '' : cloud.tag_list
6
6
  end
7
7
 
8
8
  end
@@ -2,7 +2,14 @@
2
2
  <div class="column span-24 align-right">
3
3
  <span>
4
4
  <%= results_status %>
5
- <%= ('&nbsp;&nbsp;' + link_to('[' + t('muck.raker.start_over') + ']', {:action => 'index'}) + '&nbsp;') unless @tag_filter.nil? %>
5
+ <%= ('&nbsp;&nbsp;' + link_to('[' + t('muck.raker.start_over') + ']', {:action => 'index', :grain_size => @grain_size}) + '&nbsp;') unless @tag_filter.nil? %>
6
+ &nbsp;&nbsp;
7
+ <% if @grain_size == 'course' %>
8
+ <%= link_to('[' + t('muck.raker.show_tagged_resources') + ']', {:grain_size => 'all'}) %>
9
+ <% else %>
10
+ <%= link_to('[' + t('muck.raker.show_tagged_courses') + ']', {:grain_size => 'course'}) %>
11
+ <% end %>
12
+ &nbsp;
6
13
  </span>
7
14
  </div>
8
15
  </div>
@@ -1,11 +1,11 @@
1
1
  <div id="tag-cloud">
2
2
  <fieldset>
3
- <legend><%= @tag_filter.nil? ? t('muck.raker.tag_cloud_legend') : t('muck.raker.narrow_further') %></legend>
3
+ <legend><%= @tag_filter.nil? ? (@grain_size == 'course' ? t('muck.raker.courses_tag_cloud_label') : t('muck.raker.resources_tag_cloud_label')) : t('muck.raker.narrow_further') %></legend>
4
4
  <% if @tag_cloud.blank? -%>
5
5
  <%= t('muck.raker.no_tags') %>
6
6
  <% else -%>
7
7
  <% tag_cloud @tag_cloud, %w(cloud1 cloud2 cloud3 cloud4 cloud5 cloud6) do |tag, css_class| %>
8
- <%= tag_link(tag, @tag_filter, css_class) %>
8
+ <%= tag_link(tag, @tag_filter, css_class, @grain_size) %>
9
9
  <% end %>
10
10
  <% end -%>
11
11
  </fieldset>
@@ -9,6 +9,6 @@
9
9
  <%= render(:partial => 'entries/tag_cloud') %>
10
10
  </div>
11
11
  <% else %>
12
- <p><%= t('muck.raker.no_hits') %></p>
12
+ <p><%= @grain_size == 'all' ? t('muck.raker.no_tagged_resources', :tags => @search) : t('muck.raker.no_tagged_courses', :tags => @tag_filter.split('/').join(', ')) %></p>
13
13
  <% end %>
14
14
  </div>
@@ -3,13 +3,13 @@
3
3
  <table border="1" cellpadding="3px">
4
4
  <tr>
5
5
  <th>Related Resources <span style="color:#888;font-weight:normal;">(<%= t('muck.raker.calculated') %> <%= @entry.relevance_calculated_at.strftime("%d %b %Y") %>)</span></th>
6
- <th>Relevance</th>
7
- <th>Clicks</th>
8
- <th>Avg Time<br/>(seconds)</th>
6
+ <th class="centered">Relevance</th>
7
+ <th class="centered">Clicks</th>
8
+ <th class="centered">Avg Time<br/>(seconds)</th>
9
9
  </tr>
10
10
  <% @entry.ranked_recommendations(@limit, params[:order] || "relevance").each do |r| %>
11
11
  <tr>
12
- <td><%= link_to r["title"] + " (" + r["collection"] + ")", "/r?id=" + r["recommendation_id"].to_s %></td>
12
+ <td><%= link_to r["title"] + " (" + r["collection"] + ")", "/r?id=" + r["id"].to_s %></td>
13
13
  <td class="centered"><%= round(r["relevance"]) %></td>
14
14
  <td class="centered"><%= r["clicks"] %></td>
15
15
  <td class="centered"><%= r["avg_time_on_target"] %></td>
@@ -4,6 +4,6 @@
4
4
  <%= render(:partial => 'entries/results') %>
5
5
  <div class="results-nav"><%= will_paginate(@paginated_results, :next_label => '<b>' + t('muck.raker.next_label') + ' &raquo;</b>', :previous_label => '<b>&laquo; ' + t('muck.raker.previous_label') + '</b>') %></div>
6
6
  <% else %>
7
- <p><%= t('muck.raker.no_hits') %></p>
7
+ <p><%= t('muck.raker.no_hits', :search => @search, :resource_type => @grain_size == 'all' ? 'resources' : 'courses') %></p>
8
8
  <% end %>
9
9
  </div>
@@ -5,17 +5,19 @@ if @document.nil?
5
5
  else
6
6
 
7
7
  @recommendations = @document.ranked_recommendations(@limit, params[:order] || "mixed", @details)
8
- xml.recommendations(:document_id => @document.nil? ? "" : @document.id, :uri => @uri, :title => t(:gm_title), :more_prompt => t(:gm_more_prompt), :direct_link_text => t(:direct_link), :locale => @document.language) do
8
+ #xml.recommendations(:document_id => @document.nil? ? "" : @document.id, :uri => @uri, :title => t(:gm_title), :more_prompt => t(:gm_more_prompt), :direct_link_text => t(:direct_link), :locale => @document.language) do
9
+ xml.recommendations(:document_id => @document.nil? ? "" : @document.id, :uri => @uri, :title => t("muck.raker.gm_title"), :more_prompt => t("muck.raker.gm_more_prompt"), :direct_link_text => t("muck.raker.direct_link")) do
9
10
  @recommendations.each do |recommendation|
10
11
  xml.recommendation do
11
12
  xml.title recommendation["title"]
12
13
  xml.collection recommendation["collection"]
13
- xml.link "http://www.oerrecommender.org/r?id=" + recommendation["id"].to_s
14
+ xml.link "http://www.folksemantic.com/r?id=" + recommendation["recommendation_id"].to_s
14
15
  # xml.link "http://localhost:3000/r?id=" + recommendation["id"].to_s
15
16
  xml.has_direct_link "true" if (recommendation["direct_link"] != nil and @uri[0..20] == recommendation["uri"][0..20])
16
17
 
17
18
  if @details == true
18
- xml.direct_link "http://www.oerrecommender.org/r?id=" + recommendation["id"].to_s + "&u=" + recommendation["direct_link"] if recommendation["direct_link"] != nil
19
+ xml.direct_link "http://www.folksemantic.com/r?id=" + recommendation["recommendation_id"].to_s + "&u=" + recommendation["direct_link"] if recommendation["direct_link"] != nil
20
+ # xml.direct_link "http://localhost:3000/r?id=" + recommendation["recommendation_id"].to_s + "&u=" + recommendation["direct_link"] if recommendation["direct_link"] != nil
19
21
  xml.uri recommendation["uri"]
20
22
  xml.direct_uri recommendation["direct_link"]
21
23
  xml.description recommendation["description"]
@@ -16,6 +16,7 @@ ActionController::Routing::Routes.draw do |map|
16
16
  map.connect 'r', :controller => 'recommender/entries', :action => 'track_clicks'
17
17
  map.connect 'collections', :controller => 'entries', :action => 'collections'
18
18
 
19
+ map.resources :feeds, :controller => 'recommender/feeds'
19
20
  map.resources :recommendations, :controller => 'recommender/recommendations'
20
21
 
21
22
  # redirect (and hit tracking)
@@ -0,0 +1,9 @@
1
+ class ChangeTagCloudGrainSizes < ActiveRecord::Migration
2
+ def self.up
3
+ execute "update tag_clouds set grain_size = 'all' where grain_size = 'unknown'"
4
+ end
5
+
6
+ def self.down
7
+ execute "update tag_clouds set grain_size = 'unknown' where grain_size = 'all'"
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddContributorToFeeds < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :feeds, :contributor_id, :integer
4
+ end
5
+
6
+ def self.down
7
+ remove_column :feeds, :contributor_id
8
+ end
9
+ end
@@ -0,0 +1,17 @@
1
+ class NormalizeEntriesSubjects < ActiveRecord::Migration
2
+ def self.up
3
+ execute "ALTER TABLE entries_subjects DROP PRIMARY KEY, ADD PRIMARY KEY USING BTREE(subject_id, entry_id);"
4
+ remove_column :entries_subjects, :language_id
5
+ remove_column :entries_subjects, :grain_size
6
+ execute "delete from entries_subjects where entry_id IN (select entries.id from entries inner join feeds ON feeds.id = entries.feed_id where feeds.uri = 'http://ndr.nsdl.org/oai?verb=ListRecords&metadataPrefix=nsdl_dc&set=439869');"
7
+ end
8
+
9
+ def self.down
10
+ add_column :entries_subjects, :language_id, :integer
11
+ add_column :entries_subjects, :grain_size, :string
12
+ add_index "entries_subjects", ["language_id"]
13
+ add_index "entries_subjects", ["grain_size"]
14
+ execute "ALTER TABLE entries_subjects DROP PRIMARY KEY, ADD PRIMARY KEY USING BTREE(subject_id, language_id, grain_size, entry_id);"
15
+ execute "UPDATE entries_subjects AS es INNER JOIN entries AS e ON e.id = es.entry_id SET es.language_id = e.language_id, es.grain_size = e.grain_size"
16
+ end
17
+ end
@@ -184,7 +184,27 @@ module MuckRaker
184
184
  end
185
185
  end
186
186
 
187
- desc "Recommend without harvesting"
187
+ desc "Rebuild entry recommendation caches"
188
+ task :rebuild_recommendation_cache => :environment do
189
+ require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
190
+ separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
191
+ puts "RAILS_ENV=" + ENV['RAILS_ENV']
192
+ Dir.chdir(File.join(File.dirname(__FILE__), '../../', 'raker', 'lib')) do
193
+ jars = Dir['*.jar'].join(separator)
194
+ options = "-Dsolr.solr.home=\"#{SOLR_CONFIG_PATH}\" -Dsolr.data.dir=\"#{SOLR_DATA_PATH}\" -DRAILS_ENV=#{ENV['RAILS_ENV']} -DRAILS_DB_CONFIG=\"#{RAILS_DB_CONFIG}\" -DLOG_FILE_PREFIX=\"#{LOG_FILE_PREFIX}\" "
195
+ options << "-DDEBUG=true " unless ENV['DEBUG'] == 'false'
196
+ options << "-DLOG_TO_CONSOLE=true " unless ENV['DEBUG'] == 'false'
197
+ options << "-DFEED_ARCHIVE_PATH=\"#{FEED_ARCHIVE_PATH}\" "
198
+ classpath = "-classpath #{jars}#{separator}. "
199
+ javaclass = "edu.usu.cosl.recommender.Recommender "
200
+ cmdlineoption = "rebuild_cache "
201
+ cmd = "java " + options + classpath + javaclass + cmdlineoption
202
+ puts ("Executing: " + cmd) if ENV['DEBUG']
203
+ exec cmd
204
+ end
205
+ end
206
+
207
+ desc "Redo everything (re-index, redo autogenerated subjects, rebuild tag clouds re-recommend)"
188
208
  task :rebuild => :environment do
189
209
  require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
190
210
  separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
@@ -217,8 +237,6 @@ module MuckRaker
217
237
  end
218
238
 
219
239
  end
220
-
221
-
222
240
 
223
241
  end
224
242
  end
data/locales/en.yml CHANGED
@@ -11,7 +11,9 @@ en:
11
11
  collections_long: Indexed Collections
12
12
  developers_long: Information for Developers
13
13
  powered_by: powered by
14
- no_hits: No hits. Please try a different search or choose a different language.
14
+ no_hits: Your search - <b>{{search}}</b> - did not match any <b>{{resource_type}}</b>. Please try a different search or choose a different language.
15
+ no_tagged_courses: No <b>courses</b> were found tagged with <b>{{tags}}</b>. <a href='/resources'>Start over</a> or show <a href='/resources/tags/{{tags}}'>all resources tagged {{tags}}</a>.
16
+ no_tagged_resources: No <b>resources</b> were found tagged with <b>{{tags}}</b>. <a href='/resources'>Start over</a>.
15
17
  previous: Previous
16
18
  next: Next
17
19
  results: Results
@@ -40,12 +42,17 @@ en:
40
42
  search_link: Find Resources!
41
43
  search_description: Find learning resources by <span class="highlight">searching</span> and <span class="highlight">browsing</span> over <span class="highlight">110,000</span> open educational resources.
42
44
  welcome_user: "Welcome {{user}}"
43
- tag_cloud_legend: browse resources using tags
45
+ resources_tag_cloud_label: browse resources using tags <a href="/resources?grain_size=course">[browse only courses]</a>
46
+ courses_tag_cloud_label: browse courses using tags <a href="/resources">[browse all resources]</a>
44
47
  narrow_further: narrow results further
48
+ show_tagged_courses: show only courses
49
+ show_tagged_resources: show any kind of resource
45
50
  tags: tags
46
51
  start_over: start over
47
- browse_results_status: Results <b>{{first}} - {{last}}</b> of <b>{{total}}</b> for tags <b>{{terms}}</b>
48
- search_results_status: Results <b>{{first}} - {{last}}</b> of <b>{{total}}</b> for <b>{{terms}}</b>
52
+ course_tag_results: Courses <b>{{first}} - {{last}}</b> of <b>{{total}}</b> tagged <b>{{terms}}</b>
53
+ resource_tag_results: Resources <b>{{first}} - {{last}}</b> of <b>{{total}}</b> tagged <b>{{terms}}</b>
54
+ course_search_results: Courses <b>{{first}} - {{last}}</b> of <b>{{total}}</b> for search <b>{{terms}}</b>
55
+ resource_search_results: Resources <b>{{first}} - {{last}}</b> of <b>{{total}}</b> for search <b>{{terms}}</b>
49
56
  next_label: Next
50
57
  previous_label: Previous
51
58
  all_resources: All Resources