Class: Gemsmith::Tools::Cleaner

Inherits:
Object
  • Object
show all
Defined in:
lib/gemsmith/tools/cleaner.rb

Overview

Cleans gem artifacts.

Instance Method Summary collapse

Constructor Details

#initialize(root_dir: Pathname.pwd) ⇒ Cleaner

Returns a new instance of Cleaner.



14
15
16
# File 'lib/gemsmith/tools/cleaner.rb', line 14

def initialize root_dir: Pathname.pwd
  @root_dir = root_dir
end

Instance Method Details

#call(specification) ⇒ Object



18
19
20
21
22
# File 'lib/gemsmith/tools/cleaner.rb', line 18

def call specification
  root_dir.join("pkg").remove_tree
  root_dir.files("**/*.gem").each(&:delete)
  Success specification
end