Class: MediaWikiVagrant::Destroy

Inherits:
Object
  • Object
show all
Defined in:
lib/mediawiki-vagrant/destroy.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Destroy

Returns a new instance of Destroy.



5
6
7
8
# File 'lib/mediawiki-vagrant/destroy.rb', line 5

def initialize(app, env)
  @app = app
  @mwv = Environment.new(env[:root_path] || env[:cwd])
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/mediawiki-vagrant/destroy.rb', line 10

def call(env)
  if @mwv.valid?
    env[:ui].info 'Removing puppet created files...'
    @mwv.purge_puppet_created_files
  end
  @app.call(env)
end