Sha256: 2904d667cf29e34a9a17d3e7c55e488f66bb765d485b82bf22442c0971fabdfb

Contents?: true

Size: 546 Bytes

Versions: 2

Compression:

Stored size: 546 Bytes

Contents

module Minke
  module Helpers
    class Shell
      ##
      # Executes a shell command and returns the return status
      def execute command
        system("#{command}")
      end

      def execute_and_return command
        log = `#{command}`
        return log.strip
      end

      def mktmpdir
        Dir.mktmpdir
      end

      def remove_entry_secure dir
        FileUtils.remove_entry_secure dir
      end

      def write_file filename, data
        File.open(filename, 'w') { |file| file.write(data) }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
minke-1.11.1 lib/minke/helpers/shell.rb
minke-1.11.0 lib/minke/helpers/shell.rb