Class: Xing::Edicts::CleanRun

Inherits:
Edict::Rule
  • Object
show all
Includes:
Caliph::CommandLineDSL
Defined in:
lib/xing/edicts/clean-run.rb

Direct Known Subclasses

CleanRake

Instance Method Summary collapse

Instance Method Details

#actionObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/xing/edicts/clean-run.rb', line 23

def action
  Bundler.with_clean_env do
    Dir.chdir(dir) do
      command = cmd(*shell_cmd)

      env_hash.each_pair do |name, value|
        command.set_env(name, value)
      end

      result = caliph_shell.run(command)

      result.must_succeed!
    end
  end
end

#setupObject



19
20
21
# File 'lib/xing/edicts/clean-run.rb', line 19

def setup
  self.env_hash ||= {}
end

#setup_defaultsObject



14
15
16
17
# File 'lib/xing/edicts/clean-run.rb', line 14

def setup_defaults
  super
  @caliph_shell = Caliph::Shell.new
end