jruby-on-hadoop 0.0.4 → 0.0.5

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.0.4
1
+ 0.0.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jruby-on-hadoop}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Koichi Fujikawa"]
Binary file
@@ -8,9 +8,8 @@ module JRubyOnHadoop
8
8
  @args = args
9
9
  parse_args
10
10
 
11
- # env check
12
- hadoop_home and hadoop_cmd
13
- ENV['HADOOP_CLASSPATH'] = "#{lib_path}:#{File.dirname(@script_path)}"
11
+ # env get / set and check
12
+ hadoop_home and hadoop_cmd and hadoop_classpath
14
13
  end
15
14
 
16
15
  def hadoop_home
@@ -26,6 +25,11 @@ module JRubyOnHadoop
26
25
  hadoop.chomp
27
26
  end
28
27
 
28
+ def hadoop_classpath
29
+ ENV['HADOOP_CLASSPATH'] =
30
+ ([lib_path, File.dirname(@script_path)] + jruby_jars).join(':')
31
+ end
32
+
29
33
  def run
30
34
  exec cmd
31
35
  end
@@ -50,21 +54,13 @@ module JRubyOnHadoop
50
54
  args
51
55
  end
52
56
 
53
- def opt_libjars
54
- # jruby jars
55
- [JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path].join(',')
56
- end
57
-
58
- def opt_files
59
- @files.join(',')
57
+ def jruby_jars
58
+ [JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path]
60
59
  end
61
60
 
62
- def main_jar_path
63
- JRubyOnHadoop.jar_path
64
- end
65
-
66
- def lib_path
67
- JRubyOnHadoop.lib_path
68
- end
61
+ def opt_libjars; jruby_jars.join(',') end
62
+ def opt_files; @files.join(',') end
63
+ def main_jar_path; JRubyOnHadoop.jar_path end
64
+ def lib_path; JRubyOnHadoop.lib_path end
69
65
  end
70
66
  end
@@ -76,4 +76,10 @@ describe JRubyOnHadoop::Client do
76
76
  ENV['HADOOP_HOME'] = saved_home
77
77
  end
78
78
  end
79
+
80
+ it 'set HADOOP_CLASSPATH env var' do
81
+ client = JRubyOnHadoop::Client.new
82
+ client.hadoop_classpath.should match JRubyJars.core_jar_path
83
+ client.hadoop_classpath.should match JRubyJars.stdlib_jar_path
84
+ end
79
85
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-on-hadoop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Fujikawa