Sha256: 3b8ca3b5969e5512a0a2fb36246bfdce0c0ccb932971ce98b3f386efcc18f4b5

Contents?: true

Size: 567 Bytes

Versions: 7

Compression:

Stored size: 567 Bytes

Contents

module Minke
  module Helpers
    class Shell
      ##
      # Executes a shell command and returns the return status
      def execute command
        puts 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

7 entries across 7 versions & 1 rubygems

Version Path
minke-1.11.8 lib/minke/helpers/shell.rb
minke-1.11.7 lib/minke/helpers/shell.rb
minke-1.11.6 lib/minke/helpers/shell.rb
minke-1.11.5 lib/minke/helpers/shell.rb
minke-1.11.4 lib/minke/helpers/shell.rb
minke-1.11.3 lib/minke/helpers/shell.rb
minke-1.11.2 lib/minke/helpers/shell.rb