muck-raker 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -1,4 +1,4 @@
1
- ENV['RAILS_ENV'] = (ENV['RAILS_ENV'] || 'development').dup
1
+ ENV['RAILS_ENV'] = (ENV['RAILS_ENV'] || 'development').dup
2
2
  dir = File.dirname(__FILE__)
3
3
  SOLR_PATH = File.expand_path("#{dir}/../solr") unless defined? SOLR_PATH
4
4
 
@@ -16,12 +16,16 @@ unless defined? SOLR_CONFIG_PATH
16
16
  end
17
17
 
18
18
  unless defined? RAILS_DB_CONFIG
19
- RAILS_DB_CONFIG = File.join(RAILS_ROOT, 'config', 'database.yml')
19
+ if ENV['RAILS_ENV'] == 'production'
20
+ RAILS_DB_CONFIG = File.join(RAILS_ROOT, '..', '..', 'shared', 'config', 'database.yml')
21
+ else
22
+ RAILS_DB_CONFIG = File.join(RAILS_ROOT, 'config', 'database.yml')
23
+ end
20
24
  end
21
25
  unless defined? FEED_ARCHIVE_PATH
22
- if ENV['RAILS_ENV'] = 'production'
26
+ if ENV['RAILS_ENV'] == 'production'
23
27
  FEED_ARCHIVE_PATH = File.join(RAILS_ROOT, '..', '..', 'shared', 'feed_archive')
24
- elsif ENV['RAILS_ENV'] = 'development'
28
+ elsif ENV['RAILS_ENV'] == 'development'
25
29
  FEED_ARCHIVE_PATH = File.join(RAILS_ROOT, '..', 'feed_archive')
26
30
  else
27
31
  FEED_ARCHIVE_PATH = File.join(RAILS_ROOT, '..', 'feed_archive')
@@ -69,36 +69,38 @@ module MuckRaker
69
69
  system "rsync -ruv #{path}/config/solr ./config"
70
70
  end
71
71
 
72
- desc "Start the recommender daemon process"
73
- task :start => :environment do
72
+ desc "Harvest without recommending"
73
+ task :harvest => :environment do
74
74
  require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
75
75
  separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
76
+ puts "RAILS_ENV=" + ENV['RAILS_ENV']
76
77
  Dir.chdir(File.join(File.dirname(__FILE__), '../../', 'raker', 'lib')) do
77
78
  jars = Dir['*.jar'].join(separator)
78
- options = "-Dsolr.solr.home=\"#{SOLR_CONFIG_PATH}\" -Dsolr.data.dir=\"#{SOLR_DATA_PATH}\" -DRAILS_DB_CONFIG=\"#{RAILS_DB_CONFIG}\" -DLOG_FILE_PREFIX=\"#{LOG_FILE_PREFIX}\" "
79
- options << "-DDEBUG " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
80
- options << "-DLOG_TO_CONSOLE " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
79
+ 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}\" "
80
+ options << "-DDEBUG=true " unless ENV['DEBUG'] == 'false'
81
+ options << "-DLOG_TO_CONSOLE=true " unless ENV['DEBUG'] == 'false'
81
82
  options << "-DFEED_ARCHIVE_PATH=\"#{FEED_ARCHIVE_PATH}\" "
82
83
  classpath = "-classpath #{jars}#{separator}. "
83
- javaclass = "edu.usu.cosl.recommenderd.Recommender"
84
+ javaclass = "edu.usu.cosl.aggregatord.Harvester"
84
85
  cmd = "java " + options + classpath + javaclass
85
86
  puts ("Executing: " + cmd) if ENV['DEBUG']
86
87
  exec cmd
87
88
  end
88
89
  end
89
90
 
90
- desc "Harvest without recommending"
91
- task :harvest => :environment do
91
+ desc "Start the recommender daemon process"
92
+ task :start => :environment do
92
93
  require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
93
94
  separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
95
+ puts "RAILS_ENV=" + ENV['RAILS_ENV']
94
96
  Dir.chdir(File.join(File.dirname(__FILE__), '../../', 'raker', 'lib')) do
95
97
  jars = Dir['*.jar'].join(separator)
96
- options = "-Dsolr.solr.home=\"#{SOLR_CONFIG_PATH}\" -Dsolr.data.dir=\"#{SOLR_DATA_PATH}\" -DRAILS_DB_CONFIG=\"#{RAILS_DB_CONFIG}\" -DLOG_FILE_PREFIX=\"#{LOG_FILE_PREFIX}\" "
97
- options << "-DDEBUG " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
98
- options << "-DLOG_TO_CONSOLE " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
98
+ 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}\" "
99
+ options << "-DDEBUG=true " unless ENV['DEBUG'] == 'false'
100
+ options << "-DLOG_TO_CONSOLE=true " unless ENV['DEBUG'] == 'false'
99
101
  options << "-DFEED_ARCHIVE_PATH=\"#{FEED_ARCHIVE_PATH}\" "
100
102
  classpath = "-classpath #{jars}#{separator}. "
101
- javaclass = "edu.usu.cosl.aggregatord.Harvester"
103
+ javaclass = "edu.usu.cosl.recommenderd.Recommenderd"
102
104
  cmd = "java " + options + classpath + javaclass
103
105
  puts ("Executing: " + cmd) if ENV['DEBUG']
104
106
  exec cmd
@@ -109,14 +111,15 @@ module MuckRaker
109
111
  task :recommend => :environment do
110
112
  require File.expand_path("#{File.dirname(__FILE__)}/../../config/muck_raker_environment")
111
113
  separator = (RUBY_PLATFORM =~ /(win|w)32$/ ? ';' : ':')
114
+ puts "RAILS_ENV=" + ENV['RAILS_ENV']
112
115
  Dir.chdir(File.join(File.dirname(__FILE__), '../../', 'raker', 'lib')) do
113
116
  jars = Dir['*.jar'].join(separator)
114
- options = "-Dsolr.solr.home=\"#{SOLR_CONFIG_PATH}\" -Dsolr.data.dir=\"#{SOLR_DATA_PATH}\" -DRAILS_DB_CONFIG=\"#{RAILS_DB_CONFIG}\" -DLOG_FILE_PREFIX=\"#{LOG_FILE_PREFIX}\" "
115
- options << "-DDEBUG " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
116
- options << "-DLOG_TO_CONSOLE " unless (RAILS_ENV == "production" && !ENV['DEBUG'])
117
+ 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}\" "
118
+ options << "-DDEBUG=true " unless ENV['DEBUG'] == 'false'
119
+ options << "-DLOG_TO_CONSOLE=true " unless ENV['DEBUG'] == 'false'
117
120
  options << "-DFEED_ARCHIVE_PATH=\"#{FEED_ARCHIVE_PATH}\" "
118
121
  classpath = "-classpath #{jars}#{separator}. "
119
- javaclass = "edu.usu.cosl.recommenderd.Recommender "
122
+ javaclass = "edu.usu.cosl.recommenderd.Recommenderd "
120
123
  cmdlineoption = "skip_harvest "
121
124
  cmd = "java " + options + classpath + javaclass + cmdlineoption
122
125
  puts ("Executing: " + cmd) if ENV['DEBUG']
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{muck-raker}
5
- s.version = "0.1.7"
5
+ s.version = "0.1.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Joel Duffin Justin Ball"]
Binary file
Binary file
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.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Duffin Justin Ball