Skip to content

Commit

Permalink
Remove duplicate methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mizzy committed Sep 23, 2013
1 parent 1ef3747 commit 619deac
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions lib/serverspec/backend/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,7 @@

module Serverspec
module Backend
class Exec
include Singleton

def set_commands(c)
@commands = c
end

def set_example(e)
@example = e
end

def commands
@commands
end
class Exec < Base

def run_command(cmd, opts={})
cmd = build_command(cmd)
Expand Down Expand Up @@ -52,16 +39,6 @@ def add_pre_command(cmd)
cmd
end

def check_zero(cmd, *args)
ret = run_command(commands.send(cmd, *args))
ret[:exit_status] == 0
end

# Default action is to call check_zero with args
def method_missing(meth, *args, &block)
check_zero(meth, *args)
end

def check_running(process)
ret = run_command(commands.check_running(process))
if ret[:exit_status] == 1 || ret[:stdout] =~ /stopped/
Expand Down

0 comments on commit 619deac

Please sign in to comment.