Class: Gem::Uncompiler
- Inherits:
-
Object
- Object
- Gem::Uncompiler
- Includes:
- UserInteraction
- Defined in:
- lib/rubygems-compile/uncompiler.rb
Class Method Summary collapse
Instance Method Summary collapse
- #gem_files ⇒ Object
-
#initialize ⇒ Uncompiler
constructor
A new instance of Uncompiler.
- #uncompilation_message ⇒ Object
- #uncompile(gem) ⇒ Object
Constructor Details
#initialize ⇒ Uncompiler
Returns a new instance of Uncompiler.
9 10 11 12 |
# File 'lib/rubygems-compile/uncompiler.rb', line 9 def initialize require 'fileutils' @config = Gem.configuration end |
Class Method Details
.uncompile(gem) ⇒ Object
4 5 6 7 |
# File 'lib/rubygems-compile/uncompiler.rb', line 4 def self.uncompile gem @instance ||= Gem::Uncompiler.new @instance.uncompile gem end |
Instance Method Details
#gem_files ⇒ Object
31 32 33 34 35 |
# File 'lib/rubygems-compile/uncompiler.rb', line 31 def gem_files Dir.glob(File.join(@spec.full_gem_path, '**','*.rbo')).map do |file| file.sub /#{@spec.full_gem_path}\//, '' end end |
#uncompilation_message ⇒ Object
26 27 28 29 |
# File 'lib/rubygems-compile/uncompiler.rb', line 26 def slash = @config.really_verbose ? '/' : '' "Uncompiling #{@spec.full_name}#{slash}" end |
#uncompile(gem) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rubygems-compile/uncompiler.rb', line 14 def uncompile gem @spec = gem.is_a?(Gem::Specification) ? gem : gem.spec say if @config.verbose gem_files.each do |file| absolute_file_path = File.join(@spec.full_gem_path, file) FileUtils.rm absolute_file_path say "\tAsploded #{file}" if @config.really_verbose end end |