Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use a single extconf.rb, so the same gem works with MRI and Rubinius.

Update the gemspec accordingly.
  • Loading branch information...
commit a6f09d53836ece6e52791a98b480383585e2cc7f 1 parent f034765
@oggy authored
View
9 ext/extconf.rb
@@ -0,0 +1,9 @@
+ruby_engine = Object.const_defined?(:RUBY_ENGINE) ? RUBY_ENGINE : 'mri'
+extension = ruby_engine == 'ruby' ? 'mri' : ruby_engine
+
+require 'mkmf'
+$CPPFLAGS << " -DRUBY_VERSION=#{RUBY_VERSION.tr('.', '')}"
+if extension == 'mri'
+ $CPPFLAGS << " -Imri/1.9.2" if RUBY_VERSION >= '1.9.2'
+end
+create_makefile "looksee/#{extension}", extension
View
4 ext/mri/extconf.rb
@@ -1,4 +0,0 @@
-require 'mkmf'
-$CPPFLAGS << " -DRUBY_VERSION=#{RUBY_VERSION.tr('.', '')}"
-$CPPFLAGS << " -I1.9.2" if RUBY_VERSION >= '1.9.2'
-create_makefile 'looksee/mri'
View
3  ext/rbx/extconf.rb
@@ -1,3 +0,0 @@
-require 'mkmf'
-$CPPFLAGS << " -DRUBY_VERSION=#{RUBY_VERSION.tr('.', '')}"
-create_makefile 'looksee/rbx'
View
12 looksee.gemspec
@@ -9,13 +9,15 @@ Gem::Specification.new do |s|
s.date = Time.now.strftime('%Y-%m-%d')
s.summary = "Supercharged method introspection in IRB."
s.homepage = 'http://github.com/oggy/looksee'
- s.platform = Gem::Platform::CURRENT if RUBY_PLATFORM == 'java'
- ruby_engine = Object.const_defined?(:RUBY_ENGINE) ? RUBY_ENGINE : 'mri'
- extension = ruby_engine == 'ruby' ? 'mri' : ruby_engine
- s.extensions = ["ext/#{extension}/extconf.rb"] unless extension == 'jruby'
+ if RUBY_PLATFORM == 'java'
+ s.platform = Gem::Platform::CURRENT
+ else
+ s.extensions = ["ext/extconf.rb"]
+ end
+
s.extra_rdoc_files = ['CHANGELOG', 'LICENSE', 'README.markdown']
- s.files = Dir['lib/**/*', 'ext/**/{Makefile,*.c,*.h,*.rb}', 'CHANGELOG', 'LICENSE', 'Rakefile', 'README.markdown']
+ s.files = Dir['lib/**/*', 'ext/**/{*.c,*.h,*.rb}', 'CHANGELOG', 'LICENSE', 'Rakefile', 'README.markdown']
s.test_files = Dir["spec/**/*.rb"]
s.require_path = 'lib'
Please sign in to comment.
Something went wrong with that request. Please try again.