[ruby2java~code:4f12a25d] Hoe already defines a spec task
- From: automatthew@kenai.com
- To: commits@ruby2java.kenai.com
- Subject: [ruby2java~code:4f12a25d] Hoe already defines a spec task
- Date: Thu, 10 Dec 2009 18:54:18 +0000
Project: ruby2java
Repository: code
Revision: 4f12a25d1a19317680a228e7530da1aaff63ed9e
Author: automatthew
Date: 2009-12-10 18:53:51 UTC
Link:
Log Message:
------------
remove extraneous comment
don't mess up my test output with debug msgs
Match bitescript's new method API
Hoe already defines a spec task
Revisions:
----------
da4ad0d7ce3b40efe6b4ea5b40f799ff1b307e68
9793cc6499cacc26524afbf5679422fd144b7f2b
2125a3147d2c9636dec4d5fc44b3875a5262e904
4f12a25d1a19317680a228e7530da1aaff63ed9e
Modified Paths:
---------------
spec/spec_helper.rb
lib/compiler.rb
Rakefile
Diffs:
------
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index a71fea8..7f3772b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,10 +7,6 @@ require File.join(here, "..", "lib", "ruby2java")
# C: 1 if restargs, 0 otherwise
# D: 1 if block_given?, 0 otherwise.
-
-# TODO: These compilation methods would work better for specs if
-# they were expressed as Rake tasks. That way, we would
-# not have to rebuild class files if the sources had not changed.
JRubyJar = "#{ENV_JAVA['jruby.lib']}/jruby.jar" unless defined?(JRubyJar)
SourceDir = "#{here}/compile/src" unless defined?(SourceDir)
BuildDir = "#{here}/compile/build" unless defined?(BuildDir)
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 7f3772b..1545873 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -23,7 +23,7 @@ def ruby_compile(ruby_name, java_name=nil)
lib_files = [ "#{LibDir}/compiler.rb" ]
if out_of_date?(target, source, *lib_files)
- puts "building #{target}"
+ # puts "building #{target}"
Ruby2Java.compile(BuildDir, ruby_name, source)
end
end
@@ -34,7 +34,7 @@ def java_compile(class_name)
source = "#{SourceDir}/#{path}.java"
if out_of_date?(target, source)
command = "javac -cp #{BuildDir}:#{JRubyJar} #{source} -d #{BuildDir}"
- puts "building #{target}"
+ # puts "building #{target}"
system(command)
else
true
diff --git a/lib/compiler.rb b/lib/compiler.rb
index 9261d34..fb95d0a 100644
--- a/lib/compiler.rb
+++ b/lib/compiler.rb
@@ -82,13 +82,13 @@ module Ruby2Java
nil
end
- create_method(cb, method_name, method, signatures, annotations)
+ create_method(cb, method_name, method, [], signatures, annotations)
end
# make "initialize" a constructor method
if ruby_class.respond_to?(:signatures) && sig =
ruby_class.signatures["initialize"]
method = ruby_class.instance_method("initialize")
- create_method(cb, "initialize", method, sig, nil, :constructor =>
true)
+ create_method(cb, "initialize", method, [], sig, nil, :constructor
=> true)
end
for method_name in ruby_class.public_methods(false) do
@@ -104,11 +104,11 @@ module Ruby2Java
nil
end
- create_method(cb, method_name, method, signatures, annotations,
:static => true)
+ create_method(cb, method_name, method, [], signatures, annotations,
:static => true)
end
end
- def create_method(cb, method_name, method, signatures = nil, annotations
= nil, options = {})
+ def create_method(cb, method_name, method, exceptions, signatures = nil,
annotations = nil, options = {})
java_signature = true
unless signatures
@@ -118,11 +118,11 @@ module Ruby2Java
for s in signatures do
if options[:static]
- mb = cb.public_static_method method_name, s.retval, *(s.params)
+ mb = cb.public_static_method method_name, exceptions, s.retval,
*(s.params)
elsif options[:constructor]
- mb = cb.public_constructor *s.params
+ mb = cb.public_constructor exceptions, *s.params
else
- mb = cb.public_method method_name, s.retval, *(s.params)
+ mb = cb.public_method method_name, exceptions, s.retval,
*(s.params)
end
mb.start
diff --git a/Rakefile b/Rakefile
index 8460265..93cda04 100644
--- a/Rakefile
+++ b/Rakefile
@@ -10,19 +10,6 @@ task :default do
puts 'We\'re coming!'
end
-desc 'Runs Specs'
-task :spec do
- require 'spec/rake/spectask'
-
- Spec::Rake::SpecTask.new do |t|
- t.spec_opts ||= []
- t.spec_files = if ENV['class'].nil?
- FileList['spec/**/*_spec.rb']
- else
- File.join('spec', ENV['class']+'_spec.rb')
- end
- end
-end
file 'Manifest.txt' => :manifest
desc "Write the manifest"
|
[ruby2java~code:4f12a25d] Hoe already defines a spec task |
automatthew | 12/10/2009 |





