Permalink
Browse files

Skip extension on JRuby

  • Loading branch information...
1 parent 0c05a79 commit 320dd88cc97b541b00cf1ef97657a822e5d15b52 @pietern pietern committed Mar 30, 2011
Showing with 16 additions and 10 deletions.
  1. +14 −8 hiredis.gemspec
  2. +1 −1 test/connection_test.rb
  3. +1 −1 test/reader_test.rb
View
22 hiredis.gemspec
@@ -10,15 +10,21 @@ Gem::Specification.new do |s|
s.description = s.summary
s.require_path = "lib"
- s.extensions = Dir["ext/**/extconf.rb"]
+ s.files = []
- ext_files = Dir["ext/**/*.{rb,c,h}"]
- lib_files = Dir["lib/**/*.rb"]
- hiredis_files = Dir["vendor/hiredis/*.{c,h}"] -
- Dir["vendor/hiredis/example*"] +
- Dir["vendor/hiredis/COPYING"] +
- Dir["vendor/hiredis/Makefile"]
- s.files = %w(COPYING Rakefile) + ext_files + lib_files + hiredis_files
+ if RUBY_PLATFORM =~ /java/
+ s.platform = "java"
+ else
+ s.extensions = Dir["ext/**/extconf.rb"]
+ s.files += Dir["ext/**/*.{rb,c,h}"]
+ s.files += Dir["vendor/hiredis/*.{c,h}"] -
+ Dir["vendor/hiredis/example*"] +
+ Dir["vendor/hiredis/COPYING"] +
+ Dir["vendor/hiredis/Makefile"]
+ end
+
+ s.files += Dir["lib/**/*.rb"]
+ s.files += %w(COPYING Rakefile)
s.add_development_dependency "rake-compiler", "~> 0.7.1"
end
View
2 test/connection_test.rb
@@ -1,6 +1,6 @@
require 'test/unit'
+require 'hiredis/ext/connection' unless RUBY_PLATFORM =~ /java/
require 'hiredis/ruby/connection'
-require 'hiredis/ext/connection'
module ConnectionTests
def test_connect_wrong_host
View
2 test/reader_test.rb
@@ -1,6 +1,6 @@
require 'test/unit'
+require 'hiredis/ext/reader' unless RUBY_PLATFORM =~ /java/
require 'hiredis/ruby/reader'
-require 'hiredis/ext/reader'
module ReaderTests
def test_false_on_empty_buffer

0 comments on commit 320dd88

Please sign in to comment.