module ProcessingFramework
  class CompressHelper
    def CompressHelper.uncompress(x)
      case (x.split('.').last)
      when 'gz'
        system('gunzip', x)
        return File.basename(x, '.gz')
      when 'bz2'
        system('bunzip2', x)
        return File.basename(x, '.bz2')
      else
        return x
      end
    end
  end
end

module ProcessingFramework
  module CompressHelper
    include ShellOutHelper

    def uncompress(file)
      filename = case File.extname(file)
      when '.gz'
        shell_out!("gunzip #{file}", live_stream: false)
        File.basename(x, '.gz')
      when '.bz2'
        shell_out!("bunzip2 #{file}", live_stream: false)
        File.basename(x, '.bz2')
      else
        file
      end

      filename
    end
  end
end

Use new shell_out! methods for system commands
Use new shell_out! methods for system commands
