Sha256: 04ed8540d9343d27ab10ded8d44c788854cb7a626cb312aec1144811f2617cff

Contents?: true

Size: 533 Bytes

Versions: 43

Compression:

Stored size: 533 Bytes

Contents

require'fileutils'

module Perus::Pinger
    class RemovePath < Command
        description 'Deletes a file or folder. If "path" is a folder, all files
                     and folders within the folder are deleted as well. Valid
                     values for "path" are contained in the pinger config file.'
        option :path, restricted: true

        def run
            FileUtils.rm_rf([File.expand_path(options.path)], secure: true)
            true # with no exceptions, the removal was successful
        end
    end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
perus-1.0.6 lib/perus/pinger/commands/remove_path.rb
perus-1.0.5 lib/perus/pinger/commands/remove_path.rb
perus-1.0.4 lib/perus/pinger/commands/remove_path.rb
perus-1.0.3 lib/perus/pinger/commands/remove_path.rb
perus-1.0.2 lib/perus/pinger/commands/remove_path.rb
perus-1.0.1 lib/perus/pinger/commands/remove_path.rb
perus-1.0.0 lib/perus/pinger/commands/remove_path.rb
perus-0.1.35 lib/perus/pinger/commands/remove_path.rb
perus-0.1.34 lib/perus/pinger/commands/remove_path.rb
perus-0.1.33 lib/perus/pinger/commands/remove_path.rb
perus-0.1.32 lib/perus/pinger/commands/remove_path.rb
perus-0.1.31 lib/perus/pinger/commands/remove_path.rb
perus-0.1.30 lib/perus/pinger/commands/remove_path.rb
perus-0.1.29 lib/perus/pinger/commands/remove_path.rb
perus-0.1.28 lib/perus/pinger/commands/remove_path.rb
perus-0.1.27 lib/perus/pinger/commands/remove_path.rb
perus-0.1.26 lib/perus/pinger/commands/remove_path.rb
perus-0.1.25 lib/perus/pinger/commands/remove_path.rb
perus-0.1.24 lib/perus/pinger/commands/remove_path.rb
perus-0.1.23 lib/perus/pinger/commands/remove_path.rb