Permalink
Browse files

Add Compiler.compile and Uncompiler.uncompile

  • Loading branch information...
1 parent 64453b7 commit 78a8921e4e42e1a8fce25caa9849ed039ce8f50a @ferrous26 committed Feb 12, 2012
@@ -48,8 +48,7 @@ def execute
end
require 'rubygems-compile/compiler'
- compiler = Gem::Compiler.new
- gems.each { |gem| compiler.compile(gem) }
+ gems.each { |gem| Gem::Compiler.compile gem }
end
end
@@ -36,8 +36,7 @@ def usage # :nodoc:
def execute
require 'rubygems-compile/uncompiler'
- uncompiler = Gem::Uncompiler.new
- execution_list.each { |gem| uncompiler.uncompile(gem) }
+ execution_list.each { |gem| Gem::Uncompiler.uncompile(gem) }
end
end
@@ -1,6 +1,11 @@
class Gem::Compiler
include Gem::UserInteraction
+ def self.compile gem
+ @instance ||= Gem::Compiler.new
+ @instance.compile gem
+ end
+
def initialize
require 'rbconfig'
unless MacRuby.const_defined?(:Compiler)
@@ -1,6 +1,11 @@
class Gem::Uncompiler
include Gem::UserInteraction
+ def uncompile gem
+ @instance ||= Gem::Uncompiler.new
+ @instance.uncompile gem
+ end
+
def initialize
@config = Gem.configuration
end

0 comments on commit 78a8921

Please sign in to comment.