pangolin 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -2,6 +2,11 @@ require 'java'
2
2
 
3
3
 
4
4
  module Pangolin
5
+
6
+ TOOLS_PATHS = [
7
+ File.join(ENV['JAVA_HOME'], '..', 'lib', 'tools.jar'),
8
+ File.join(ENV['JAVA_HOME'], 'lib', 'tools.jar')
9
+ ]
5
10
 
6
11
  # must use include_class instead of import because import interferes with Rake's import
7
12
  include_class 'java.io.PrintWriter'
@@ -112,7 +117,27 @@ module Pangolin
112
117
  end
113
118
 
114
119
  def execute_compiler(output_writer)
115
- com.sun.tools.javac.Main.compile(command_args.to_java(java.lang.String), PrintWriter.new(output_writer))
120
+ compiler.compile(command_args.to_java(java.lang.String), PrintWriter.new(output_writer))
121
+ end
122
+
123
+ def compiler
124
+ begin
125
+ return com.sun.tools.javac.Main
126
+ rescue NameError
127
+ TOOLS_PATHS.each do |path|
128
+ if File.exists? path
129
+ require path
130
+
131
+ begin
132
+ return com.sun.tools.javac.Main
133
+ rescue NameError
134
+ # ignore and try next
135
+ end
136
+ end
137
+ end
138
+ end
139
+
140
+ raise 'Could not find com.sun.tools.javac.Main, perhaps tools.jar isn\'t in the class path?'
116
141
  end
117
142
 
118
143
  def formatted_path(items)
@@ -4,12 +4,12 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{java_tools}
8
- s.version = "0.2.2"
7
+ s.name = %q{pangolin}
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Theo Hultberg"]
12
- s.date = %q{2009-10-08}
12
+ s.date = %q{2009-10-29}
13
13
  s.description = %q{Ant is a nice tool for writing Java build scripts, but Rake is nicer. The only thing missing from Rake is a way to run javac and jar, and although it's easy to run these as shell scripts you have to wait for the JVM to start. In combination with JRuby this gem lets you run javac and jar in your Rake scripts without exec'ing.}
14
14
  s.email = %q{theo@iconara.net}
15
15
  s.extensions = ["Rakefile"]
@@ -29,12 +29,12 @@ Gem::Specification.new do |s|
29
29
  "examples/test/Rakefile",
30
30
  "examples/test/src/com/example/HelloWorld.java",
31
31
  "examples/test/test/com/example/TestHelloWorld.java",
32
- "java_tools.gemspec",
33
- "lib/java_tools.rb",
34
- "lib/java_tools/jar.rb",
35
- "lib/java_tools/javac.rb",
36
- "lib/java_tools/junit.rb",
37
- "lib/java_tools/output/formatting.rb",
32
+ "lib/pangolin.rb",
33
+ "lib/pangolin/jar.rb",
34
+ "lib/pangolin/javac.rb",
35
+ "lib/pangolin/junit.rb",
36
+ "lib/pangolin/output/formatting.rb",
37
+ "pangolin.gemspec",
38
38
  "spec/jar_cmd_spec.rb",
39
39
  "spec/jar_spec.rb",
40
40
  "spec/javac_cmd_spec.rb",
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  "tasks/rdoc.rake",
48
48
  "tasks/spec.rake"
49
49
  ]
50
- s.homepage = %q{http://github.com/iconara/java_tools}
50
+ s.homepage = %q{http://github.com/iconara/pangolin}
51
51
  s.rdoc_options = ["--charset=UTF-8"]
52
52
  s.require_paths = ["lib"]
53
53
  s.rubygems_version = %q{1.3.3}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pangolin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Hultberg
@@ -34,12 +34,12 @@ files:
34
34
  - examples/test/Rakefile
35
35
  - examples/test/src/com/example/HelloWorld.java
36
36
  - examples/test/test/com/example/TestHelloWorld.java
37
- - java_tools.gemspec
38
37
  - lib/pangolin.rb
39
38
  - lib/pangolin/jar.rb
40
39
  - lib/pangolin/javac.rb
41
40
  - lib/pangolin/junit.rb
42
41
  - lib/pangolin/output/formatting.rb
42
+ - pangolin.gemspec
43
43
  - spec/jar_cmd_spec.rb
44
44
  - spec/jar_spec.rb
45
45
  - spec/javac_cmd_spec.rb