class RakeDependencies::Extractors::UncompressedExtractor

Public Class Methods

new(file_path, extract_path, options = {}) click to toggle source
# File lib/rake_dependencies/extractors.rb, line 59
def initialize(file_path, extract_path, options = {})
  @file_path = file_path
  @extract_path = extract_path
  @options = options
end

Public Instance Methods

extract() click to toggle source
# File lib/rake_dependencies/extractors.rb, line 65
def extract
  target_name = @options[:rename_to] || File.basename(@file_path)
  source = @file_path
  destination = File.join(@extract_path, target_name)

  FileUtils.mkdir_p(@extract_path)
  FileUtils.cp(source, destination)
  FileUtils.chmod(0755, destination)
end