Skip to content

Commit

Permalink
Merge branch 'feature/maglev'
Browse files Browse the repository at this point in the history
Conflicts:
	lib/monkey/ext.rb
  • Loading branch information
timfel committed Aug 31, 2011
2 parents 94a0354 + c064901 commit cd3c08d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/monkey/engine.rb
Expand Up @@ -52,10 +52,10 @@ def ruby_core?
unless defined? RUBY_ENGINE_VERSION
begin
# ruby, jruby, macruby, some rubinius versions
::RUBY_ENGINE_VERSION = const_get("#{RUBY_ENGINE.upcase}_VERSION")
::RUBY_ENGINE_VERSION = Object.const_get("#{RUBY_ENGINE.upcase}_VERSION")
rescue NameError
# maglev, some rubinius versions
::RUBY_ENGINE_VERSION = const_get("VERSION")
::RUBY_ENGINE_VERSION = Object.const_get("VERSION")
end
end

Expand Down
10 changes: 3 additions & 7 deletions lib/monkey/ext.rb
Expand Up @@ -96,16 +96,12 @@ def self.expectations
Dir[::File.dirname(__FILE__) + "/ext/*.rb"].sort.each do |path|
filename = ::File.basename(path, '.rb')
class_name = filename.capitalize
extension = eval <<-EOS
module ::Monkey::Ext::#{class_name} # <- for MacRuby!?
module ClassMethods; end # <- for 1.9
self
end
EOS
extension = ::Monkey::Ext.const_set(class_name, ::Module.new) # <- for MacRuby!?
extension.const_set("ClassMethods", ::Module.new) # <- for 1.9
extension.extend ExtDSL
extension.core_class ::Object.const_get(class_name)
require "monkey/ext/#{filename}"
end

end
end
end

0 comments on commit cd3c08d

Please sign in to comment.