Permalink
Browse files

fix gemspec and autorequire for native version

  • Loading branch information...
1 parent 4234046 commit d828594971acdc462838dde783ec0e953f3ae596 @funny-falcon committed Aug 2, 2012
Showing with 15 additions and 3 deletions.
  1. +12 −1 lib/murmurhash3.rb
  2. +1 −1 lib/murmurhash3/version.rb
  3. +2 −1 murmurhash3.gemspec
View
@@ -1,5 +1,16 @@
require "murmurhash3/version"
module MurmurHash3
-
+ begin
+ require 'murmurhash3/native_murmur'
+ V32 = Native32
+ V128 = Native128
+ rescue LoadError
+ require 'murmurhash3/pure_ruby'
+ if RUBY_ENGINE == 'ruby'
+ $stderr.puts "Attention: used pure ruby version of MurmurHash3"
+ end
+ V32 = PureRuby32
+ V128 = PureRuby128
+ end
end
@@ -1,3 +1,3 @@
module MurmurHash3
- VERSION = "0.0.1"
+ VERSION = "0.1.1"
end
View
@@ -11,7 +11,8 @@ Gem::Specification.new do |gem|
gem.files = Dir['ext/**/*'].grep(/\.(rb|c)$/) +
(Dir['lib/**/*'] + Dir['test/**/*']).grep(/\.rb$/)
gem.test_files = gem.files.grep(%r{^test/})
+ gem.extensions = ["ext/murmurhash3/extconf.rb"]
gem.name = "murmurhash3"
gem.require_paths = ["lib", "ext"]
- gem.version = Murmurhash3::VERSION
+ gem.version = MurmurHash3::VERSION
end

0 comments on commit d828594

Please sign in to comment.