muck-raker 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.38
1
+ 0.1.39
@@ -22,7 +22,7 @@ class Muck::RecommendationsController < ApplicationController
22
22
  params[:more_link] = true
23
23
  end
24
24
 
25
- Entry.track_time_on_page(session, @uri)
25
+ # Entry.track_time_on_page(session, @uri)
26
26
  @entry = Entry.recommender_entry(@uri)
27
27
  # I18n.locale = @entry.language[0..1] if !@entry.nil?
28
28
 
@@ -40,11 +40,11 @@ class Muck::RecommendationsController < ApplicationController
40
40
  end
41
41
  end
42
42
  format.xml {
43
- render(:template => @entry.id.nil? && real_time == true ? '/recommendations/index_real_time.xml.builder' : '/recommendations/index.xml.builder', :layout => false)
43
+ render(:template => @entry.id.nil? && @real_time == true ? '/recommendations/index_real_time.xml.builder' : '/recommendations/index.xml.builder', :layout => false)
44
44
  }
45
45
  format.pjs {
46
46
  @host = "http://#{URI.parse(@uri).host}"
47
- render(:template => @entry.id.nil? && real_time == true ? 'recommendations/index_real_time.pjs.erb' : 'recommendations/index.pjs.erb', :layout => false)
47
+ render(:template => @entry.id.nil? && @real_time == true ? 'recommendations/index_real_time.pjs.erb' : 'recommendations/index.pjs.erb', :layout => false)
48
48
  }
49
49
  format.rss {
50
50
  render(:template => 'recommendations/index.rss.builder', :layout => false)
@@ -7,7 +7,7 @@ class Muck::VisitsController < ApplicationController
7
7
  def show
8
8
  @entry = Entry.find(params[:id])
9
9
  @page_title = @entry.title
10
- @resource_uri = @entry.resource_uri + (@entry.resource_uri.include?('?') ? "&" : "?") + "show_recs=true";
10
+ @resource_uri = @entry.resource_uri
11
11
  @share = Share.new(:title => @entry.title, :uri => @resource_uri, :entry_id => @entry.id) if GlobalConfig.enable_raker_shares
12
12
 
13
13
  if GlobalConfig.enable_raker_comments
data/app/models/entry.rb CHANGED
@@ -177,13 +177,13 @@ class Entry < ActiveRecord::Base
177
177
  end
178
178
 
179
179
  def ranked_recommendations(limit = 5, order = "mixed", details = false, omit_feeds = nil)
180
- if self.id.nil?
181
- return Entry.real_time_recommendations(self.permalink, details, :core => 'en', :limit => limit)
182
- else
180
+ # if self.id.nil?
181
+ # return Entry.real_time_recommendations(self.permalink, details, :core => 'en', :limit => limit)
182
+ # else
183
183
  return relevant_recommendations(limit, "clicks DESC, relevance", details, omit_feeds) if order == "clicks"
184
184
  return relevant_recommendations(limit, "relevance", details, omit_feeds) if (order == "relevance" || details == true)
185
185
  return relevant_recommendations_filtered(limit, details, omit_feeds) if omit_feeds != nil
186
- end
186
+ # end
187
187
 
188
188
  recs = []
189
189
  if self.popular != nil && !self.popular.empty?
@@ -225,6 +225,25 @@ module MuckRaker
225
225
  end
226
226
  end
227
227
 
228
+ desc "Redo recommendations only"
229
+ task :redo_recommendations => :environment do
230
+ require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
231
+ separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
232
+ puts "RAILS_ENV=" + ENV['RAILS_ENV']
233
+ Dir.chdir(File.join(File.dirname(__FILE__), '../../', 'raker', 'lib')) do
234
+ jars = Dir['*.jar'].join(separator)
235
+ 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}\" "
236
+ options << "-DDEBUG=true " unless ENV['DEBUG'] == 'false'
237
+ options << "-DLOG_TO_CONSOLE=true " unless ENV['DEBUG'] == 'false'
238
+ options << "-DFEED_ARCHIVE_PATH=\"#{FEED_ARCHIVE_PATH}\" "
239
+ classpath = "-classpath #{jars}#{separator}. "
240
+ javaclass = "edu.usu.cosl.recommender.Recommender "
241
+ cmd = "java " + options + classpath + javaclass
242
+ puts ("Executing: " + cmd) if ENV['DEBUG']
243
+ exec cmd
244
+ end
245
+ end
246
+
228
247
  desc "Redo everything (re-index, redo autogenerated subjects, rebuild tag clouds re-recommend)"
229
248
  task :rebuild => :environment do
230
249
  require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
data/muck-raker.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-raker}
8
- s.version = "0.1.38"
8
+ s.version = "0.1.39"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Joel Duffin Justin Ball"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-raker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.38
4
+ version: 0.1.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Duffin Justin Ball