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-0.1.22 lib/perus/pinger/commands/remove_path.rb
perus-0.1.21 lib/perus/pinger/commands/remove_path.rb
perus-0.1.20 lib/perus/pinger/commands/remove_path.rb
perus-0.1.19 lib/perus/pinger/commands/remove_path.rb
perus-0.1.18 lib/perus/pinger/commands/remove_path.rb
perus-0.1.17 lib/perus/pinger/commands/remove_path.rb
perus-0.1.16 lib/perus/pinger/commands/remove_path.rb
perus-0.1.15 lib/perus/pinger/commands/remove_path.rb
perus-0.1.14 lib/perus/pinger/commands/remove_path.rb
perus-0.1.13 lib/perus/pinger/commands/remove_path.rb
perus-0.1.12 lib/perus/pinger/commands/remove_path.rb
perus-0.1.11 lib/perus/pinger/commands/remove_path.rb
perus-0.1.10 lib/perus/pinger/commands/remove_path.rb
perus-0.1.9 lib/perus/pinger/commands/remove_path.rb
perus-0.1.8 lib/perus/pinger/commands/remove_path.rb
perus-0.1.7 lib/perus/pinger/commands/remove_path.rb
perus-0.1.6 lib/perus/pinger/commands/remove_path.rb
perus-0.1.5 lib/perus/pinger/commands/remove_path.rb
perus-0.1.4 lib/perus/pinger/commands/remove_path.rb
perus-0.1.3 lib/perus/pinger/commands/remove_path.rb