Permalink
Browse files

* Add Ruby 1.9 and Rubinius compatibility

  • Loading branch information...
donv committed Jul 25, 2012
1 parent a407878 commit 9425f89041ac4f15548143ec528380fcf5134f7c
Showing with 24 additions and 7 deletions.
  1. +1 −1 Gemfile
  2. +0 −2 Gemfile.lock
  3. +1 −1 Rakefile
  4. +6 −0 assets/rakelib/ruboto.rake
  5. +1 −1 ruboto.gemspec
  6. +1 −0 run_tests.sh
  7. +12 −0 test/gem_test.rb
  8. +2 −2 test/test_helper.rb
View
@@ -2,4 +2,4 @@ source :rubygems
gem 'rake'
gem 'main'
-gem 'jruby-jars'
+# gem 'jruby-jars'
View
@@ -4,7 +4,6 @@ GEM
arrayfields (4.7.4)
chronic (0.6.7)
fattr (2.2.1)
- jruby-jars (1.6.7)
main (5.0.1)
arrayfields (>= 4.7.4)
chronic (>= 0.6.2)
@@ -18,6 +17,5 @@ PLATFORMS
ruby
DEPENDENCIES
- jruby-jars
main
rake
View
@@ -93,7 +93,7 @@ end
desc "Run the tests"
task :test do
FileUtils.rm_rf Dir['tmp/RubotoTestApp_template*']
- Dir['test/*_test.rb'].each do |f|
+ Dir['./test/*_test.rb'].each do |f|
require f.chomp('.rb')
end
end
@@ -209,6 +209,12 @@ file BUNDLE_JAR => [GEM_FILE, GEM_LOCK_FILE] do
sh "bundle install --gemfile #{GEM_FILE} --path=#{BUNDLE_PATH}"
gem_path = Dir["#{BUNDLE_PATH}/*ruby/1.8/gems"][0]
+ gem_paths = Dir["#{BUNDLE_PATH}/*ruby/*/gems"]
+ raise "Gem path not found" if gem_paths.empty?
+ raise "Found multiple gem paths: #{gem_paths}" if gem_paths.size > 1
+ gem_path = gem_paths[0]
+ puts "Found gems in #{gem_path}"
+
if package != 'org.ruboto.core' && JRUBY_JARS.none? { |f| File.exists? f }
Dir.chdir gem_path do
Dir['{activerecord-jdbc-adapter, jruby-openssl}-*'].each do |g|
View
@@ -1,5 +1,5 @@
require 'rake'
-require 'lib/ruboto/version'
+require File.join(File.dirname(__FILE__), 'lib', 'ruboto', 'version')
Gem::Specification.new do |s|
s.name = %q{ruboto}
View
@@ -42,5 +42,6 @@ if [ "$RUBY_IMPL" != "" ] ; then
echo -n
fi
+export NOEXEC=0
rake platform:clean
rake test --trace
View
@@ -0,0 +1,12 @@
+require File.expand_path("test_helper", File.dirname(__FILE__))
+
+class GemTest < Test::Unit::TestCase
+ def test_rake_gem
+ gem_file = "ruboto-#{Ruboto::VERSION}.gem"
+ File.delete(gem_file) if File.exists?(gem_file)
+ assert !File.exists?(gem_file)
+ system 'rake gem'
+ assert File.exists?(gem_file)
+ end
+
+end
View
@@ -128,9 +128,9 @@ class Test::Unit::TestCase
alias old_run run
def run(*args, &block)
- mark_test_start("#{self.class.name}\##{method_name}")
+ mark_test_start("#{self.class.name}\##{respond_to?(:method_name) ? method_name : __name__}")
old_run(*args, &block)
- mark_test_end("#{self.class.name}\##{method_name}")
+ mark_test_end("#{self.class.name}\##{respond_to?(:method_name) ? method_name : __name__}")
end
def mark_test_start(test_name)

0 comments on commit 9425f89

Please sign in to comment.