Skip to content

Commit

Permalink
Add Compiler.compile and Uncompiler.uncompile
Browse files Browse the repository at this point in the history
  • Loading branch information
ferrous26 committed Feb 12, 2012
1 parent 64453b7 commit 78a8921
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/rubygems-compile/commands/compile_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions lib/rubygems-compile/commands/uncompile_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions lib/rubygems-compile/compiler.rb
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 5 additions & 0 deletions lib/rubygems-compile/uncompiler.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 78a8921

Please sign in to comment.