Class: Amiba::Page::Destroy

Inherits:
Thor::Group
  • Object
show all
Includes:
Generator
Defined in:
lib/amiba/page.rb

Overview

Thor task to destroy a page. It will delete all files matching the page name

Instance Method Summary collapse

Methods included from Generator

included

Instance Method Details

#init_sourceObject



106
107
108
# File 'lib/amiba/page.rb', line 106

def init_source
  @source = Amiba::Source::Page.new(name, format)
end

#pageObject



110
111
112
113
114
115
# File 'lib/amiba/page.rb', line 110

def page
  if ask("Are you sure you want to delete #{@source.filename}?" +
         " This is irreversible (y/n): ")
    remove_file(@source.filename)
  end
end