Sha256: 30b6bc263d4c88fbd7c0e36cf8ae06acbca27699b454583cd7e7a5127b7d1609

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

require "bundler/gem_tasks"

def source_file
  gz_file = Dir.new('tmp').entries.find { |x| x =~ /gz$/ }
  File.expand_path("./tmp/#{gz_file}")
end

def unpack_lib_dir
  gz_file = Dir.new('tmp').entries.find { |x| x =~ /gz$/ }
  dir = gz_file.gsub('-unix.tar.gz', '')
  File.expand_path("./tmp/#{dir}/lib")
end

def jar_files_to_copy
  Dir.new(unpack_lib_dir).entries.find_all {|x| x =~ /\.jar/}
end

desc "Delete old Jar files"
task :delete_old_jar do
  root = File.expand_path("./lib/neo4j-community/jars")
  files = Dir.new(root).entries.find_all{|f| f =~ /\.jar/}
  files.each do |file|
    system "rm #{root}/#{file}"
  end
end

desc "Upgrade using downloaded ...tar.gz file in ./tmp"
task :upgrade => [:delete_old_jar] do
  system "cd tmp; tar xf #{source_file}"
  jars = File.expand_path("./lib/neo4j-community/jars")
  test_jars = File.expand_path("./lib/neo4j-community/test-jars")
  jar_files_to_copy.each {|f| system "cp #{unpack_lib_dir}/#{f} #{jars}" unless f =~ /tests/}
  jar_files_to_copy.each {|f| system "cp #{unpack_lib_dir}/#{f} #{test_jars}" if f =~ /tests/}
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
neo4j-community-1.7.1-java Rakefile
neo4j-community-1.7.0-java Rakefile
neo4j-community-1.7.M02-java Rakefile
neo4j-community-1.7.0.alpha.1-java Rakefile
neo4j-community-1.6.1.alpha.1-java Rakefile
neo4j-community-1.6.0.alpha.9-java Rakefile