lib/tasks/n4j.rake in n4j-0.0.1.2 vs lib/tasks/n4j.rake in n4j-0.0.1.3

- old
+ new

@@ -54,33 +54,35 @@ libexec = Pathname.new(neo4j_bin_link).realpath.dirname.dirname libdir = "#{libexec}/lib" syslib = "#{libexec}/system/lib" plugin_dir = "#{libexec}/plugins" - n4j_plugins = 'neo4j_plugins' + n4j_plugins = File.expand_path(File.dirname(__FILE__) + '../../../neo4j_plugins') neo4j_home = "tmp/n4j/#{@environment}" pid_file = "tmp/pids/n4j_#{@environment}_pid" - + + gem_templates = File.expand_path(File.dirname(__FILE__) + '../../../templates') + FileUtils.mkdir_p neo4j_home FileUtils.mkdir_p "#{neo4j_home}/data/log" FileUtils.mkdir_p 'tmp/pids' class_path = [libdir, syslib, plugin_dir, n4j_plugins].collect {|dir| Dir.glob(dir + '/*.jar')}.flatten.join(':') java_opts = "-server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties=conf/neo4j-server.properties -Djava.util.logging.config.file=conf/logging.properties -Xms3m -Xmx64m" # system "cp lib/n4j/templates/neo4j.properties tmp/n4j/#{@environment}/" # system "cp lib/n4j/templates/logging.properties tmp/n4j/#{@environment}/" - FileUtils.cp 'templates/neo4j.properties', "tmp/n4j/#{@environment}/neo4j.properties" - FileUtils.cp 'templates/logging.properties', "tmp/n4j/#{@environment}/logging.properties" + FileUtils.cp "#{gem_templates}/neo4j.properties", "tmp/n4j/#{@environment}/neo4j.properties" + FileUtils.cp "#{gem_templates}/logging.properties", "tmp/n4j/#{@environment}/logging.properties" FileUtils.touch "#{neo4j_home}/data/log/console.log" - neo4j_server_properties = ERB.new(IO.read("templates/neo4j-server-#{@server_version}.properties")).result + neo4j_server_properties = ERB.new(IO.read("#{gem_templates}/neo4j-server-#{@server_version}.properties")).result neo4j_server_properties_path = "#{neo4j_home}/neo4j-server.properties" File.open(neo4j_server_properties_path, 'w') {|f| f.write(neo4j_server_properties) } - neo4j_wrapper_conf = ERB.new(IO.read('templates/neo4j-wrapper.conf')).result + neo4j_wrapper_conf = ERB.new(IO.read("#{gem_templates}/neo4j-wrapper.conf")).result neo4j_wrapper_conf_path = "#{neo4j_home}/neo4j-wrapper.conf" File.open(neo4j_wrapper_conf_path, 'w') {|f| f.write(neo4j_wrapper_conf) } launch_neo4j_command = "#{java_command} -cp #{class_path} @@ -118,9 +120,6 @@ puts "#{environment.capitalize} Neo4j wasn't running." end end end end - - - end \ No newline at end of file