Class: MBuildFileUtils

Inherits:
Object show all
Defined in:
lib/cocoapods-podspec-binary/utils/file_utils.rb

Overview

FileUtils: A utility class for file operations.

Class Method Summary collapse

Class Method Details

.compress_file(input_file, output_file) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/cocoapods-podspec-binary/utils/file_utils.rb', line 17

def self.compress_file(input_file, output_file)
  File.open(input_file, 'rb') do |input|
    Zlib::GzipWriter.open(output_file) do |output|
      output.write(input.read)
    end
  end
end

.create_folder(folder_path) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/cocoapods-podspec-binary/utils/file_utils.rb', line 7

def self.create_folder(folder_path)
  return if File.directory?(folder_path)

  begin
    Dir.mkdir(folder_path)
  rescue SystemCallError => e
    puts "Error creating folder: #{e.message}"
  end
end