Permalink
Browse files

Tidy up a bit

  • Loading branch information...
1 parent 272dc1e commit f47c202953691d64a7cf2ee10095a2ddcde86e0b @ConradIrwin committed Aug 11, 2012
View
@@ -0,0 +1,6 @@
+.rbx
+ext/Makefile
+*.class
+*.o
+*.so
+*.gem
View
@@ -1,7 +1,23 @@
-require 'mkmf'
+require 'rbconfig'
-$CFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /1.9/
+if RbConfig::CONFIG['ruby_install_name'] == 'jruby'
-extension_name = "raise_awareness"
-dir_config(extension_name)
-create_makefile(extension_name)
+ File.open("Makefile", "w") do |f|
+ f.write "install:\n\tjrubyc --javac org/pryrepl/RaiseAwarenessEventHook.java\n"
+ end
+
+elsif RbConfig::CONFIG['ruby_install_name'] == 'ruby'
+
+ require 'mkmf'
+ $CFLAGS += " -DRUBY_19" if RUBY_VERSION =~ /^1.9/
+ extension_name = "raise_awareness"
+ dir_config(extension_name)
+ create_makefile(extension_name)
+
+else
+
+ File.open("Makefile", "w") do |f|
+ f.write "install:\n\t:\n"
+ end
+
+end
View
@@ -67,7 +67,7 @@ class << Rubinius
end
end
elsif defined?(JRuby)
- $CLASSPATH << './org/pryrepl'
+ $CLASSPATH << File.expand_path('../../ext/', __FILE__)
java_import org.pryrepl.RaiseAwarenessEventHook
module RaiseAwareness
@@ -88,7 +88,7 @@ def self.hook
end
else
- require './ext/raise_awareness.so'
+ require File.expand_path('../../ext/raise_awareness.so', __FILE__)
end
def pryly(&block)
View
@@ -0,0 +1,15 @@
+Gem::Specification.new do |s|
+ s.name = "raise_awareness"
+ s.version = "0.1"
+ s.author = "Conrad Irwin"
+ s.email = "conrad.irwin@gmail.com"
+ s.homepage = "http://github.com/ConradIrwin/raise_awareness"
+ s.summary = "Easily intercept all exceptions when they happen."
+ s.description = "Provides a cross-platform ability to intercept all exceptions as they are raised."
+
+ s.files = `git ls-files`.split("\n")
+ s.extensions = "ext/extconf.rb"
+ s.require_path = "lib"
+
+ s.add_development_dependency 'rake'
+end

0 comments on commit f47c202

Please sign in to comment.