Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make classpath setup compatible with the Ant tasks

  • Loading branch information...
commit c851ce21fbe65c0c5a8c48c94da728874b02235c 1 parent 260bbca
@iconara authored
Showing with 8 additions and 4 deletions.
  1. +1 −1  .gitignore
  2. +2 −3 Rakefile
  3. +5 −0 spec/hadoop_setup.rb
View
2  .gitignore
@@ -4,4 +4,4 @@
/pkg
/doc
/.yardoc
-/spec/hadoop_setup.rb
+/.classpath
View
5 Rakefile
@@ -66,14 +66,13 @@ namespace :setup do
end
task :classpath do
- File.open('spec/hadoop_setup.rb', 'w') do |io|
+ File.open('.classpath', 'w') do |io|
hadoop_home = File.expand_path(Dir["tmp/hadoop*"].first)
%x(#{hadoop_home}/bin/hadoop classpath).chomp.split(':').each do |pattern|
Dir[pattern].each do |path|
- io.puts("$CLASSPATH << '#{File.expand_path(path)}'")
+ io.puts(path)
end
end
- io.puts("HADOOP_HOME = '#{hadoop_home}'")
end
end
end
View
5 spec/hadoop_setup.rb
@@ -0,0 +1,5 @@
+HADOOP_HOME = Dir[File.expand_path("../../tmp/hadoop*", __FILE__)].first
+
+File.readlines(File.expand_path('../../.classpath', __FILE__)).each do |pattern|
+ $CLASSPATH << pattern.chomp
+end
Please sign in to comment.
Something went wrong with that request. Please try again.