Sha256: d0cf7af2d17249a2c2fa32ebaf9057c76a21680ac1d8284c3c4a4118ab2b29b0
Contents?: true
Size: 736 Bytes
Versions: 12
Compression:
Stored size: 736 Bytes
Contents
module SmallCage::Commands class Clean def self.execute(opts) self.new(opts).execute end def initialize(opts) @opts = opts end def execute target = Pathname.new(@opts[:path]) unless target.exist? raise "target directory or file does not exist.: " + target.to_s end loader = SmallCage::Loader.new(target) loader.each_smc_obj do |obj| if obj["path"].exist? obj["path"].delete puts "D " + obj["uri"] unless @opts[:quiet] end end tmpdir = loader.root + "./_smc/tmp" if tmpdir.exist? FileUtils.rm_r(tmpdir) puts "D /_smc/tmp" unless @opts[:quiet] end end end end
Version data entries
12 entries across 12 versions & 2 rubygems