Sha256: 1bb3954ca39572815b67234983c2af5f2ee288e5c0b462ceaacadb57bc87acc3

Contents?: true

Size: 611 Bytes

Versions: 3

Compression:

Stored size: 611 Bytes

Contents

require 'thor/group'
require 'util'
require 'fileutils'

class Remove < Thor::Group
  include Thor::Actions
  include Util


  argument :name, :type => :string, :desc => 'The presentation name'
  class_option :yes, :type => :boolean, :desc => 'do not ask'


  def remove_presentation

    presentation @name do |master,client|
      if @yes.nil?
        @yes = yes? "do you really want to delete #{File.basename(master)}?(y,N)"
      end

      if @yes
        FileUtils.rm_rf master
        FileUtils.rm_rf client
      end
    end

    alter_link(@name) do | link |
      link.parent.remove
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slidemgr-1.0.3 lib/commands/remove.rb
slidemgr-1.0.2 lib/commands/remove.rb
slidemgr-1.0.1 lib/commands/remove.rb