Permalink
Browse files

Move the #call alias in Compiler to simplify things a bit

  • Loading branch information...
1 parent d511ebd commit b0f80a843d70090b131d90f23ac4c5307f431ab4 @ferrous26 committed Feb 12, 2012
Showing with 8 additions and 6 deletions.
  1. +7 −5 lib/rubygems-compile/compiler.rb
  2. +1 −1 lib/rubygems-compile/post_install_hook.rb
@@ -1,9 +1,12 @@
class Gem::Compiler
include Gem::UserInteraction
- def self.compile gem
- @instance ||= Gem::Compiler.new
- @instance.compile gem
+ class << self
+ def compile gem
+ @instance ||= Gem::Compiler.new
+ @instance.compile gem
+ end
+ alias_method :call, :compile
end
def initialize
@@ -17,7 +20,7 @@ def initialize
@config = Gem.configuration
end
- def call gem
+ def compile gem
@spec = gem.is_a?(Gem::Specification) ? gem : gem.spec
return if trying_to_compile_self?
@@ -34,7 +37,6 @@ def call gem
say message if really_verbose
end
end
- alias_method :compile, :call
##
# Uses the GemAnalyzer class to determine if a given file might have
@@ -5,6 +5,6 @@
if Gem.configuration[:compile]
require 'rubygems-compile/compiler'
module Gem
- @post_install_hooks << ::Gem::Compiler.new
+ @post_install_hooks << ::Gem::Compiler
end
end

0 comments on commit b0f80a8

Please sign in to comment.